Skip to content

Commit 6038f37

Browse files
committed
llseek: automatically add .llseek fop
All file_operations should get a .llseek operation so we can make nonseekable_open the default for future file operations without a .llseek pointer. The three cases that we can automatically detect are no_llseek, seq_lseek and default_llseek. For cases where we can we can automatically prove that the file offset is always ignored, we use noop_llseek, which maintains the current behavior of not returning an error from a seek. New drivers should normally not use noop_llseek but instead use no_llseek and call nonseekable_open at open time. Existing drivers can be converted to do the same when the maintainer knows for certain that no user code relies on calling seek on the device file. The generated code is often incorrectly indented and right now contains comments that clarify for each added line why a specific variant was chosen. In the version that gets submitted upstream, the comments will be gone and I will manually fix the indentation, because there does not seem to be a way to do that using coccinelle. Some amount of new code is currently sitting in linux-next that should get the same modifications, which I will do at the end of the merge window. Many thanks to Julia Lawall for helping me learn to write a semantic patch that does all this. ===== begin semantic patch ===== // This adds an llseek= method to all file operations, // as a preparation for making no_llseek the default. // // The rules are // - use no_llseek explicitly if we do nonseekable_open // - use seq_lseek for sequential files // - use default_llseek if we know we access f_pos // - use noop_llseek if we know we don't access f_pos, // but we still want to allow users to call lseek // @ open1 exists @ identifier nested_open; @@ nested_open(...) { <+... nonseekable_open(...) ...+> } @ open exists@ identifier open_f; identifier i, f; identifier open1.nested_open; @@ int open_f(struct inode *i, struct file *f) { <+... ( nonseekable_open(...) | nested_open(...) ) ...+> } @ read disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ read_no_fpos disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { ... when != off } @ write @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ write_no_fpos @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { ... when != off } @ fops0 @ identifier fops; @@ struct file_operations fops = { ... }; @ has_llseek depends on fops0 @ identifier fops0.fops; identifier llseek_f; @@ struct file_operations fops = { ... .llseek = llseek_f, ... }; @ has_read depends on fops0 @ identifier fops0.fops; identifier read_f; @@ struct file_operations fops = { ... .read = read_f, ... }; @ has_write depends on fops0 @ identifier fops0.fops; identifier write_f; @@ struct file_operations fops = { ... .write = write_f, ... }; @ has_open depends on fops0 @ identifier fops0.fops; identifier open_f; @@ struct file_operations fops = { ... .open = open_f, ... }; // use no_llseek if we call nonseekable_open //////////////////////////////////////////// @ nonseekable1 depends on !has_llseek && has_open @ identifier fops0.fops; identifier nso ~= "nonseekable_open"; @@ struct file_operations fops = { ... .open = nso, ... +.llseek = no_llseek, /* nonseekable */ }; @ nonseekable2 depends on !has_llseek @ identifier fops0.fops; identifier open.open_f; @@ struct file_operations fops = { ... .open = open_f, ... +.llseek = no_llseek, /* open uses nonseekable */ }; // use seq_lseek for sequential files ///////////////////////////////////// @ seq depends on !has_llseek @ identifier fops0.fops; identifier sr ~= "seq_read"; @@ struct file_operations fops = { ... .read = sr, ... +.llseek = seq_lseek, /* we have seq_read */ }; // use default_llseek if there is a readdir /////////////////////////////////////////// @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier readdir_e; @@ // any other fop is used that changes pos struct file_operations fops = { ... .readdir = readdir_e, ... +.llseek = default_llseek, /* readdir is present */ }; // use default_llseek if at least one of read/write touches f_pos ///////////////////////////////////////////////////////////////// @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read.read_f; @@ // read fops use offset struct file_operations fops = { ... .read = read_f, ... +.llseek = default_llseek, /* read accesses f_pos */ }; @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, ... + .llseek = default_llseek, /* write accesses f_pos */ }; // Use noop_llseek if neither read nor write accesses f_pos /////////////////////////////////////////////////////////// @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; identifier write_no_fpos.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, .read = read_f, ... +.llseek = noop_llseek, /* read and write both use no f_pos */ }; @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write_no_fpos.write_f; @@ struct file_operations fops = { ... .write = write_f, ... +.llseek = noop_llseek, /* write uses no f_pos */ }; @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; @@ struct file_operations fops = { ... .read = read_f, ... +.llseek = noop_llseek, /* read uses no f_pos */ }; @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; @@ struct file_operations fops = { ... +.llseek = noop_llseek, /* no read or write fn */ }; ===== End semantic patch ===== Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Julia Lawall <julia@diku.dk> Cc: Christoph Hellwig <hch@infradead.org>
1 parent 1ec5584 commit 6038f37

