Skip to content

Commit

Permalink
llseek: automatically add .llseek fop
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Julia Lawall <[email protected]>
Cc: Christoph Hellwig <[email protected]>
  • Loading branch information
arndb committed Oct 15, 2010
1 parent 1ec5584 commit 6038f37
Show file tree
Hide file tree
Showing 339 changed files with 538 additions and 73 deletions.
1 change: 1 addition & 0 deletions arch/arm/kernel/etm.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ static const struct file_operations etb_fops = {
.read = etb_read,
.open = etb_open,
.release = etb_release,
.llseek = no_llseek,
};

static struct miscdevice etb_miscdev = {
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-msm/last_radio_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ static ssize_t last_radio_log_read(struct file *file, char __user *buf,
}

static struct file_operations last_radio_log_fops = {
.read = last_radio_log_read
.read = last_radio_log_read,
.llseek = default_llseek,
};

void msm_init_last_radio_log(struct module *owner)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-msm/smd_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ static int debug_open(struct inode *inode, struct file *file)
static const struct file_operations debug_ops = {
.read = debug_read,
.open = debug_open,
.llseek = default_llseek,
};

static void debug_create(const char *name, mode_t mode,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/plat-mxc/audmux-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
static const struct file_operations audmux_debugfs_fops = {
.open = audmux_open_file,
.read = audmux_read_file,
.llseek = default_llseek,
};

static void audmux_debugfs_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/avr32/boards/mimc200/fram.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ static int fram_mmap(struct file *filp, struct vm_area_struct *vma)
static const struct file_operations fram_fops = {
.owner = THIS_MODULE,
.mmap = fram_mmap,
.llseek = noop_llseek,
};

#define FRAM_MINOR 0
Expand Down
1 change: 1 addition & 0 deletions arch/blackfin/kernel/kgdb_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ static const struct file_operations kgdb_test_proc_fops = {
.owner = THIS_MODULE,
.read = kgdb_test_proc_read,
.write = kgdb_test_proc_write,
.llseek = noop_llseek,
};

static int __init kgdbtest_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/blackfin/mach-bf561/coreb.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coreb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static const struct file_operations coreb_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = coreb_ioctl,
.llseek = noop_llseek,
};

static struct miscdevice coreb_dev = {
Expand Down
1 change: 1 addition & 0 deletions arch/cris/arch-v10/drivers/ds1302.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ print_rtc_status(void)
static const struct file_operations rtc_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = rtc_unlocked_ioctl,
.llseek = noop_llseek,
};

/* Probe for the chip by writing something to its RAM and try reading it back. */
Expand Down
1 change: 1 addition & 0 deletions arch/cris/arch-v10/drivers/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ static const struct file_operations gpio_fops = {
.write = gpio_write,
.open = gpio_open,
.release = gpio_release,
.llseek = noop_llseek,
};

static void ioif_watcher(const unsigned int gpio_in_available,
Expand Down
1 change: 1 addition & 0 deletions arch/cris/arch-v10/drivers/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ static const struct file_operations i2c_fops = {
.unlocked_ioctl = i2c_ioctl,
.open = i2c_open,
.release = i2c_release,
.llseek = noop_llseek,
};

int __init
Expand Down
1 change: 1 addition & 0 deletions arch/cris/arch-v10/drivers/pcf8563.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ static int voltage_low;
static const struct file_operations pcf8563_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = pcf8563_unlocked_ioctl,
.llseek = noop_llseek,
};

unsigned char
Expand Down
3 changes: 2 additions & 1 deletion arch/cris/arch-v10/drivers/sync_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ static const struct file_operations sync_serial_fops = {
.poll = sync_serial_poll,
.unlocked_ioctl = sync_serial_ioctl,
.open = sync_serial_open,
.release = sync_serial_release
.release = sync_serial_release,
.llseek = noop_llseek,
};

static int __init etrax_sync_serial_init(void)
Expand Down
3 changes: 2 additions & 1 deletion arch/cris/arch-v32/drivers/cryptocop.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ const struct file_operations cryptocop_fops = {
.owner = THIS_MODULE,
.open = cryptocop_open,
.release = cryptocop_release,
.unlocked_ioctl = cryptocop_ioctl
.unlocked_ioctl = cryptocop_ioctl,
.llseek = noop_llseek,
};


Expand Down
1 change: 1 addition & 0 deletions arch/cris/arch-v32/drivers/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ static const struct file_operations i2c_fops = {
.unlocked_ioctl = i2c_ioctl,
.open = i2c_open,
.release = i2c_release,
.llseek = noop_llseek,
};

static int __init i2c_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/cris/arch-v32/drivers/mach-a3/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ static const struct file_operations gpio_fops = {
.write = gpio_write,
.open = gpio_open,
.release = gpio_release,
.llseek = noop_llseek,
};

#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
Expand Down
1 change: 1 addition & 0 deletions arch/cris/arch-v32/drivers/mach-fs/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ static const struct file_operations gpio_fops = {
.write = gpio_write,
.open = gpio_open,
.release = gpio_release,
.llseek = noop_llseek,
};

#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
Expand Down
1 change: 1 addition & 0 deletions arch/cris/arch-v32/drivers/pcf8563.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static int voltage_low;
static const struct file_operations pcf8563_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = pcf8563_unlocked_ioctl,
.llseek = noop_llseek,
};

unsigned char
Expand Down
3 changes: 2 additions & 1 deletion arch/cris/arch-v32/drivers/sync_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ static const struct file_operations sync_serial_fops = {
.poll = sync_serial_poll,
.unlocked_ioctl = sync_serial_ioctl,
.open = sync_serial_open,
.release = sync_serial_release
.release = sync_serial_release,
.llseek = noop_llseek,
};

static int __init etrax_sync_serial_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/cris/kernel/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ write_cris_profile(struct file *file, const char __user *buf,
static const struct file_operations cris_proc_profile_operations = {
.read = read_cris_profile,
.write = write_cris_profile,
.llseek = default_llseek,
};

static int __init init_cris_profile(void)
Expand Down
2 changes: 2 additions & 0 deletions arch/ia64/kernel/salinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t
static const struct file_operations salinfo_event_fops = {
.open = salinfo_event_open,
.read = salinfo_event_read,
.llseek = noop_llseek,
};

static int
Expand Down Expand Up @@ -571,6 +572,7 @@ static const struct file_operations salinfo_data_fops = {
.release = salinfo_log_release,
.read = salinfo_log_read,
.write = salinfo_log_write,
.llseek = default_llseek,
};

static int __cpuinit
Expand Down
1 change: 1 addition & 0 deletions arch/ia64/sn/kernel/sn2/sn_hwperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ static long sn_hwperf_ioctl(struct file *fp, u32 op, unsigned long arg)

static const struct file_operations sn_hwperf_fops = {
.unlocked_ioctl = sn_hwperf_ioctl,
.llseek = noop_llseek,
};

static struct miscdevice sn_hwperf_dev = {
Expand Down
1 change: 1 addition & 0 deletions arch/m68k/bvme6000/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ static const struct file_operations rtc_fops = {
.unlocked_ioctl = rtc_ioctl,
.open = rtc_open,
.release = rtc_release,
.llseek = noop_llseek,
};

static struct miscdevice rtc_dev = {
Expand Down
1 change: 1 addition & 0 deletions arch/m68k/mvme16x/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ static const struct file_operations rtc_fops = {
.unlocked_ioctl = rtc_ioctl,
.open = rtc_open,
.release = rtc_release,
.llseek = noop_llseek,
};

static struct miscdevice rtc_dev=
Expand Down
3 changes: 2 additions & 1 deletion arch/mips/kernel/rtlx.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ static const struct file_operations rtlx_fops = {
.release = file_release,
.write = file_write,
.read = file_read,
.poll = file_poll
.poll = file_poll,
.llseek = noop_llseek,
};

static struct irqaction rtlx_irq = {
Expand Down
3 changes: 2 additions & 1 deletion arch/mips/kernel/vpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,8 @@ static const struct file_operations vpe_fops = {
.owner = THIS_MODULE,
.open = vpe_open,
.release = vpe_release,
.write = vpe_write
.write = vpe_write,
.llseek = noop_llseek,
};

/* module wrapper entry points */
Expand Down
1 change: 1 addition & 0 deletions arch/mips/sibyte/common/sb_tbprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ static const struct file_operations sbprof_tb_fops = {
.unlocked_ioctl = sbprof_tb_ioctl,
.compat_ioctl = sbprof_tb_ioctl,
.mmap = NULL,
.llseek = default_llseek,
};

static struct class *tb_class;
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/lparcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ static const struct file_operations lparcfg_fops = {
.write = lparcfg_write,
.open = lparcfg_open,
.release = single_release,
.llseek = seq_lseek,
};

static int __init lparcfg_init(void)
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/kernel/rtas_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ static const struct file_operations rtas_flash_operations = {
.write = rtas_flash_write,
.open = rtas_excl_open,
.release = rtas_flash_release,
.llseek = default_llseek,
};

static const struct file_operations manage_flash_operations = {
Expand All @@ -724,6 +725,7 @@ static const struct file_operations manage_flash_operations = {
.write = manage_flash_write,
.open = rtas_excl_open,
.release = rtas_excl_release,
.llseek = default_llseek,
};

static const struct file_operations validate_flash_operations = {
Expand All @@ -732,6 +734,7 @@ static const struct file_operations validate_flash_operations = {
.write = validate_flash_write,
.open = rtas_excl_open,
.release = validate_flash_release,
.llseek = default_llseek,
};

static int __init rtas_flash_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/rtasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ static const struct file_operations proc_rtas_log_operations = {
.poll = rtas_log_poll,
.open = rtas_log_open,
.release = rtas_log_release,
.llseek = noop_llseek,
};

static int enable_surveillance(int timeout)
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/iseries/mf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,7 @@ static ssize_t proc_mf_change_vmlinux(struct file *file,

static const struct file_operations proc_vmlinux_operations = {
.write = proc_mf_change_vmlinux,
.llseek = default_llseek,
};

static int __init mf_proc_init(void)
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/pseries/reconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@ static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t coun
}

static const struct file_operations ofdt_fops = {
.write = ofdt_write
.write = ofdt_write,
.llseek = noop_llseek,
};

/* create /proc/powerpc/ofdt write-only by root */
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/pseries/scanlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ const struct file_operations scanlog_fops = {
.write = scanlog_write,
.open = scanlog_open,
.release = scanlog_release,
.llseek = noop_llseek,
};

static int __init scanlog_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/s390/crypto/prng.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static const struct file_operations prng_fops = {
.open = &prng_open,
.release = NULL,
.read = &prng_read,
.llseek = noop_llseek,
};

static struct miscdevice prng_dev = {
Expand Down
1 change: 1 addition & 0 deletions arch/s390/hypfs/hypfs_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ static const struct file_operations dbfs_d204_ops = {
.open = dbfs_d204_open,
.read = dbfs_d204_read,
.release = dbfs_d204_release,
.llseek = no_llseek,
};

static int hypfs_dbfs_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/s390/hypfs/hypfs_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ static const struct file_operations dbfs_d2fc_ops = {
.open = dbfs_d2fc_open,
.read = dbfs_d2fc_read,
.release = dbfs_d2fc_release,
.llseek = no_llseek,
};

int hypfs_vm_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/s390/hypfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ static const struct file_operations hypfs_file_ops = {
.write = do_sync_write,
.aio_read = hypfs_aio_read,
.aio_write = hypfs_aio_write,
.llseek = no_llseek,
};

static struct file_system_type hypfs_type = {
Expand Down
1 change: 1 addition & 0 deletions arch/s390/kernel/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ static const struct file_operations debug_file_ops = {
.write = debug_input,
.open = debug_open,
.release = debug_close,
.llseek = no_llseek,
};

static struct dentry *debug_debugfs_root_entry;
Expand Down
1 change: 1 addition & 0 deletions arch/sh/boards/mach-landisk/gio.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ static const struct file_operations gio_fops = {
.open = gio_open, /* open */
.release = gio_close, /* release */
.unlocked_ioctl = gio_ioctl,
.llseek = noop_llseek,
};

static int __init gio_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/kernel/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ static const struct file_operations apc_fops = {
.unlocked_ioctl = apc_ioctl,
.open = apc_open,
.release = apc_release,
.llseek = noop_llseek,
};

static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/kernel/mdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ static ssize_t mdesc_read(struct file *file, char __user *buf,
static const struct file_operations mdesc_fops = {
.read = mdesc_read,
.owner = THIS_MODULE,
.llseek = noop_llseek,
};

static struct miscdevice mdesc_misc = {
Expand Down
1 change: 1 addition & 0 deletions arch/tile/kernel/hardwall.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ static const struct file_operations dev_hardwall_fops = {
#endif
.flush = hardwall_flush,
.release = hardwall_release,
.llseek = noop_llseek,
};

static struct cdev hardwall_dev;
Expand Down
1 change: 1 addition & 0 deletions arch/um/drivers/harddog_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ static const struct file_operations harddog_fops = {
.unlocked_ioctl = harddog_ioctl,
.open = harddog_open,
.release = harddog_release,
.llseek = no_llseek,
};

static struct miscdevice harddog_miscdev = {
Expand Down
1 change: 1 addition & 0 deletions arch/um/drivers/mconsole_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ static ssize_t mconsole_proc_write(struct file *file,
static const struct file_operations mconsole_proc_fops = {
.owner = THIS_MODULE,
.write = mconsole_proc_write,
.llseek = noop_llseek,
};

static int create_proc_mconsole(void)
Expand Down
1 change: 1 addition & 0 deletions arch/um/drivers/mmapper_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ static const struct file_operations mmapper_fops = {
.mmap = mmapper_mmap,
.open = mmapper_open,
.release = mmapper_release,
.llseek = default_llseek,
};

/*
Expand Down
1 change: 1 addition & 0 deletions arch/um/drivers/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ static const struct file_operations rng_chrdev_ops = {
.owner = THIS_MODULE,
.open = rng_dev_open,
.read = rng_dev_read,
.llseek = noop_llseek,
};

/* rng_init shouldn't be called more than once at boot time */
Expand Down
Loading

0 comments on commit 6038f37

Please sign in to comment.