File tree

339 files changed

+538
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+538
-73
lines changed

arch/arm/kernel/etm.c

+1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ static const struct file_operations etb_fops = {
314314
.read = etb_read,
315315
.open = etb_open,
316316
.release = etb_release,
317+
.llseek = no_llseek,
317318
};
318319

319320
static struct miscdevice etb_miscdev = {

arch/arm/mach-msm/last_radio_log.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ static ssize_t last_radio_log_read(struct file *file, char __user *buf,
4848
}
4949

5050
static struct file_operations last_radio_log_fops = {
51-
.read = last_radio_log_read
51+
.read = last_radio_log_read,
52+
.llseek = default_llseek,
5253
};
5354

5455
void msm_init_last_radio_log(struct module *owner)

arch/arm/mach-msm/smd_debug.c

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ static int debug_open(struct inode *inode, struct file *file)
212212
static const struct file_operations debug_ops = {
213213
.read = debug_read,
214214
.open = debug_open,
215+
.llseek = default_llseek,
215216
};
216217

217218
static void debug_create(const char *name, mode_t mode,

arch/arm/plat-mxc/audmux-v2.c

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
137137
static const struct file_operations audmux_debugfs_fops = {
138138
.open = audmux_open_file,
139139
.read = audmux_read_file,
140+
.llseek = default_llseek,
140141
};
141142

142143
static void audmux_debugfs_init(void)

arch/avr32/boards/mimc200/fram.c

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static int fram_mmap(struct file *filp, struct vm_area_struct *vma)
4141
static const struct file_operations fram_fops = {
4242
.owner = THIS_MODULE,
4343
.mmap = fram_mmap,
44+
.llseek = noop_llseek,
4445
};
4546

4647
#define FRAM_MINOR 0

arch/blackfin/kernel/kgdb_test.c

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static const struct file_operations kgdb_test_proc_fops = {
8888
.owner = THIS_MODULE,
8989
.read = kgdb_test_proc_read,
9090
.write = kgdb_test_proc_write,
91+
.llseek = noop_llseek,
9192
};
9293

9394
static int __init kgdbtest_init(void)

arch/blackfin/mach-bf561/coreb.c

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ coreb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
5151
static const struct file_operations coreb_fops = {
5252
.owner = THIS_MODULE,
5353
.unlocked_ioctl = coreb_ioctl,
54+
.llseek = noop_llseek,
5455
};
5556

5657
static struct miscdevice coreb_dev = {

arch/cris/arch-v10/drivers/ds1302.c

+1
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ print_rtc_status(void)
387387
static const struct file_operations rtc_fops = {
388388
.owner = THIS_MODULE,
389389
.unlocked_ioctl = rtc_unlocked_ioctl,
390+
.llseek = noop_llseek,
390391
};
391392

392393
/* Probe for the chip by writing something to its RAM and try reading it back. */

arch/cris/arch-v10/drivers/gpio.c

+1
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ static const struct file_operations gpio_fops = {
745745
.write = gpio_write,
746746
.open = gpio_open,
747747
.release = gpio_release,
748+
.llseek = noop_llseek,
748749
};
749750

750751
static void ioif_watcher(const unsigned int gpio_in_available,

arch/cris/arch-v10/drivers/i2c.c

+1
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ static const struct file_operations i2c_fops = {
617617
.unlocked_ioctl = i2c_ioctl,
618618
.open = i2c_open,
619619
.release = i2c_release,
620+
.llseek = noop_llseek,
620621
};
621622

622623
int __init

arch/cris/arch-v10/drivers/pcf8563.c

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static int voltage_low;
6464
static const struct file_operations pcf8563_fops = {
6565
.owner = THIS_MODULE,
6666
.unlocked_ioctl = pcf8563_unlocked_ioctl,
67+
.llseek = noop_llseek,
6768
};
6869

6970
unsigned char

arch/cris/arch-v10/drivers/sync_serial.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ static const struct file_operations sync_serial_fops = {
250250
.poll = sync_serial_poll,
251251
.unlocked_ioctl = sync_serial_ioctl,
252252
.open = sync_serial_open,
253-
.release = sync_serial_release
253+
.release = sync_serial_release,
254+
.llseek = noop_llseek,
254255
};
255256

256257
static int __init etrax_sync_serial_init(void)

arch/cris/arch-v32/drivers/cryptocop.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ const struct file_operations cryptocop_fops = {
281281
.owner = THIS_MODULE,
282282
.open = cryptocop_open,
283283
.release = cryptocop_release,
284-
.unlocked_ioctl = cryptocop_ioctl
284+
.unlocked_ioctl = cryptocop_ioctl,
285+
.llseek = noop_llseek,
285286
};
286287

287288

arch/cris/arch-v32/drivers/i2c.c

+1
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ static const struct file_operations i2c_fops = {
698698
.unlocked_ioctl = i2c_ioctl,
699699
.open = i2c_open,
700700
.release = i2c_release,
701+
.llseek = noop_llseek,
701702
};
702703

703704
static int __init i2c_init(void)

arch/cris/arch-v32/drivers/mach-a3/gpio.c

+1
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ static const struct file_operations gpio_fops = {
893893
.write = gpio_write,
894894
.open = gpio_open,
895895
.release = gpio_release,
896+
.llseek = noop_llseek,
896897
};
897898

898899
#ifdef CONFIG_ETRAX_VIRTUAL_GPIO

arch/cris/arch-v32/drivers/mach-fs/gpio.c

+1
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ static const struct file_operations gpio_fops = {
870870
.write = gpio_write,
871871
.open = gpio_open,
872872
.release = gpio_release,
873+
.llseek = noop_llseek,
873874
};
874875

875876
#ifdef CONFIG_ETRAX_VIRTUAL_GPIO

arch/cris/arch-v32/drivers/pcf8563.c

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static int voltage_low;
6060
static const struct file_operations pcf8563_fops = {
6161
.owner = THIS_MODULE,
6262
.unlocked_ioctl = pcf8563_unlocked_ioctl,
63+
.llseek = noop_llseek,
6364
};
6465

6566
unsigned char

arch/cris/arch-v32/drivers/sync_serial.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ static const struct file_operations sync_serial_fops = {
247247
.poll = sync_serial_poll,
248248
.unlocked_ioctl = sync_serial_ioctl,
249249
.open = sync_serial_open,
250-
.release = sync_serial_release
250+
.release = sync_serial_release,
251+
.llseek = noop_llseek,
251252
};
252253

253254
static int __init etrax_sync_serial_init(void)

arch/cris/kernel/profile.c

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ write_cris_profile(struct file *file, const char __user *buf,
5959
static const struct file_operations cris_proc_profile_operations = {
6060
.read = read_cris_profile,
6161
.write = write_cris_profile,
62+
.llseek = default_llseek,
6263
};
6364

6465
static int __init init_cris_profile(void)

arch/ia64/kernel/salinfo.c

+2
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t
354354
static const struct file_operations salinfo_event_fops = {
355355
.open = salinfo_event_open,
356356
.read = salinfo_event_read,
357+
.llseek = noop_llseek,
357358
};
358359

359360
static int
@@ -571,6 +572,7 @@ static const struct file_operations salinfo_data_fops = {
571572
.release = salinfo_log_release,
572573
.read = salinfo_log_read,
573574
.write = salinfo_log_write,
575+
.llseek = default_llseek,
574576
};
575577

576578
static int __cpuinit

arch/ia64/sn/kernel/sn2/sn_hwperf.c

+1
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ static long sn_hwperf_ioctl(struct file *fp, u32 op, unsigned long arg)
860860

861861
static const struct file_operations sn_hwperf_fops = {
862862
.unlocked_ioctl = sn_hwperf_ioctl,
863+
.llseek = noop_llseek,
863864
};
864865

865866
static struct miscdevice sn_hwperf_dev = {

arch/m68k/bvme6000/rtc.c

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ static const struct file_operations rtc_fops = {
155155
.unlocked_ioctl = rtc_ioctl,
156156
.open = rtc_open,
157157
.release = rtc_release,
158+
.llseek = noop_llseek,
158159
};
159160

160161
static struct miscdevice rtc_dev = {

arch/m68k/mvme16x/rtc.c

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static const struct file_operations rtc_fops = {
144144
.unlocked_ioctl = rtc_ioctl,
145145
.open = rtc_open,
146146
.release = rtc_release,
147+
.llseek = noop_llseek,
147148
};
148149

149150
static struct miscdevice rtc_dev=

arch/mips/kernel/rtlx.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ static const struct file_operations rtlx_fops = {
468468
.release = file_release,
469469
.write = file_write,
470470
.read = file_read,
471-
.poll = file_poll
471+
.poll = file_poll,
472+
.llseek = noop_llseek,
472473
};
473474

474475
static struct irqaction rtlx_irq = {

arch/mips/kernel/vpe.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,8 @@ static const struct file_operations vpe_fops = {
11921192
.owner = THIS_MODULE,
11931193
.open = vpe_open,
11941194
.release = vpe_release,
1195-
.write = vpe_write
1195+
.write = vpe_write,
1196+
.llseek = noop_llseek,
11961197
};
11971198

11981199
/* module wrapper entry points */

arch/mips/sibyte/common/sb_tbprof.c

+1
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ static const struct file_operations sbprof_tb_fops = {
545545
.unlocked_ioctl = sbprof_tb_ioctl,
546546
.compat_ioctl = sbprof_tb_ioctl,
547547
.mmap = NULL,
548+
.llseek = default_llseek,
548549
};
549550

550551
static struct class *tb_class;

arch/powerpc/kernel/lparcfg.c

+1
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ static const struct file_operations lparcfg_fops = {
780780
.write = lparcfg_write,
781781
.open = lparcfg_open,
782782
.release = single_release,
783+
.llseek = seq_lseek,
783784
};
784785

785786
static int __init lparcfg_init(void)

arch/powerpc/kernel/rtas_flash.c

+3
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ static const struct file_operations rtas_flash_operations = {
716716
.write = rtas_flash_write,
717717
.open = rtas_excl_open,
718718
.release = rtas_flash_release,
719+
.llseek = default_llseek,
719720
};
720721

721722
static const struct file_operations manage_flash_operations = {
@@ -724,6 +725,7 @@ static const struct file_operations manage_flash_operations = {
724725
.write = manage_flash_write,
725726
.open = rtas_excl_open,
726727
.release = rtas_excl_release,
728+
.llseek = default_llseek,
727729
};
728730

729731
static const struct file_operations validate_flash_operations = {
@@ -732,6 +734,7 @@ static const struct file_operations validate_flash_operations = {
732734
.write = validate_flash_write,
733735
.open = rtas_excl_open,
734736
.release = validate_flash_release,
737+
.llseek = default_llseek,
735738
};
736739

737740
static int __init rtas_flash_init(void)

arch/powerpc/kernel/rtasd.c

+1
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ static const struct file_operations proc_rtas_log_operations = {
354354
.poll = rtas_log_poll,
355355
.open = rtas_log_open,
356356
.release = rtas_log_release,
357+
.llseek = noop_llseek,
357358
};
358359

359360
static int enable_surveillance(int timeout)

arch/powerpc/platforms/iseries/mf.c

+1
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@ static ssize_t proc_mf_change_vmlinux(struct file *file,
12491249

12501250
static const struct file_operations proc_vmlinux_operations = {
12511251
.write = proc_mf_change_vmlinux,
1252+
.llseek = default_llseek,
12521253
};
12531254

12541255
static int __init mf_proc_init(void)

arch/powerpc/platforms/pseries/reconfig.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t coun
539539
}
540540

541541
static const struct file_operations ofdt_fops = {
542-
.write = ofdt_write
542+
.write = ofdt_write,
543+
.llseek = noop_llseek,
543544
};
544545

545546
/* create /proc/powerpc/ofdt write-only by root */

arch/powerpc/platforms/pseries/scanlog.c

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ const struct file_operations scanlog_fops = {
170170
.write = scanlog_write,
171171
.open = scanlog_open,
172172
.release = scanlog_release,
173+
.llseek = noop_llseek,
173174
};
174175

175176
static int __init scanlog_init(void)

arch/s390/crypto/prng.c

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ static const struct file_operations prng_fops = {
152152
.open = &prng_open,
153153
.release = NULL,
154154
.read = &prng_read,
155+
.llseek = noop_llseek,
155156
};
156157

157158
static struct miscdevice prng_dev = {

arch/s390/hypfs/hypfs_diag.c

+1
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ static const struct file_operations dbfs_d204_ops = {
618618
.open = dbfs_d204_open,
619619
.read = dbfs_d204_read,
620620
.release = dbfs_d204_release,
621+
.llseek = no_llseek,
621622
};
622623

623624
static int hypfs_dbfs_init(void)

arch/s390/hypfs/hypfs_vm.c

+1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ static const struct file_operations dbfs_d2fc_ops = {
275275
.open = dbfs_d2fc_open,
276276
.read = dbfs_d2fc_read,
277277
.release = dbfs_d2fc_release,
278+
.llseek = no_llseek,
278279
};
279280

280281
int hypfs_vm_init(void)

arch/s390/hypfs/inode.c

+1
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ static const struct file_operations hypfs_file_ops = {
449449
.write = do_sync_write,
450450
.aio_read = hypfs_aio_read,
451451
.aio_write = hypfs_aio_write,
452+
.llseek = no_llseek,
452453
};
453454

454455
static struct file_system_type hypfs_type = {

arch/s390/kernel/debug.c

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ static const struct file_operations debug_file_ops = {
174174
.write = debug_input,
175175
.open = debug_open,
176176
.release = debug_close,
177+
.llseek = no_llseek,
177178
};
178179

179180
static struct dentry *debug_debugfs_root_entry;

arch/sh/boards/mach-landisk/gio.c

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ static const struct file_operations gio_fops = {
128128
.open = gio_open, /* open */
129129
.release = gio_close, /* release */
130130
.unlocked_ioctl = gio_ioctl,
131+
.llseek = noop_llseek,
131132
};
132133

133134
static int __init gio_init(void)

arch/sparc/kernel/apc.c

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ static const struct file_operations apc_fops = {
132132
.unlocked_ioctl = apc_ioctl,
133133
.open = apc_open,
134134
.release = apc_release,
135+
.llseek = noop_llseek,
135136
};
136137

137138
static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };

arch/sparc/kernel/mdesc.c

+1
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ static ssize_t mdesc_read(struct file *file, char __user *buf,
890890
static const struct file_operations mdesc_fops = {
891891
.read = mdesc_read,
892892
.owner = THIS_MODULE,
893+
.llseek = noop_llseek,
893894
};
894895

895896
static struct miscdevice mdesc_misc = {

arch/tile/kernel/hardwall.c

+1
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ static const struct file_operations dev_hardwall_fops = {
774774
#endif
775775
.flush = hardwall_flush,
776776
.release = hardwall_release,
777+
.llseek = noop_llseek,
777778
};
778779

779780
static struct cdev hardwall_dev;

arch/um/drivers/harddog_kern.c

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static const struct file_operations harddog_fops = {
166166
.unlocked_ioctl = harddog_ioctl,
167167
.open = harddog_open,
168168
.release = harddog_release,
169+
.llseek = no_llseek,
169170
};
170171

171172
static struct miscdevice harddog_miscdev = {

arch/um/drivers/mconsole_kern.c

+1
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ static ssize_t mconsole_proc_write(struct file *file,
843843
static const struct file_operations mconsole_proc_fops = {
844844
.owner = THIS_MODULE,
845845
.write = mconsole_proc_write,
846+
.llseek = noop_llseek,
846847
};
847848

848849
static int create_proc_mconsole(void)

arch/um/drivers/mmapper_kern.c

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ static const struct file_operations mmapper_fops = {
9393
.mmap = mmapper_mmap,
9494
.open = mmapper_open,
9595
.release = mmapper_release,
96+
.llseek = default_llseek,
9697
};
9798

9899
/*

arch/um/drivers/random.c

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ static const struct file_operations rng_chrdev_ops = {
100100
.owner = THIS_MODULE,
101101
.open = rng_dev_open,
102102
.read = rng_dev_read,
103+
.llseek = noop_llseek,
103104
};
104105

105106
/* rng_init shouldn't be called more than once at boot time */

0 commit comments

Comments
 (0)