diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-07 15:15:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-07 15:15:13 -0400 |
commit | 41bc10cabe96bbd0ff3e2813d15f9070bff57a03 (patch) | |
tree | d75b65f4087e3ee68453c0b5d7aa5d698056c03a | |
parent | aa26690fab1380735442e027ce4b17849a24493f (diff) | |
parent | 438ab720c675a16d53bb18f76a94d25bbe420c45 (diff) |
Merge tag 'stream_open-5.2' of https://lab.nexedi.com/kirr/linux
Pull stream_open conversion from Kirill Smelkov:
- remove unnecessary double nonseekable_open from drivers/char/dtlk.c
as noticed by Pavel Machek while reviewing nonseekable_open ->
stream_open mass conversion.
- the mass conversion patch promised in commit 10dce8af3422 ("fs:
stream_open - opener for stream-like files so that read and write can
run simultaneously without deadlock") and is automatically generated
by running
$ make coccicheck MODE=patch COCCI=scripts/coccinelle/api/stream_open.cocci
I've verified each generated change manually - that it is correct to
convert - and each other nonseekable_open instance left - that it is
either not correct to convert there, or that it is not converted due
to current stream_open.cocci limitations. More details on this in the
patch.
- finally, change VFS to pass ppos=NULL into .read/.write for files
that declare themselves streams. It was suggested by Rasmus Villemoes
and makes sure that if ppos starts to be erroneously used in a stream
file, such bug won't go unnoticed and will produce an oops instead of
creating illusion of position change being taken into account.
Note: this patch does not conflict with "fuse: Add FOPEN_STREAM to
use stream_open()" that will be hopefully coming via FUSE tree,
because fs/fuse/ uses new-style .read_iter/.write_iter, and for these
accessors position is still passed as non-pointer kiocb.ki_pos .
* tag 'stream_open-5.2' of https://lab.nexedi.com/kirr/linux:
vfs: pass ppos=NULL to .read()/.write() of FMODE_STREAM files
*: convert stream-like files from nonseekable_open -> stream_open
dtlk: remove double call to nonseekable_open
105 files changed, 179 insertions, 158 deletions
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c index 17cf249b18ee..3cb2f07ce8eb 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c | |||
@@ -628,7 +628,7 @@ static int mpc52xx_wdt_open(struct inode *inode, struct file *file) | |||
628 | } | 628 | } |
629 | 629 | ||
630 | file->private_data = mpc52xx_gpt_wdt; | 630 | file->private_data = mpc52xx_gpt_wdt; |
631 | return nonseekable_open(inode, file); | 631 | return stream_open(inode, file); |
632 | } | 632 | } |
633 | 633 | ||
634 | static int mpc52xx_wdt_release(struct inode *inode, struct file *file) | 634 | static int mpc52xx_wdt_release(struct inode *inode, struct file *file) |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 48c2477e7e2a..bfb9ca99ac05 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -588,7 +588,7 @@ static int spufs_pipe_open(struct inode *inode, struct file *file) | |||
588 | struct spufs_inode_info *i = SPUFS_I(inode); | 588 | struct spufs_inode_info *i = SPUFS_I(inode); |
589 | file->private_data = i->i_ctx; | 589 | file->private_data = i->i_ctx; |
590 | 590 | ||
591 | return nonseekable_open(inode, file); | 591 | return stream_open(inode, file); |
592 | } | 592 | } |
593 | 593 | ||
594 | /* | 594 | /* |
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c index 6d381279b362..000cb69ba0bc 100644 --- a/arch/um/drivers/harddog_kern.c +++ b/arch/um/drivers/harddog_kern.c | |||
@@ -85,7 +85,7 @@ static int harddog_open(struct inode *inode, struct file *file) | |||
85 | timer_alive = 1; | 85 | timer_alive = 1; |
86 | spin_unlock(&lock); | 86 | spin_unlock(&lock); |
87 | mutex_unlock(&harddog_mutex); | 87 | mutex_unlock(&harddog_mutex); |
88 | return nonseekable_open(inode, file); | 88 | return stream_open(inode, file); |
89 | err: | 89 | err: |
90 | spin_unlock(&lock); | 90 | spin_unlock(&lock); |
91 | mutex_unlock(&harddog_mutex); | 91 | mutex_unlock(&harddog_mutex); |
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 8a4a7823451a..c321f4f513f9 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c | |||
@@ -428,7 +428,7 @@ static int do_microcode_update(const void __user *buf, size_t size) | |||
428 | 428 | ||
429 | static int microcode_open(struct inode *inode, struct file *file) | 429 | static int microcode_open(struct inode *inode, struct file *file) |
430 | { | 430 | { |
431 | return capable(CAP_SYS_RAWIO) ? nonseekable_open(inode, file) : -EPERM; | 431 | return capable(CAP_SYS_RAWIO) ? stream_open(inode, file) : -EPERM; |
432 | } | 432 | } |
433 | 433 | ||
434 | static ssize_t microcode_write(struct file *file, const char __user *buf, | 434 | static ssize_t microcode_write(struct file *file, const char __user *buf, |
diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index a5ecf6dae02e..373f549525fe 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c | |||
@@ -212,7 +212,7 @@ static void ds1620_read_state(struct therm *therm) | |||
212 | 212 | ||
213 | static int ds1620_open(struct inode *inode, struct file *file) | 213 | static int ds1620_open(struct inode *inode, struct file *file) |
214 | { | 214 | { |
215 | return nonseekable_open(inode, file); | 215 | return stream_open(inode, file); |
216 | } | 216 | } |
217 | 217 | ||
218 | static ssize_t | 218 | static ssize_t |
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index f882460b5a44..4fed8fafa0f0 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c | |||
@@ -298,12 +298,11 @@ static int dtlk_open(struct inode *inode, struct file *file) | |||
298 | { | 298 | { |
299 | TRACE_TEXT("(dtlk_open"); | 299 | TRACE_TEXT("(dtlk_open"); |
300 | 300 | ||
301 | nonseekable_open(inode, file); | ||
302 | switch (iminor(inode)) { | 301 | switch (iminor(inode)) { |
303 | case DTLK_MINOR: | 302 | case DTLK_MINOR: |
304 | if (dtlk_busy) | 303 | if (dtlk_busy) |
305 | return -EBUSY; | 304 | return -EBUSY; |
306 | return nonseekable_open(inode, file); | 305 | return stream_open(inode, file); |
307 | 306 | ||
308 | default: | 307 | default: |
309 | return -ENXIO; | 308 | return -ENXIO; |
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 2924a4bc4a32..74c6d1f34132 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -837,7 +837,7 @@ static int ipmi_open(struct inode *ino, struct file *filep) | |||
837 | * first heartbeat. | 837 | * first heartbeat. |
838 | */ | 838 | */ |
839 | ipmi_start_timer_on_heartbeat = 1; | 839 | ipmi_start_timer_on_heartbeat = 1; |
840 | return nonseekable_open(ino, filep); | 840 | return stream_open(ino, filep); |
841 | 841 | ||
842 | default: | 842 | default: |
843 | return (-ENODEV); | 843 | return (-ENODEV); |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 7a4eb86aedac..15bf585af5d3 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -1682,7 +1682,7 @@ static int cmm_open(struct inode *inode, struct file *filp) | |||
1682 | link->open = 1; /* only one open per device */ | 1682 | link->open = 1; /* only one open per device */ |
1683 | 1683 | ||
1684 | DEBUGP(2, dev, "<- cmm_open\n"); | 1684 | DEBUGP(2, dev, "<- cmm_open\n"); |
1685 | ret = nonseekable_open(inode, filp); | 1685 | ret = stream_open(inode, filp); |
1686 | out: | 1686 | out: |
1687 | mutex_unlock(&cmm_mutex); | 1687 | mutex_unlock(&cmm_mutex); |
1688 | return ret; | 1688 | return ret; |
diff --git a/drivers/char/pcmcia/scr24x_cs.c b/drivers/char/pcmcia/scr24x_cs.c index f6b43d9350f0..04b39c3596cc 100644 --- a/drivers/char/pcmcia/scr24x_cs.c +++ b/drivers/char/pcmcia/scr24x_cs.c | |||
@@ -92,7 +92,7 @@ static int scr24x_open(struct inode *inode, struct file *filp) | |||
92 | kref_get(&dev->refcnt); | 92 | kref_get(&dev->refcnt); |
93 | filp->private_data = dev; | 93 | filp->private_data = dev; |
94 | 94 | ||
95 | return nonseekable_open(inode, filp); | 95 | return stream_open(inode, filp); |
96 | } | 96 | } |
97 | 97 | ||
98 | static int scr24x_release(struct inode *inode, struct file *filp) | 98 | static int scr24x_release(struct inode *inode, struct file *filp) |
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c index 7c19d9b22785..e8614ea843e2 100644 --- a/drivers/char/tb0219.c +++ b/drivers/char/tb0219.c | |||
@@ -243,7 +243,7 @@ static int tanbac_tb0219_open(struct inode *inode, struct file *file) | |||
243 | case 16 ... 23: | 243 | case 16 ... 23: |
244 | case 32 ... 39: | 244 | case 32 ... 39: |
245 | case 48 ... 55: | 245 | case 48 ... 55: |
246 | return nonseekable_open(inode, file); | 246 | return stream_open(inode, file); |
247 | default: | 247 | default: |
248 | break; | 248 | break; |
249 | } | 249 | } |
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c index a128dd1126ae..515e96db4391 100644 --- a/drivers/firewire/nosy.c +++ b/drivers/firewire/nosy.c | |||
@@ -303,7 +303,7 @@ nosy_open(struct inode *inode, struct file *file) | |||
303 | 303 | ||
304 | file->private_data = client; | 304 | file->private_data = client; |
305 | 305 | ||
306 | return nonseekable_open(inode, file); | 306 | return stream_open(inode, file); |
307 | fail: | 307 | fail: |
308 | kfree(client); | 308 | kfree(client); |
309 | lynx_put(lynx); | 309 | lynx_put(lynx); |
diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c index 320cfca80d5f..e6f94501cb28 100644 --- a/drivers/gnss/core.c +++ b/drivers/gnss/core.c | |||
@@ -42,7 +42,7 @@ static int gnss_open(struct inode *inode, struct file *file) | |||
42 | 42 | ||
43 | get_device(&gdev->dev); | 43 | get_device(&gdev->dev); |
44 | 44 | ||
45 | nonseekable_open(inode, file); | 45 | stream_open(inode, file); |
46 | file->private_data = gdev; | 46 | file->private_data = gdev; |
47 | 47 | ||
48 | down_write(&gdev->rwsem); | 48 | down_write(&gdev->rwsem); |
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 840634e0f1e3..dbaead0a5371 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c | |||
@@ -632,7 +632,7 @@ static int uhid_char_open(struct inode *inode, struct file *file) | |||
632 | INIT_WORK(&uhid->worker, uhid_device_add_worker); | 632 | INIT_WORK(&uhid->worker, uhid_device_add_worker); |
633 | 633 | ||
634 | file->private_data = uhid; | 634 | file->private_data = uhid; |
635 | nonseekable_open(inode, file); | 635 | stream_open(inode, file); |
636 | 636 | ||
637 | return 0; | 637 | return 0; |
638 | } | 638 | } |
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c index 042a166e1858..8fb54079fac8 100644 --- a/drivers/hwmon/fschmd.c +++ b/drivers/hwmon/fschmd.c | |||
@@ -837,7 +837,7 @@ static int watchdog_open(struct inode *inode, struct file *filp) | |||
837 | watchdog_trigger(data); | 837 | watchdog_trigger(data); |
838 | filp->private_data = data; | 838 | filp->private_data = data; |
839 | 839 | ||
840 | return nonseekable_open(inode, filp); | 840 | return stream_open(inode, filp); |
841 | } | 841 | } |
842 | 842 | ||
843 | static int watchdog_release(struct inode *inode, struct file *filp) | 843 | static int watchdog_release(struct inode *inode, struct file *filp) |
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index 0af0f6283b35..e94ae1bb3cf0 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c | |||
@@ -1341,7 +1341,7 @@ static int watchdog_open(struct inode *inode, struct file *filp) | |||
1341 | /* Store pointer to data into filp's private data */ | 1341 | /* Store pointer to data into filp's private data */ |
1342 | filp->private_data = data; | 1342 | filp->private_data = data; |
1343 | 1343 | ||
1344 | return nonseekable_open(inode, filp); | 1344 | return stream_open(inode, filp); |
1345 | } | 1345 | } |
1346 | 1346 | ||
1347 | static int watchdog_close(struct inode *inode, struct file *filp) | 1347 | static int watchdog_close(struct inode *inode, struct file *filp) |
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c index 7541fbaf58a3..65c3230f5663 100644 --- a/drivers/infiniband/core/ucm.c +++ b/drivers/infiniband/core/ucm.c | |||
@@ -1175,7 +1175,7 @@ static int ib_ucm_open(struct inode *inode, struct file *filp) | |||
1175 | file->filp = filp; | 1175 | file->filp = filp; |
1176 | file->device = container_of(inode->i_cdev, struct ib_ucm_device, cdev); | 1176 | file->device = container_of(inode->i_cdev, struct ib_ucm_device, cdev); |
1177 | 1177 | ||
1178 | return nonseekable_open(inode, filp); | 1178 | return stream_open(inode, filp); |
1179 | } | 1179 | } |
1180 | 1180 | ||
1181 | static int ib_ucm_close(struct inode *inode, struct file *filp) | 1181 | static int ib_ucm_close(struct inode *inode, struct file *filp) |
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 7468b26b8a01..140a338a135f 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -1744,7 +1744,7 @@ static int ucma_open(struct inode *inode, struct file *filp) | |||
1744 | filp->private_data = file; | 1744 | filp->private_data = file; |
1745 | file->filp = filp; | 1745 | file->filp = filp; |
1746 | 1746 | ||
1747 | return nonseekable_open(inode, filp); | 1747 | return stream_open(inode, filp); |
1748 | } | 1748 | } |
1749 | 1749 | ||
1750 | static int ucma_close(struct inode *inode, struct file *filp) | 1750 | static int ucma_close(struct inode *inode, struct file *filp) |
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c index 02b7947ab215..b58b07c03cfb 100644 --- a/drivers/infiniband/core/user_mad.c +++ b/drivers/infiniband/core/user_mad.c | |||
@@ -985,7 +985,7 @@ static int ib_umad_open(struct inode *inode, struct file *filp) | |||
985 | 985 | ||
986 | list_add_tail(&file->port_list, &port->file_list); | 986 | list_add_tail(&file->port_list, &port->file_list); |
987 | 987 | ||
988 | nonseekable_open(inode, filp); | 988 | stream_open(inode, filp); |
989 | out: | 989 | out: |
990 | mutex_unlock(&port->file_mutex); | 990 | mutex_unlock(&port->file_mutex); |
991 | return ret; | 991 | return ret; |
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index c489f545baae..8b43dd96d3b2 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -1132,7 +1132,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp) | |||
1132 | 1132 | ||
1133 | setup_ufile_idr_uobject(file); | 1133 | setup_ufile_idr_uobject(file); |
1134 | 1134 | ||
1135 | return nonseekable_open(inode, filp); | 1135 | return stream_open(inode, filp); |
1136 | 1136 | ||
1137 | err_module: | 1137 | err_module: |
1138 | module_put(ib_dev->owner); | 1138 | module_put(ib_dev->owner); |
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index f48369d6f3a0..f040d8881ff2 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -524,7 +524,7 @@ static int evdev_open(struct inode *inode, struct file *file) | |||
524 | goto err_free_client; | 524 | goto err_free_client; |
525 | 525 | ||
526 | file->private_data = client; | 526 | file->private_data = client; |
527 | nonseekable_open(inode, file); | 527 | stream_open(inode, file); |
528 | 528 | ||
529 | return 0; | 529 | return 0; |
530 | 530 | ||
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 4c1e427dfabb..d806f6be4788 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
@@ -279,7 +279,7 @@ static int joydev_open(struct inode *inode, struct file *file) | |||
279 | goto err_free_client; | 279 | goto err_free_client; |
280 | 280 | ||
281 | file->private_data = client; | 281 | file->private_data = client; |
282 | nonseekable_open(inode, file); | 282 | stream_open(inode, file); |
283 | 283 | ||
284 | return 0; | 284 | return 0; |
285 | 285 | ||
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 26ec603fe220..1a6762fc38f9 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
@@ -398,7 +398,7 @@ static int uinput_open(struct inode *inode, struct file *file) | |||
398 | newdev->state = UIST_NEW_DEVICE; | 398 | newdev->state = UIST_NEW_DEVICE; |
399 | 399 | ||
400 | file->private_data = newdev; | 400 | file->private_data = newdev; |
401 | nonseekable_open(inode, file); | 401 | stream_open(inode, file); |
402 | 402 | ||
403 | return 0; | 403 | return 0; |
404 | } | 404 | } |
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index e1da70a9530c..3c3ad42f22bf 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c | |||
@@ -960,7 +960,7 @@ static int capi_open(struct inode *inode, struct file *file) | |||
960 | list_add_tail(&cdev->list, &capidev_list); | 960 | list_add_tail(&cdev->list, &capidev_list); |
961 | mutex_unlock(&capidev_list_lock); | 961 | mutex_unlock(&capidev_list_lock); |
962 | 962 | ||
963 | return nonseekable_open(inode, file); | 963 | return stream_open(inode, file); |
964 | } | 964 | } |
965 | 965 | ||
966 | static int capi_release(struct inode *inode, struct file *file) | 966 | static int capi_release(struct inode *inode, struct file *file) |
diff --git a/drivers/leds/uleds.c b/drivers/leds/uleds.c index 0c43bfac9598..08b6a769ff8f 100644 --- a/drivers/leds/uleds.c +++ b/drivers/leds/uleds.c | |||
@@ -74,7 +74,7 @@ static int uleds_open(struct inode *inode, struct file *file) | |||
74 | udev->state = ULEDS_STATE_UNKNOWN; | 74 | udev->state = ULEDS_STATE_UNKNOWN; |
75 | 75 | ||
76 | file->private_data = udev; | 76 | file->private_data = udev; |
77 | nonseekable_open(inode, file); | 77 | stream_open(inode, file); |
78 | 78 | ||
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index f862f1b7f996..92db1e83c192 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c | |||
@@ -195,7 +195,7 @@ static int ir_lirc_open(struct inode *inode, struct file *file) | |||
195 | list_add(&fh->list, &dev->lirc_fh); | 195 | list_add(&fh->list, &dev->lirc_fh); |
196 | spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); | 196 | spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); |
197 | 197 | ||
198 | nonseekable_open(inode, file); | 198 | stream_open(inode, file); |
199 | 199 | ||
200 | return 0; | 200 | return 0; |
201 | out_kfifo: | 201 | out_kfifo: |
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index e22766c79fe9..0f7b80144863 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c | |||
@@ -390,7 +390,7 @@ static int switchtec_dev_open(struct inode *inode, struct file *filp) | |||
390 | return PTR_ERR(stuser); | 390 | return PTR_ERR(stuser); |
391 | 391 | ||
392 | filp->private_data = stuser; | 392 | filp->private_data = stuser; |
393 | nonseekable_open(inode, filp); | 393 | stream_open(inode, filp); |
394 | 394 | ||
395 | dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); | 395 | dev_dbg(&stdev->dev, "%s: %p\n", __func__, stuser); |
396 | 396 | ||
diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c index 71308766e891..2b8e8a01a739 100644 --- a/drivers/platform/chrome/cros_ec_debugfs.c +++ b/drivers/platform/chrome/cros_ec_debugfs.c | |||
@@ -132,7 +132,7 @@ static int cros_ec_console_log_open(struct inode *inode, struct file *file) | |||
132 | { | 132 | { |
133 | file->private_data = inode->i_private; | 133 | file->private_data = inode->i_private; |
134 | 134 | ||
135 | return nonseekable_open(inode, file); | 135 | return stream_open(inode, file); |
136 | } | 136 | } |
137 | 137 | ||
138 | static ssize_t cros_ec_console_log_read(struct file *file, char __user *buf, | 138 | static ssize_t cros_ec_console_log_read(struct file *file, char __user *buf, |
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index 38a2e9e684df..225a8df1d4e9 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c | |||
@@ -467,7 +467,7 @@ static int ds1374_wdt_open(struct inode *inode, struct file *file) | |||
467 | */ | 467 | */ |
468 | wdt_is_open = 1; | 468 | wdt_is_open = 1; |
469 | mutex_unlock(&ds1374->mutex); | 469 | mutex_unlock(&ds1374->mutex); |
470 | return nonseekable_open(inode, file); | 470 | return stream_open(inode, file); |
471 | } | 471 | } |
472 | return -ENODEV; | 472 | return -ENODEV; |
473 | } | 473 | } |
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index ebf50b1540f2..dd5a8991f75b 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
@@ -802,7 +802,7 @@ static int wdt_open(struct inode *inode, struct file *file) | |||
802 | */ | 802 | */ |
803 | wdt_is_open = 1; | 803 | wdt_is_open = 1; |
804 | mutex_unlock(&m41t80_rtc_mutex); | 804 | mutex_unlock(&m41t80_rtc_mutex); |
805 | return nonseekable_open(inode, file); | 805 | return stream_open(inode, file); |
806 | } | 806 | } |
807 | return -ENODEV; | 807 | return -ENODEV; |
808 | } | 808 | } |
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index 8b48ba9c598e..4c4683d8784a 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c | |||
@@ -486,7 +486,7 @@ fs3270_open(struct inode *inode, struct file *filp) | |||
486 | raw3270_del_view(&fp->view); | 486 | raw3270_del_view(&fp->view); |
487 | goto out; | 487 | goto out; |
488 | } | 488 | } |
489 | nonseekable_open(inode, filp); | 489 | stream_open(inode, filp); |
490 | filp->private_data = fp; | 490 | filp->private_data = fp; |
491 | out: | 491 | out: |
492 | mutex_unlock(&fs3270_mutex); | 492 | mutex_unlock(&fs3270_mutex); |
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index fc206c9d1c56..ea4253939555 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c | |||
@@ -290,7 +290,7 @@ tapechar_open (struct inode *inode, struct file *filp) | |||
290 | rc = tape_open(device); | 290 | rc = tape_open(device); |
291 | if (rc == 0) { | 291 | if (rc == 0) { |
292 | filp->private_data = device; | 292 | filp->private_data = device; |
293 | nonseekable_open(inode, filp); | 293 | stream_open(inode, filp); |
294 | } else | 294 | } else |
295 | tape_put_device(device); | 295 | tape_put_device(device); |
296 | 296 | ||
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index f75d3bfb5af3..405a60538630 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c | |||
@@ -191,7 +191,7 @@ static ssize_t zcore_reipl_write(struct file *filp, const char __user *buf, | |||
191 | 191 | ||
192 | static int zcore_reipl_open(struct inode *inode, struct file *filp) | 192 | static int zcore_reipl_open(struct inode *inode, struct file *filp) |
193 | { | 193 | { |
194 | return nonseekable_open(inode, filp); | 194 | return stream_open(inode, filp); |
195 | } | 195 | } |
196 | 196 | ||
197 | static int zcore_reipl_release(struct inode *inode, struct file *filp) | 197 | static int zcore_reipl_release(struct inode *inode, struct file *filp) |
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index c31b2d31cd83..852b8c2299c1 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
@@ -525,7 +525,7 @@ static int zcrypt_open(struct inode *inode, struct file *filp) | |||
525 | filp->private_data = (void *) perms; | 525 | filp->private_data = (void *) perms; |
526 | 526 | ||
527 | atomic_inc(&zcrypt_open_count); | 527 | atomic_inc(&zcrypt_open_count); |
528 | return nonseekable_open(inode, filp); | 528 | return stream_open(inode, filp); |
529 | } | 529 | } |
530 | 530 | ||
531 | /** | 531 | /** |
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 70966e10be7e..ce9142d87f41 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -593,7 +593,7 @@ static int spidev_open(struct inode *inode, struct file *filp) | |||
593 | 593 | ||
594 | spidev->users++; | 594 | spidev->users++; |
595 | filp->private_data = spidev; | 595 | filp->private_data = spidev; |
596 | nonseekable_open(inode, filp); | 596 | stream_open(inode, filp); |
597 | 597 | ||
598 | mutex_unlock(&device_list_lock); | 598 | mutex_unlock(&device_list_lock); |
599 | return 0; | 599 | return 0; |
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index b2314636dc89..2299a11b1878 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c | |||
@@ -971,7 +971,7 @@ static int pi433_open(struct inode *inode, struct file *filp) | |||
971 | 971 | ||
972 | /* instance data as context */ | 972 | /* instance data as context */ |
973 | filp->private_data = instance; | 973 | filp->private_data = instance; |
974 | nonseekable_open(inode, filp); | 974 | stream_open(inode, filp); |
975 | 975 | ||
976 | return 0; | 976 | return 0; |
977 | } | 977 | } |
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index 006762b72ff5..6581774bdfa4 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c | |||
@@ -307,7 +307,7 @@ static int ld_usb_open(struct inode *inode, struct file *file) | |||
307 | int retval; | 307 | int retval; |
308 | struct usb_interface *interface; | 308 | struct usb_interface *interface; |
309 | 309 | ||
310 | nonseekable_open(inode, file); | 310 | stream_open(inode, file); |
311 | subminor = iminor(inode); | 311 | subminor = iminor(inode); |
312 | 312 | ||
313 | interface = usb_find_interface(&ld_usb_driver, subminor); | 313 | interface = usb_find_interface(&ld_usb_driver, subminor); |
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index d6210d946082..957d1255d4ca 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c | |||
@@ -200,7 +200,7 @@ static int acq_open(struct inode *inode, struct file *file) | |||
200 | 200 | ||
201 | /* Activate */ | 201 | /* Activate */ |
202 | acq_keepalive(); | 202 | acq_keepalive(); |
203 | return nonseekable_open(inode, file); | 203 | return stream_open(inode, file); |
204 | } | 204 | } |
205 | 205 | ||
206 | static int acq_close(struct inode *inode, struct file *file) | 206 | static int acq_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index f61944369c1a..2766af292a71 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c | |||
@@ -199,7 +199,7 @@ static int advwdt_open(struct inode *inode, struct file *file) | |||
199 | */ | 199 | */ |
200 | 200 | ||
201 | advwdt_ping(); | 201 | advwdt_ping(); |
202 | return nonseekable_open(inode, file); | 202 | return stream_open(inode, file); |
203 | } | 203 | } |
204 | 204 | ||
205 | static int advwdt_close(struct inode *inode, struct file *file) | 205 | static int advwdt_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c index 60f0c2eb8531..39a07bb5f6d5 100644 --- a/drivers/watchdog/alim1535_wdt.c +++ b/drivers/watchdog/alim1535_wdt.c | |||
@@ -249,7 +249,7 @@ static int ali_open(struct inode *inode, struct file *file) | |||
249 | 249 | ||
250 | /* Activate */ | 250 | /* Activate */ |
251 | ali_start(); | 251 | ali_start(); |
252 | return nonseekable_open(inode, file); | 252 | return stream_open(inode, file); |
253 | } | 253 | } |
254 | 254 | ||
255 | /* | 255 | /* |
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c index 12f7ea62dddd..7e9884960eb9 100644 --- a/drivers/watchdog/alim7101_wdt.c +++ b/drivers/watchdog/alim7101_wdt.c | |||
@@ -214,7 +214,7 @@ static int fop_open(struct inode *inode, struct file *file) | |||
214 | return -EBUSY; | 214 | return -EBUSY; |
215 | /* Good, fire up the show */ | 215 | /* Good, fire up the show */ |
216 | wdt_startup(); | 216 | wdt_startup(); |
217 | return nonseekable_open(inode, file); | 217 | return stream_open(inode, file); |
218 | } | 218 | } |
219 | 219 | ||
220 | static int fop_close(struct inode *inode, struct file *file) | 220 | static int fop_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c index ee1ab12ab04f..b9b2d06b3879 100644 --- a/drivers/watchdog/ar7_wdt.c +++ b/drivers/watchdog/ar7_wdt.c | |||
@@ -163,7 +163,7 @@ static int ar7_wdt_open(struct inode *inode, struct file *file) | |||
163 | ar7_wdt_enable_wdt(); | 163 | ar7_wdt_enable_wdt(); |
164 | expect_close = 0; | 164 | expect_close = 0; |
165 | 165 | ||
166 | return nonseekable_open(inode, file); | 166 | return stream_open(inode, file); |
167 | } | 167 | } |
168 | 168 | ||
169 | static int ar7_wdt_release(struct inode *inode, struct file *file) | 169 | static int ar7_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c index b45fc0aee667..907a4545dee6 100644 --- a/drivers/watchdog/at91rm9200_wdt.c +++ b/drivers/watchdog/at91rm9200_wdt.c | |||
@@ -110,7 +110,7 @@ static int at91_wdt_open(struct inode *inode, struct file *file) | |||
110 | return -EBUSY; | 110 | return -EBUSY; |
111 | 111 | ||
112 | at91_wdt_start(); | 112 | at91_wdt_start(); |
113 | return nonseekable_open(inode, file); | 113 | return stream_open(inode, file); |
114 | } | 114 | } |
115 | 115 | ||
116 | /* | 116 | /* |
diff --git a/drivers/watchdog/ath79_wdt.c b/drivers/watchdog/ath79_wdt.c index e2209bf5fa8a..4f56b63f9691 100644 --- a/drivers/watchdog/ath79_wdt.c +++ b/drivers/watchdog/ath79_wdt.c | |||
@@ -132,7 +132,7 @@ static int ath79_wdt_open(struct inode *inode, struct file *file) | |||
132 | clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags); | 132 | clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags); |
133 | ath79_wdt_enable(); | 133 | ath79_wdt_enable(); |
134 | 134 | ||
135 | return nonseekable_open(inode, file); | 135 | return stream_open(inode, file); |
136 | } | 136 | } |
137 | 137 | ||
138 | static int ath79_wdt_release(struct inode *inode, struct file *file) | 138 | static int ath79_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index d3c1113e774c..e2af37c9a266 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c | |||
@@ -116,7 +116,7 @@ static int bcm63xx_wdt_open(struct inode *inode, struct file *file) | |||
116 | return -EBUSY; | 116 | return -EBUSY; |
117 | 117 | ||
118 | bcm63xx_wdt_start(); | 118 | bcm63xx_wdt_start(); |
119 | return nonseekable_open(inode, file); | 119 | return stream_open(inode, file); |
120 | } | 120 | } |
121 | 121 | ||
122 | static int bcm63xx_wdt_release(struct inode *inode, struct file *file) | 122 | static int bcm63xx_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/cpu5wdt.c b/drivers/watchdog/cpu5wdt.c index 6cfb102c397c..475360de6e9e 100644 --- a/drivers/watchdog/cpu5wdt.c +++ b/drivers/watchdog/cpu5wdt.c | |||
@@ -140,7 +140,7 @@ static int cpu5wdt_open(struct inode *inode, struct file *file) | |||
140 | { | 140 | { |
141 | if (test_and_set_bit(0, &cpu5wdt_device.inuse)) | 141 | if (test_and_set_bit(0, &cpu5wdt_device.inuse)) |
142 | return -EBUSY; | 142 | return -EBUSY; |
143 | return nonseekable_open(inode, file); | 143 | return stream_open(inode, file); |
144 | } | 144 | } |
145 | 145 | ||
146 | static int cpu5wdt_release(struct inode *inode, struct file *file) | 146 | static int cpu5wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c index 32156e199c51..b5b078bdebe6 100644 --- a/drivers/watchdog/cpwd.c +++ b/drivers/watchdog/cpwd.c | |||
@@ -394,7 +394,7 @@ static int cpwd_open(struct inode *inode, struct file *f) | |||
394 | 394 | ||
395 | mutex_unlock(&cpwd_mutex); | 395 | mutex_unlock(&cpwd_mutex); |
396 | 396 | ||
397 | return nonseekable_open(inode, f); | 397 | return stream_open(inode, f); |
398 | } | 398 | } |
399 | 399 | ||
400 | static int cpwd_release(struct inode *inode, struct file *file) | 400 | static int cpwd_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c index 47f77a6fdfd6..89129e6fa9b6 100644 --- a/drivers/watchdog/eurotechwdt.c +++ b/drivers/watchdog/eurotechwdt.c | |||
@@ -316,7 +316,7 @@ static int eurwdt_open(struct inode *inode, struct file *file) | |||
316 | eurwdt_timeout = WDT_TIMEOUT; /* initial timeout */ | 316 | eurwdt_timeout = WDT_TIMEOUT; /* initial timeout */ |
317 | /* Activate the WDT */ | 317 | /* Activate the WDT */ |
318 | eurwdt_activate_timer(); | 318 | eurwdt_activate_timer(); |
319 | return nonseekable_open(inode, file); | 319 | return stream_open(inode, file); |
320 | } | 320 | } |
321 | 321 | ||
322 | /** | 322 | /** |
diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c index 9a1c761258ce..021c6ace9462 100644 --- a/drivers/watchdog/f71808e_wdt.c +++ b/drivers/watchdog/f71808e_wdt.c | |||
@@ -525,7 +525,7 @@ static int watchdog_open(struct inode *inode, struct file *file) | |||
525 | __module_get(THIS_MODULE); | 525 | __module_get(THIS_MODULE); |
526 | 526 | ||
527 | watchdog.expect_close = 0; | 527 | watchdog.expect_close = 0; |
528 | return nonseekable_open(inode, file); | 528 | return stream_open(inode, file); |
529 | } | 529 | } |
530 | 530 | ||
531 | static int watchdog_release(struct inode *inode, struct file *file) | 531 | static int watchdog_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c index 006e2348022c..26350b319505 100644 --- a/drivers/watchdog/gef_wdt.c +++ b/drivers/watchdog/gef_wdt.c | |||
@@ -229,7 +229,7 @@ static int gef_wdt_open(struct inode *inode, struct file *file) | |||
229 | 229 | ||
230 | gef_wdt_handler_enable(); | 230 | gef_wdt_handler_enable(); |
231 | 231 | ||
232 | return nonseekable_open(inode, file); | 232 | return stream_open(inode, file); |
233 | } | 233 | } |
234 | 234 | ||
235 | static int gef_wdt_release(struct inode *inode, struct file *file) | 235 | static int gef_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c index 88e01238f01b..c5a727da6657 100644 --- a/drivers/watchdog/geodewdt.c +++ b/drivers/watchdog/geodewdt.c | |||
@@ -92,7 +92,7 @@ static int geodewdt_open(struct inode *inode, struct file *file) | |||
92 | __module_get(THIS_MODULE); | 92 | __module_get(THIS_MODULE); |
93 | 93 | ||
94 | geodewdt_ping(); | 94 | geodewdt_ping(); |
95 | return nonseekable_open(inode, file); | 95 | return stream_open(inode, file); |
96 | } | 96 | } |
97 | 97 | ||
98 | static int geodewdt_release(struct inode *inode, struct file *file) | 98 | static int geodewdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c index cc262284a6aa..30d6cec582af 100644 --- a/drivers/watchdog/ib700wdt.c +++ b/drivers/watchdog/ib700wdt.c | |||
@@ -238,7 +238,7 @@ static int ibwdt_open(struct inode *inode, struct file *file) | |||
238 | 238 | ||
239 | /* Activate */ | 239 | /* Activate */ |
240 | ibwdt_ping(); | 240 | ibwdt_ping(); |
241 | return nonseekable_open(inode, file); | 241 | return stream_open(inode, file); |
242 | } | 242 | } |
243 | 243 | ||
244 | static int ibwdt_close(struct inode *inode, struct file *file) | 244 | static int ibwdt_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c index 366b0474f278..897f7eda9e6a 100644 --- a/drivers/watchdog/ibmasr.c +++ b/drivers/watchdog/ibmasr.c | |||
@@ -323,7 +323,7 @@ static int asr_open(struct inode *inode, struct file *file) | |||
323 | asr_toggle(); | 323 | asr_toggle(); |
324 | asr_enable(); | 324 | asr_enable(); |
325 | 325 | ||
326 | return nonseekable_open(inode, file); | 326 | return stream_open(inode, file); |
327 | } | 327 | } |
328 | 328 | ||
329 | static int asr_release(struct inode *inode, struct file *file) | 329 | static int asr_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c index 5d20cdd30efe..5592b975fe3a 100644 --- a/drivers/watchdog/indydog.c +++ b/drivers/watchdog/indydog.c | |||
@@ -77,7 +77,7 @@ static int indydog_open(struct inode *inode, struct file *file) | |||
77 | 77 | ||
78 | pr_info("Started watchdog timer\n"); | 78 | pr_info("Started watchdog timer\n"); |
79 | 79 | ||
80 | return nonseekable_open(inode, file); | 80 | return stream_open(inode, file); |
81 | } | 81 | } |
82 | 82 | ||
83 | static int indydog_release(struct inode *inode, struct file *file) | 83 | static int indydog_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/intel_scu_watchdog.c b/drivers/watchdog/intel_scu_watchdog.c index 0caab6241eb7..3181a72c7ddf 100644 --- a/drivers/watchdog/intel_scu_watchdog.c +++ b/drivers/watchdog/intel_scu_watchdog.c | |||
@@ -304,7 +304,7 @@ static int intel_scu_open(struct inode *inode, struct file *file) | |||
304 | if (watchdog_device.driver_closed) | 304 | if (watchdog_device.driver_closed) |
305 | return -EPERM; | 305 | return -EPERM; |
306 | 306 | ||
307 | return nonseekable_open(inode, file); | 307 | return stream_open(inode, file); |
308 | } | 308 | } |
309 | 309 | ||
310 | static int intel_scu_release(struct inode *inode, struct file *file) | 310 | static int intel_scu_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/iop_wdt.c b/drivers/watchdog/iop_wdt.c index b16013ffacc2..d910a7dec21b 100644 --- a/drivers/watchdog/iop_wdt.c +++ b/drivers/watchdog/iop_wdt.c | |||
@@ -101,7 +101,7 @@ static int iop_wdt_open(struct inode *inode, struct file *file) | |||
101 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); | 101 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); |
102 | wdt_enable(); | 102 | wdt_enable(); |
103 | set_bit(WDT_ENABLED, &wdt_status); | 103 | set_bit(WDT_ENABLED, &wdt_status); |
104 | return nonseekable_open(inode, file); | 104 | return stream_open(inode, file); |
105 | } | 105 | } |
106 | 106 | ||
107 | static ssize_t iop_wdt_write(struct file *file, const char *data, size_t len, | 107 | static ssize_t iop_wdt_write(struct file *file, const char *data, size_t len, |
diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c index 41b3979a9d87..b1567240a0e6 100644 --- a/drivers/watchdog/it8712f_wdt.c +++ b/drivers/watchdog/it8712f_wdt.c | |||
@@ -327,7 +327,7 @@ static int it8712f_wdt_open(struct inode *inode, struct file *file) | |||
327 | ret = it8712f_wdt_enable(); | 327 | ret = it8712f_wdt_enable(); |
328 | if (ret) | 328 | if (ret) |
329 | return ret; | 329 | return ret; |
330 | return nonseekable_open(inode, file); | 330 | return stream_open(inode, file); |
331 | } | 331 | } |
332 | 332 | ||
333 | static int it8712f_wdt_release(struct inode *inode, struct file *file) | 333 | static int it8712f_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/ixp4xx_wdt.c b/drivers/watchdog/ixp4xx_wdt.c index f20cc53ff719..dd139cda936c 100644 --- a/drivers/watchdog/ixp4xx_wdt.c +++ b/drivers/watchdog/ixp4xx_wdt.c | |||
@@ -65,7 +65,7 @@ static int ixp4xx_wdt_open(struct inode *inode, struct file *file) | |||
65 | 65 | ||
66 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); | 66 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); |
67 | wdt_enable(); | 67 | wdt_enable(); |
68 | return nonseekable_open(inode, file); | 68 | return stream_open(inode, file); |
69 | } | 69 | } |
70 | 70 | ||
71 | static ssize_t | 71 | static ssize_t |
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c index 1e41818a44bc..0565cf30017b 100644 --- a/drivers/watchdog/ks8695_wdt.c +++ b/drivers/watchdog/ks8695_wdt.c | |||
@@ -142,7 +142,7 @@ static int ks8695_wdt_open(struct inode *inode, struct file *file) | |||
142 | return -EBUSY; | 142 | return -EBUSY; |
143 | 143 | ||
144 | ks8695_wdt_start(); | 144 | ks8695_wdt_start(); |
145 | return nonseekable_open(inode, file); | 145 | return stream_open(inode, file); |
146 | } | 146 | } |
147 | 147 | ||
148 | /* | 148 | /* |
diff --git a/drivers/watchdog/m54xx_wdt.c b/drivers/watchdog/m54xx_wdt.c index da6fa2b68074..752d03620f0a 100644 --- a/drivers/watchdog/m54xx_wdt.c +++ b/drivers/watchdog/m54xx_wdt.c | |||
@@ -85,7 +85,7 @@ static int m54xx_wdt_open(struct inode *inode, struct file *file) | |||
85 | 85 | ||
86 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); | 86 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); |
87 | wdt_enable(); | 87 | wdt_enable(); |
88 | return nonseekable_open(inode, file); | 88 | return stream_open(inode, file); |
89 | } | 89 | } |
90 | 90 | ||
91 | static ssize_t m54xx_wdt_write(struct file *file, const char *data, | 91 | static ssize_t m54xx_wdt_write(struct file *file, const char *data, |
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c index 88d823d87a4b..53759415cf06 100644 --- a/drivers/watchdog/machzwd.c +++ b/drivers/watchdog/machzwd.c | |||
@@ -333,7 +333,7 @@ static int zf_open(struct inode *inode, struct file *file) | |||
333 | if (nowayout) | 333 | if (nowayout) |
334 | __module_get(THIS_MODULE); | 334 | __module_get(THIS_MODULE); |
335 | zf_timer_on(); | 335 | zf_timer_on(); |
336 | return nonseekable_open(inode, file); | 336 | return stream_open(inode, file); |
337 | } | 337 | } |
338 | 338 | ||
339 | static int zf_close(struct inode *inode, struct file *file) | 339 | static int zf_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c index 3cc07447c655..ece56db0a379 100644 --- a/drivers/watchdog/mixcomwd.c +++ b/drivers/watchdog/mixcomwd.c | |||
@@ -150,7 +150,7 @@ static int mixcomwd_open(struct inode *inode, struct file *file) | |||
150 | mixcomwd_timer_alive = 0; | 150 | mixcomwd_timer_alive = 0; |
151 | } | 151 | } |
152 | } | 152 | } |
153 | return nonseekable_open(inode, file); | 153 | return stream_open(inode, file); |
154 | } | 154 | } |
155 | 155 | ||
156 | static int mixcomwd_release(struct inode *inode, struct file *file) | 156 | static int mixcomwd_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c index e028e0a2eca0..25a92857b217 100644 --- a/drivers/watchdog/mtx-1_wdt.c +++ b/drivers/watchdog/mtx-1_wdt.c | |||
@@ -118,7 +118,7 @@ static int mtx1_wdt_open(struct inode *inode, struct file *file) | |||
118 | { | 118 | { |
119 | if (test_and_set_bit(0, &mtx1_wdt_device.inuse)) | 119 | if (test_and_set_bit(0, &mtx1_wdt_device.inuse)) |
120 | return -EBUSY; | 120 | return -EBUSY; |
121 | return nonseekable_open(inode, file); | 121 | return stream_open(inode, file); |
122 | } | 122 | } |
123 | 123 | ||
124 | 124 | ||
diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c index 315275d7bab6..c785f4f0a196 100644 --- a/drivers/watchdog/mv64x60_wdt.c +++ b/drivers/watchdog/mv64x60_wdt.c | |||
@@ -133,7 +133,7 @@ static int mv64x60_wdt_open(struct inode *inode, struct file *file) | |||
133 | 133 | ||
134 | mv64x60_wdt_handler_enable(); | 134 | mv64x60_wdt_handler_enable(); |
135 | 135 | ||
136 | return nonseekable_open(inode, file); | 136 | return stream_open(inode, file); |
137 | } | 137 | } |
138 | 138 | ||
139 | static int mv64x60_wdt_release(struct inode *inode, struct file *file) | 139 | static int mv64x60_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/nuc900_wdt.c b/drivers/watchdog/nuc900_wdt.c index 830bd04ff911..8a36350bab7b 100644 --- a/drivers/watchdog/nuc900_wdt.c +++ b/drivers/watchdog/nuc900_wdt.c | |||
@@ -131,7 +131,7 @@ static int nuc900_wdt_open(struct inode *inode, struct file *file) | |||
131 | 131 | ||
132 | nuc900_wdt_start(); | 132 | nuc900_wdt_start(); |
133 | 133 | ||
134 | return nonseekable_open(inode, file); | 134 | return stream_open(inode, file); |
135 | } | 135 | } |
136 | 136 | ||
137 | static int nuc900_wdt_close(struct inode *inode, struct file *file) | 137 | static int nuc900_wdt_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/nv_tco.c b/drivers/watchdog/nv_tco.c index a0fabf6f92b0..98d4f5371cf4 100644 --- a/drivers/watchdog/nv_tco.c +++ b/drivers/watchdog/nv_tco.c | |||
@@ -161,7 +161,7 @@ static int nv_tco_open(struct inode *inode, struct file *file) | |||
161 | /* Reload and activate timer */ | 161 | /* Reload and activate timer */ |
162 | tco_timer_keepalive(); | 162 | tco_timer_keepalive(); |
163 | tco_timer_start(); | 163 | tco_timer_start(); |
164 | return nonseekable_open(inode, file); | 164 | return stream_open(inode, file); |
165 | } | 165 | } |
166 | 166 | ||
167 | static int nv_tco_release(struct inode *inode, struct file *file) | 167 | static int nv_tco_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c index 2ffa39b46970..ca21d6c240a3 100644 --- a/drivers/watchdog/pc87413_wdt.c +++ b/drivers/watchdog/pc87413_wdt.c | |||
@@ -286,7 +286,7 @@ static int pc87413_open(struct inode *inode, struct file *file) | |||
286 | 286 | ||
287 | pr_info("Watchdog enabled. Timeout set to %d minute(s).\n", timeout); | 287 | pr_info("Watchdog enabled. Timeout set to %d minute(s).\n", timeout); |
288 | 288 | ||
289 | return nonseekable_open(inode, file); | 289 | return stream_open(inode, file); |
290 | } | 290 | } |
291 | 291 | ||
292 | /** | 292 | /** |
diff --git a/drivers/watchdog/pcwd.c b/drivers/watchdog/pcwd.c index b72ce68eacd3..a3415cf07c98 100644 --- a/drivers/watchdog/pcwd.c +++ b/drivers/watchdog/pcwd.c | |||
@@ -695,7 +695,7 @@ static int pcwd_open(struct inode *inode, struct file *file) | |||
695 | /* Activate */ | 695 | /* Activate */ |
696 | pcwd_start(); | 696 | pcwd_start(); |
697 | pcwd_keepalive(); | 697 | pcwd_keepalive(); |
698 | return nonseekable_open(inode, file); | 698 | return stream_open(inode, file); |
699 | } | 699 | } |
700 | 700 | ||
701 | static int pcwd_close(struct inode *inode, struct file *file) | 701 | static int pcwd_close(struct inode *inode, struct file *file) |
@@ -734,7 +734,7 @@ static int pcwd_temp_open(struct inode *inode, struct file *file) | |||
734 | if (!pcwd_private.supports_temp) | 734 | if (!pcwd_private.supports_temp) |
735 | return -ENODEV; | 735 | return -ENODEV; |
736 | 736 | ||
737 | return nonseekable_open(inode, file); | 737 | return stream_open(inode, file); |
738 | } | 738 | } |
739 | 739 | ||
740 | static int pcwd_temp_close(struct inode *inode, struct file *file) | 740 | static int pcwd_temp_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c index 1f78f0908621..5773d2591d3f 100644 --- a/drivers/watchdog/pcwd_pci.c +++ b/drivers/watchdog/pcwd_pci.c | |||
@@ -578,7 +578,7 @@ static int pcipcwd_open(struct inode *inode, struct file *file) | |||
578 | /* Activate */ | 578 | /* Activate */ |
579 | pcipcwd_start(); | 579 | pcipcwd_start(); |
580 | pcipcwd_keepalive(); | 580 | pcipcwd_keepalive(); |
581 | return nonseekable_open(inode, file); | 581 | return stream_open(inode, file); |
582 | } | 582 | } |
583 | 583 | ||
584 | static int pcipcwd_release(struct inode *inode, struct file *file) | 584 | static int pcipcwd_release(struct inode *inode, struct file *file) |
@@ -620,7 +620,7 @@ static int pcipcwd_temp_open(struct inode *inode, struct file *file) | |||
620 | if (!pcipcwd_private.supports_temp) | 620 | if (!pcipcwd_private.supports_temp) |
621 | return -ENODEV; | 621 | return -ENODEV; |
622 | 622 | ||
623 | return nonseekable_open(inode, file); | 623 | return stream_open(inode, file); |
624 | } | 624 | } |
625 | 625 | ||
626 | static int pcipcwd_temp_release(struct inode *inode, struct file *file) | 626 | static int pcipcwd_temp_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index 4d02f26156f9..5de6182dae33 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c | |||
@@ -485,7 +485,7 @@ static int usb_pcwd_open(struct inode *inode, struct file *file) | |||
485 | /* Activate */ | 485 | /* Activate */ |
486 | usb_pcwd_start(usb_pcwd_device); | 486 | usb_pcwd_start(usb_pcwd_device); |
487 | usb_pcwd_keepalive(usb_pcwd_device); | 487 | usb_pcwd_keepalive(usb_pcwd_device); |
488 | return nonseekable_open(inode, file); | 488 | return stream_open(inode, file); |
489 | } | 489 | } |
490 | 490 | ||
491 | static int usb_pcwd_release(struct inode *inode, struct file *file) | 491 | static int usb_pcwd_release(struct inode *inode, struct file *file) |
@@ -524,7 +524,7 @@ static ssize_t usb_pcwd_temperature_read(struct file *file, char __user *data, | |||
524 | 524 | ||
525 | static int usb_pcwd_temperature_open(struct inode *inode, struct file *file) | 525 | static int usb_pcwd_temperature_open(struct inode *inode, struct file *file) |
526 | { | 526 | { |
527 | return nonseekable_open(inode, file); | 527 | return stream_open(inode, file); |
528 | } | 528 | } |
529 | 529 | ||
530 | static int usb_pcwd_temperature_release(struct inode *inode, struct file *file) | 530 | static int usb_pcwd_temperature_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c index bb97f5b2f7eb..8938b3fb2b2d 100644 --- a/drivers/watchdog/pika_wdt.c +++ b/drivers/watchdog/pika_wdt.c | |||
@@ -118,7 +118,7 @@ static int pikawdt_open(struct inode *inode, struct file *file) | |||
118 | 118 | ||
119 | pikawdt_start(); | 119 | pikawdt_start(); |
120 | 120 | ||
121 | return nonseekable_open(inode, file); | 121 | return stream_open(inode, file); |
122 | } | 122 | } |
123 | 123 | ||
124 | /* | 124 | /* |
diff --git a/drivers/watchdog/pnx833x_wdt.c b/drivers/watchdog/pnx833x_wdt.c index 882fdcb46ad1..312899f39fd2 100644 --- a/drivers/watchdog/pnx833x_wdt.c +++ b/drivers/watchdog/pnx833x_wdt.c | |||
@@ -116,7 +116,7 @@ static int pnx833x_wdt_open(struct inode *inode, struct file *file) | |||
116 | 116 | ||
117 | pr_info("Started watchdog timer\n"); | 117 | pr_info("Started watchdog timer\n"); |
118 | 118 | ||
119 | return nonseekable_open(inode, file); | 119 | return stream_open(inode, file); |
120 | } | 120 | } |
121 | 121 | ||
122 | static int pnx833x_wdt_release(struct inode *inode, struct file *file) | 122 | static int pnx833x_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c index 3a75f3b53452..e74d5cf272ab 100644 --- a/drivers/watchdog/rc32434_wdt.c +++ b/drivers/watchdog/rc32434_wdt.c | |||
@@ -150,7 +150,7 @@ static int rc32434_wdt_open(struct inode *inode, struct file *file) | |||
150 | rc32434_wdt_start(); | 150 | rc32434_wdt_start(); |
151 | rc32434_wdt_ping(); | 151 | rc32434_wdt_ping(); |
152 | 152 | ||
153 | return nonseekable_open(inode, file); | 153 | return stream_open(inode, file); |
154 | } | 154 | } |
155 | 155 | ||
156 | static int rc32434_wdt_release(struct inode *inode, struct file *file) | 156 | static int rc32434_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c index a281aa84bfb1..4382e9556860 100644 --- a/drivers/watchdog/rdc321x_wdt.c +++ b/drivers/watchdog/rdc321x_wdt.c | |||
@@ -142,7 +142,7 @@ static int rdc321x_wdt_open(struct inode *inode, struct file *file) | |||
142 | if (test_and_set_bit(0, &rdc321x_wdt_device.inuse)) | 142 | if (test_and_set_bit(0, &rdc321x_wdt_device.inuse)) |
143 | return -EBUSY; | 143 | return -EBUSY; |
144 | 144 | ||
145 | return nonseekable_open(inode, file); | 145 | return stream_open(inode, file); |
146 | } | 146 | } |
147 | 147 | ||
148 | static int rdc321x_wdt_release(struct inode *inode, struct file *file) | 148 | static int rdc321x_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c index aba53424605e..f7f7a7a62022 100644 --- a/drivers/watchdog/riowd.c +++ b/drivers/watchdog/riowd.c | |||
@@ -76,7 +76,7 @@ static void riowd_writereg(struct riowd *p, u8 val, int index) | |||
76 | 76 | ||
77 | static int riowd_open(struct inode *inode, struct file *filp) | 77 | static int riowd_open(struct inode *inode, struct file *filp) |
78 | { | 78 | { |
79 | nonseekable_open(inode, filp); | 79 | stream_open(inode, filp); |
80 | return 0; | 80 | return 0; |
81 | } | 81 | } |
82 | 82 | ||
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index d3be4f831db5..bfa035e1a75e 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c | |||
@@ -59,7 +59,7 @@ static int sa1100dog_open(struct inode *inode, struct file *file) | |||
59 | writel_relaxed(OSSR_M3, OSSR); | 59 | writel_relaxed(OSSR_M3, OSSR); |
60 | writel_relaxed(OWER_WME, OWER); | 60 | writel_relaxed(OWER_WME, OWER); |
61 | writel_relaxed(readl_relaxed(OIER) | OIER_E3, OIER); | 61 | writel_relaxed(readl_relaxed(OIER) | OIER_E3, OIER); |
62 | return nonseekable_open(inode, file); | 62 | return stream_open(inode, file); |
63 | } | 63 | } |
64 | 64 | ||
65 | /* | 65 | /* |
diff --git a/drivers/watchdog/sb_wdog.c b/drivers/watchdog/sb_wdog.c index 3abae50773b8..0692d42e5c67 100644 --- a/drivers/watchdog/sb_wdog.c +++ b/drivers/watchdog/sb_wdog.c | |||
@@ -105,7 +105,7 @@ static const struct watchdog_info ident = { | |||
105 | */ | 105 | */ |
106 | static int sbwdog_open(struct inode *inode, struct file *file) | 106 | static int sbwdog_open(struct inode *inode, struct file *file) |
107 | { | 107 | { |
108 | nonseekable_open(inode, file); | 108 | stream_open(inode, file); |
109 | if (test_and_set_bit(0, &sbwdog_gate)) | 109 | if (test_and_set_bit(0, &sbwdog_gate)) |
110 | return -EBUSY; | 110 | return -EBUSY; |
111 | __module_get(THIS_MODULE); | 111 | __module_get(THIS_MODULE); |
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c index 72d15fd1f183..4d127a91cbdc 100644 --- a/drivers/watchdog/sbc60xxwdt.c +++ b/drivers/watchdog/sbc60xxwdt.c | |||
@@ -208,7 +208,7 @@ static int fop_open(struct inode *inode, struct file *file) | |||
208 | 208 | ||
209 | /* Good, fire up the show */ | 209 | /* Good, fire up the show */ |
210 | wdt_startup(); | 210 | wdt_startup(); |
211 | return nonseekable_open(inode, file); | 211 | return stream_open(inode, file); |
212 | } | 212 | } |
213 | 213 | ||
214 | static int fop_close(struct inode *inode, struct file *file) | 214 | static int fop_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c index 5f268add17ce..efc81b318939 100644 --- a/drivers/watchdog/sbc7240_wdt.c +++ b/drivers/watchdog/sbc7240_wdt.c | |||
@@ -136,7 +136,7 @@ static int fop_open(struct inode *inode, struct file *file) | |||
136 | 136 | ||
137 | wdt_enable(); | 137 | wdt_enable(); |
138 | 138 | ||
139 | return nonseekable_open(inode, file); | 139 | return stream_open(inode, file); |
140 | } | 140 | } |
141 | 141 | ||
142 | static int fop_close(struct inode *inode, struct file *file) | 142 | static int fop_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c index da60560ca446..3396024e7b76 100644 --- a/drivers/watchdog/sbc8360.c +++ b/drivers/watchdog/sbc8360.c | |||
@@ -271,7 +271,7 @@ static int sbc8360_open(struct inode *inode, struct file *file) | |||
271 | /* Activate and ping once to start the countdown */ | 271 | /* Activate and ping once to start the countdown */ |
272 | sbc8360_activate(); | 272 | sbc8360_activate(); |
273 | sbc8360_ping(); | 273 | sbc8360_ping(); |
274 | return nonseekable_open(inode, file); | 274 | return stream_open(inode, file); |
275 | } | 275 | } |
276 | 276 | ||
277 | static int sbc8360_close(struct inode *inode, struct file *file) | 277 | static int sbc8360_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/sbc_epx_c3.c b/drivers/watchdog/sbc_epx_c3.c index a1c502e0d8ec..783037ffd7d8 100644 --- a/drivers/watchdog/sbc_epx_c3.c +++ b/drivers/watchdog/sbc_epx_c3.c | |||
@@ -78,7 +78,7 @@ static int epx_c3_open(struct inode *inode, struct file *file) | |||
78 | epx_c3_alive = 1; | 78 | epx_c3_alive = 1; |
79 | pr_info("Started watchdog timer\n"); | 79 | pr_info("Started watchdog timer\n"); |
80 | 80 | ||
81 | return nonseekable_open(inode, file); | 81 | return stream_open(inode, file); |
82 | } | 82 | } |
83 | 83 | ||
84 | static int epx_c3_release(struct inode *inode, struct file *file) | 84 | static int epx_c3_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c index a517d8bae757..3822a60a8d2b 100644 --- a/drivers/watchdog/sbc_fitpc2_wdt.c +++ b/drivers/watchdog/sbc_fitpc2_wdt.c | |||
@@ -75,7 +75,7 @@ static int fitpc2_wdt_open(struct inode *inode, struct file *file) | |||
75 | 75 | ||
76 | wdt_enable(); | 76 | wdt_enable(); |
77 | 77 | ||
78 | return nonseekable_open(inode, file); | 78 | return stream_open(inode, file); |
79 | } | 79 | } |
80 | 80 | ||
81 | static ssize_t fitpc2_wdt_write(struct file *file, const char *data, | 81 | static ssize_t fitpc2_wdt_write(struct file *file, const char *data, |
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c index e035a4d4b299..3c2e9355410a 100644 --- a/drivers/watchdog/sc1200wdt.c +++ b/drivers/watchdog/sc1200wdt.c | |||
@@ -178,7 +178,7 @@ static int sc1200wdt_open(struct inode *inode, struct file *file) | |||
178 | sc1200wdt_start(); | 178 | sc1200wdt_start(); |
179 | pr_info("Watchdog enabled, timeout = %d min(s)", timeout); | 179 | pr_info("Watchdog enabled, timeout = %d min(s)", timeout); |
180 | 180 | ||
181 | return nonseekable_open(inode, file); | 181 | return stream_open(inode, file); |
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c index 403542f9ed8d..44797414c886 100644 --- a/drivers/watchdog/sc520_wdt.c +++ b/drivers/watchdog/sc520_wdt.c | |||
@@ -258,7 +258,7 @@ static int fop_open(struct inode *inode, struct file *file) | |||
258 | 258 | ||
259 | /* Good, fire up the show */ | 259 | /* Good, fire up the show */ |
260 | wdt_startup(); | 260 | wdt_startup(); |
261 | return nonseekable_open(inode, file); | 261 | return stream_open(inode, file); |
262 | } | 262 | } |
263 | 263 | ||
264 | static int fop_close(struct inode *inode, struct file *file) | 264 | static int fop_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c index 814cdf539b0f..ed6e9fac5d74 100644 --- a/drivers/watchdog/sch311x_wdt.c +++ b/drivers/watchdog/sch311x_wdt.c | |||
@@ -316,7 +316,7 @@ static int sch311x_wdt_open(struct inode *inode, struct file *file) | |||
316 | * Activate | 316 | * Activate |
317 | */ | 317 | */ |
318 | sch311x_wdt_start(); | 318 | sch311x_wdt_start(); |
319 | return nonseekable_open(inode, file); | 319 | return stream_open(inode, file); |
320 | } | 320 | } |
321 | 321 | ||
322 | static int sch311x_wdt_close(struct inode *inode, struct file *file) | 322 | static int sch311x_wdt_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c index ec4063ebb41a..85f2d8e06cd0 100644 --- a/drivers/watchdog/scx200_wdt.c +++ b/drivers/watchdog/scx200_wdt.c | |||
@@ -102,7 +102,7 @@ static int scx200_wdt_open(struct inode *inode, struct file *file) | |||
102 | return -EBUSY; | 102 | return -EBUSY; |
103 | scx200_wdt_enable(); | 103 | scx200_wdt_enable(); |
104 | 104 | ||
105 | return nonseekable_open(inode, file); | 105 | return stream_open(inode, file); |
106 | } | 106 | } |
107 | 107 | ||
108 | static int scx200_wdt_release(struct inode *inode, struct file *file) | 108 | static int scx200_wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c index c768dcd53034..a22170775273 100644 --- a/drivers/watchdog/smsc37b787_wdt.c +++ b/drivers/watchdog/smsc37b787_wdt.c | |||
@@ -366,7 +366,7 @@ static int wb_smsc_wdt_open(struct inode *inode, struct file *file) | |||
366 | pr_info("Watchdog enabled. Timeout set to %d %s\n", | 366 | pr_info("Watchdog enabled. Timeout set to %d %s\n", |
367 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); | 367 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); |
368 | 368 | ||
369 | return nonseekable_open(inode, file); | 369 | return stream_open(inode, file); |
370 | } | 370 | } |
371 | 371 | ||
372 | /* close => shut off the timer */ | 372 | /* close => shut off the timer */ |
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c index db9b6488e388..8dd953f90680 100644 --- a/drivers/watchdog/w83877f_wdt.c +++ b/drivers/watchdog/w83877f_wdt.c | |||
@@ -224,7 +224,7 @@ static int fop_open(struct inode *inode, struct file *file) | |||
224 | 224 | ||
225 | /* Good, fire up the show */ | 225 | /* Good, fire up the show */ |
226 | wdt_startup(); | 226 | wdt_startup(); |
227 | return nonseekable_open(inode, file); | 227 | return stream_open(inode, file); |
228 | } | 228 | } |
229 | 229 | ||
230 | static int fop_close(struct inode *inode, struct file *file) | 230 | static int fop_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c index 672b61a7f9a3..184324c1edae 100644 --- a/drivers/watchdog/w83977f_wdt.c +++ b/drivers/watchdog/w83977f_wdt.c | |||
@@ -298,7 +298,7 @@ static int wdt_open(struct inode *inode, struct file *file) | |||
298 | __module_get(THIS_MODULE); | 298 | __module_get(THIS_MODULE); |
299 | 299 | ||
300 | wdt_start(); | 300 | wdt_start(); |
301 | return nonseekable_open(inode, file); | 301 | return stream_open(inode, file); |
302 | } | 302 | } |
303 | 303 | ||
304 | static int wdt_release(struct inode *inode, struct file *file) | 304 | static int wdt_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/wafer5823wdt.c b/drivers/watchdog/wafer5823wdt.c index 93c5b610e264..0a8073b419f8 100644 --- a/drivers/watchdog/wafer5823wdt.c +++ b/drivers/watchdog/wafer5823wdt.c | |||
@@ -197,7 +197,7 @@ static int wafwdt_open(struct inode *inode, struct file *file) | |||
197 | * Activate | 197 | * Activate |
198 | */ | 198 | */ |
199 | wafwdt_start(); | 199 | wafwdt_start(); |
200 | return nonseekable_open(inode, file); | 200 | return stream_open(inode, file); |
201 | } | 201 | } |
202 | 202 | ||
203 | static int wafwdt_close(struct inode *inode, struct file *file) | 203 | static int wafwdt_close(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index f6c24b22b37c..252a7c7b6592 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c | |||
@@ -825,7 +825,7 @@ static int watchdog_open(struct inode *inode, struct file *file) | |||
825 | kref_get(&wd_data->kref); | 825 | kref_get(&wd_data->kref); |
826 | 826 | ||
827 | /* dev/watchdog is a virtual (and thus non-seekable) filesystem */ | 827 | /* dev/watchdog is a virtual (and thus non-seekable) filesystem */ |
828 | return nonseekable_open(inode, file); | 828 | return stream_open(inode, file); |
829 | 829 | ||
830 | out_mod: | 830 | out_mod: |
831 | module_put(wd_data->wdd->ops->owner); | 831 | module_put(wd_data->wdd->ops->owner); |
diff --git a/drivers/watchdog/wdrtas.c b/drivers/watchdog/wdrtas.c index 0240c60d14e3..3c3ed512ce1e 100644 --- a/drivers/watchdog/wdrtas.c +++ b/drivers/watchdog/wdrtas.c | |||
@@ -376,7 +376,7 @@ static int wdrtas_open(struct inode *inode, struct file *file) | |||
376 | wdrtas_timer_start(); | 376 | wdrtas_timer_start(); |
377 | wdrtas_timer_keepalive(); | 377 | wdrtas_timer_keepalive(); |
378 | 378 | ||
379 | return nonseekable_open(inode, file); | 379 | return stream_open(inode, file); |
380 | } | 380 | } |
381 | 381 | ||
382 | /** | 382 | /** |
@@ -442,7 +442,7 @@ static ssize_t wdrtas_temp_read(struct file *file, char __user *buf, | |||
442 | */ | 442 | */ |
443 | static int wdrtas_temp_open(struct inode *inode, struct file *file) | 443 | static int wdrtas_temp_open(struct inode *inode, struct file *file) |
444 | { | 444 | { |
445 | return nonseekable_open(inode, file); | 445 | return stream_open(inode, file); |
446 | } | 446 | } |
447 | 447 | ||
448 | /** | 448 | /** |
diff --git a/drivers/watchdog/wdt.c b/drivers/watchdog/wdt.c index e481fbbc4ae7..3d2f5ed60e88 100644 --- a/drivers/watchdog/wdt.c +++ b/drivers/watchdog/wdt.c | |||
@@ -421,7 +421,7 @@ static int wdt_open(struct inode *inode, struct file *file) | |||
421 | * Activate | 421 | * Activate |
422 | */ | 422 | */ |
423 | wdt_start(); | 423 | wdt_start(); |
424 | return nonseekable_open(inode, file); | 424 | return stream_open(inode, file); |
425 | } | 425 | } |
426 | 426 | ||
427 | /** | 427 | /** |
@@ -481,7 +481,7 @@ static ssize_t wdt_temp_read(struct file *file, char __user *buf, | |||
481 | 481 | ||
482 | static int wdt_temp_open(struct inode *inode, struct file *file) | 482 | static int wdt_temp_open(struct inode *inode, struct file *file) |
483 | { | 483 | { |
484 | return nonseekable_open(inode, file); | 484 | return stream_open(inode, file); |
485 | } | 485 | } |
486 | 486 | ||
487 | /** | 487 | /** |
diff --git a/drivers/watchdog/wdt285.c b/drivers/watchdog/wdt285.c index ebbb183be618..68843e7f224d 100644 --- a/drivers/watchdog/wdt285.c +++ b/drivers/watchdog/wdt285.c | |||
@@ -101,7 +101,7 @@ static int watchdog_open(struct inode *inode, struct file *file) | |||
101 | 101 | ||
102 | ret = 0; | 102 | ret = 0; |
103 | #endif | 103 | #endif |
104 | nonseekable_open(inode, file); | 104 | stream_open(inode, file); |
105 | return ret; | 105 | return ret; |
106 | } | 106 | } |
107 | 107 | ||
diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c index a8e6f87f60c9..59ed644dd4a9 100644 --- a/drivers/watchdog/wdt977.c +++ b/drivers/watchdog/wdt977.c | |||
@@ -273,7 +273,7 @@ static int wdt977_open(struct inode *inode, struct file *file) | |||
273 | __module_get(THIS_MODULE); | 273 | __module_get(THIS_MODULE); |
274 | 274 | ||
275 | wdt977_start(); | 275 | wdt977_start(); |
276 | return nonseekable_open(inode, file); | 276 | return stream_open(inode, file); |
277 | } | 277 | } |
278 | 278 | ||
279 | static int wdt977_release(struct inode *inode, struct file *file) | 279 | static int wdt977_release(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/wdt_pci.c b/drivers/watchdog/wdt_pci.c index 10e2cda0ee5a..ff3a41f47127 100644 --- a/drivers/watchdog/wdt_pci.c +++ b/drivers/watchdog/wdt_pci.c | |||
@@ -461,7 +461,7 @@ static int wdtpci_open(struct inode *inode, struct file *file) | |||
461 | * Activate | 461 | * Activate |
462 | */ | 462 | */ |
463 | wdtpci_start(); | 463 | wdtpci_start(); |
464 | return nonseekable_open(inode, file); | 464 | return stream_open(inode, file); |
465 | } | 465 | } |
466 | 466 | ||
467 | /** | 467 | /** |
@@ -524,7 +524,7 @@ static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, | |||
524 | 524 | ||
525 | static int wdtpci_temp_open(struct inode *inode, struct file *file) | 525 | static int wdtpci_temp_open(struct inode *inode, struct file *file) |
526 | { | 526 | { |
527 | return nonseekable_open(inode, file); | 527 | return stream_open(inode, file); |
528 | } | 528 | } |
529 | 529 | ||
530 | /** | 530 | /** |
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c index 6d1a5e58968f..f341b016672f 100644 --- a/drivers/xen/evtchn.c +++ b/drivers/xen/evtchn.c | |||
@@ -664,7 +664,7 @@ static int evtchn_open(struct inode *inode, struct file *filp) | |||
664 | 664 | ||
665 | filp->private_data = u; | 665 | filp->private_data = u; |
666 | 666 | ||
667 | return nonseekable_open(inode, filp); | 667 | return stream_open(inode, filp); |
668 | } | 668 | } |
669 | 669 | ||
670 | static int evtchn_release(struct inode *inode, struct file *filp) | 670 | static int evtchn_release(struct inode *inode, struct file *filp) |
@@ -1219,8 +1219,9 @@ EXPORT_SYMBOL(nonseekable_open); | |||
1219 | /* | 1219 | /* |
1220 | * stream_open is used by subsystems that want stream-like file descriptors. | 1220 | * stream_open is used by subsystems that want stream-like file descriptors. |
1221 | * Such file descriptors are not seekable and don't have notion of position | 1221 | * Such file descriptors are not seekable and don't have notion of position |
1222 | * (file.f_pos is always 0). Contrary to file descriptors of other regular | 1222 | * (file.f_pos is always 0 and ppos passed to .read()/.write() is always NULL). |
1223 | * files, .read() and .write() can run simultaneously. | 1223 | * Contrary to file descriptors of other regular files, .read() and .write() |
1224 | * can run simultaneously. | ||
1224 | * | 1225 | * |
1225 | * stream_open never fails and is marked to return int so that it could be | 1226 | * stream_open never fails and is marked to return int so that it could be |
1226 | * directly used as file_operations.open . | 1227 | * directly used as file_operations.open . |
diff --git a/fs/read_write.c b/fs/read_write.c index 61b43ad7608e..c543d965e288 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -365,29 +365,37 @@ out_putf: | |||
365 | int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t count) | 365 | int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t count) |
366 | { | 366 | { |
367 | struct inode *inode; | 367 | struct inode *inode; |
368 | loff_t pos; | ||
369 | int retval = -EINVAL; | 368 | int retval = -EINVAL; |
370 | 369 | ||
371 | inode = file_inode(file); | 370 | inode = file_inode(file); |
372 | if (unlikely((ssize_t) count < 0)) | 371 | if (unlikely((ssize_t) count < 0)) |
373 | return retval; | 372 | return retval; |
374 | pos = *ppos; | ||
375 | if (unlikely(pos < 0)) { | ||
376 | if (!unsigned_offsets(file)) | ||
377 | return retval; | ||
378 | if (count >= -pos) /* both values are in 0..LLONG_MAX */ | ||
379 | return -EOVERFLOW; | ||
380 | } else if (unlikely((loff_t) (pos + count) < 0)) { | ||
381 | if (!unsigned_offsets(file)) | ||
382 | return retval; | ||
383 | } | ||
384 | 373 | ||
385 | if (unlikely(inode->i_flctx && mandatory_lock(inode))) { | 374 | /* |
386 | retval = locks_mandatory_area(inode, file, pos, pos + count - 1, | 375 | * ranged mandatory locking does not apply to streams - it makes sense |
387 | read_write == READ ? F_RDLCK : F_WRLCK); | 376 | * only for files where position has a meaning. |
388 | if (retval < 0) | 377 | */ |
389 | return retval; | 378 | if (ppos) { |
379 | loff_t pos = *ppos; | ||
380 | |||
381 | if (unlikely(pos < 0)) { | ||
382 | if (!unsigned_offsets(file)) | ||
383 | return retval; | ||
384 | if (count >= -pos) /* both values are in 0..LLONG_MAX */ | ||
385 | return -EOVERFLOW; | ||
386 | } else if (unlikely((loff_t) (pos + count) < 0)) { | ||
387 | if (!unsigned_offsets(file)) | ||
388 | return retval; | ||
389 | } | ||
390 | |||
391 | if (unlikely(inode->i_flctx && mandatory_lock(inode))) { | ||
392 | retval = locks_mandatory_area(inode, file, pos, pos + count - 1, | ||
393 | read_write == READ ? F_RDLCK : F_WRLCK); | ||
394 | if (retval < 0) | ||
395 | return retval; | ||
396 | } | ||
390 | } | 397 | } |
398 | |||
391 | return security_file_permission(file, | 399 | return security_file_permission(file, |
392 | read_write == READ ? MAY_READ : MAY_WRITE); | 400 | read_write == READ ? MAY_READ : MAY_WRITE); |
393 | } | 401 | } |
@@ -400,12 +408,13 @@ static ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, lo | |||
400 | ssize_t ret; | 408 | ssize_t ret; |
401 | 409 | ||
402 | init_sync_kiocb(&kiocb, filp); | 410 | init_sync_kiocb(&kiocb, filp); |
403 | kiocb.ki_pos = *ppos; | 411 | kiocb.ki_pos = (ppos ? *ppos : 0); |
404 | iov_iter_init(&iter, READ, &iov, 1, len); | 412 | iov_iter_init(&iter, READ, &iov, 1, len); |
405 | 413 | ||
406 | ret = call_read_iter(filp, &kiocb, &iter); | 414 | ret = call_read_iter(filp, &kiocb, &iter); |
407 | BUG_ON(ret == -EIOCBQUEUED); | 415 | BUG_ON(ret == -EIOCBQUEUED); |
408 | *ppos = kiocb.ki_pos; | 416 | if (ppos) |
417 | *ppos = kiocb.ki_pos; | ||
409 | return ret; | 418 | return ret; |
410 | } | 419 | } |
411 | 420 | ||
@@ -468,12 +477,12 @@ static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t | |||
468 | ssize_t ret; | 477 | ssize_t ret; |
469 | 478 | ||
470 | init_sync_kiocb(&kiocb, filp); | 479 | init_sync_kiocb(&kiocb, filp); |
471 | kiocb.ki_pos = *ppos; | 480 | kiocb.ki_pos = (ppos ? *ppos : 0); |
472 | iov_iter_init(&iter, WRITE, &iov, 1, len); | 481 | iov_iter_init(&iter, WRITE, &iov, 1, len); |
473 | 482 | ||
474 | ret = call_write_iter(filp, &kiocb, &iter); | 483 | ret = call_write_iter(filp, &kiocb, &iter); |
475 | BUG_ON(ret == -EIOCBQUEUED); | 484 | BUG_ON(ret == -EIOCBQUEUED); |
476 | if (ret > 0) | 485 | if (ret > 0 && ppos) |
477 | *ppos = kiocb.ki_pos; | 486 | *ppos = kiocb.ki_pos; |
478 | return ret; | 487 | return ret; |
479 | } | 488 | } |
@@ -558,15 +567,10 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ | |||
558 | return ret; | 567 | return ret; |
559 | } | 568 | } |
560 | 569 | ||
561 | static inline loff_t file_pos_read(struct file *file) | 570 | /* file_ppos returns &file->f_pos or NULL if file is stream */ |
562 | { | 571 | static inline loff_t *file_ppos(struct file *file) |
563 | return file->f_mode & FMODE_STREAM ? 0 : file->f_pos; | ||
564 | } | ||
565 | |||
566 | static inline void file_pos_write(struct file *file, loff_t pos) | ||
567 | { | 572 | { |
568 | if ((file->f_mode & FMODE_STREAM) == 0) | 573 | return file->f_mode & FMODE_STREAM ? NULL : &file->f_pos; |
569 | file->f_pos = pos; | ||
570 | } | 574 | } |
571 | 575 | ||
572 | ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count) | 576 | ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count) |
@@ -575,10 +579,14 @@ ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count) | |||
575 | ssize_t ret = -EBADF; | 579 | ssize_t ret = -EBADF; |
576 | 580 | ||
577 | if (f.file) { | 581 | if (f.file) { |
578 | loff_t pos = file_pos_read(f.file); | 582 | loff_t pos, *ppos = file_ppos(f.file); |
579 | ret = vfs_read(f.file, buf, count, &pos); | 583 | if (ppos) { |
580 | if (ret >= 0) | 584 | pos = *ppos; |
581 | file_pos_write(f.file, pos); | 585 | ppos = &pos; |
586 | } | ||
587 | ret = vfs_read(f.file, buf, count, ppos); | ||
588 | if (ret >= 0 && ppos) | ||
589 | f.file->f_pos = pos; | ||
582 | fdput_pos(f); | 590 | fdput_pos(f); |
583 | } | 591 | } |
584 | return ret; | 592 | return ret; |
@@ -595,10 +603,14 @@ ssize_t ksys_write(unsigned int fd, const char __user *buf, size_t count) | |||
595 | ssize_t ret = -EBADF; | 603 | ssize_t ret = -EBADF; |
596 | 604 | ||
597 | if (f.file) { | 605 | if (f.file) { |
598 | loff_t pos = file_pos_read(f.file); | 606 | loff_t pos, *ppos = file_ppos(f.file); |
599 | ret = vfs_write(f.file, buf, count, &pos); | 607 | if (ppos) { |
600 | if (ret >= 0) | 608 | pos = *ppos; |
601 | file_pos_write(f.file, pos); | 609 | ppos = &pos; |
610 | } | ||
611 | ret = vfs_write(f.file, buf, count, ppos); | ||
612 | if (ret >= 0 && ppos) | ||
613 | f.file->f_pos = pos; | ||
602 | fdput_pos(f); | 614 | fdput_pos(f); |
603 | } | 615 | } |
604 | 616 | ||
@@ -673,14 +685,15 @@ static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter, | |||
673 | ret = kiocb_set_rw_flags(&kiocb, flags); | 685 | ret = kiocb_set_rw_flags(&kiocb, flags); |
674 | if (ret) | 686 | if (ret) |
675 | return ret; | 687 | return ret; |
676 | kiocb.ki_pos = *ppos; | 688 | kiocb.ki_pos = (ppos ? *ppos : 0); |
677 | 689 | ||
678 | if (type == READ) | 690 | if (type == READ) |
679 | ret = call_read_iter(filp, &kiocb, iter); | 691 | ret = call_read_iter(filp, &kiocb, iter); |
680 | else | 692 | else |
681 | ret = call_write_iter(filp, &kiocb, iter); | 693 | ret = call_write_iter(filp, &kiocb, iter); |
682 | BUG_ON(ret == -EIOCBQUEUED); | 694 | BUG_ON(ret == -EIOCBQUEUED); |
683 | *ppos = kiocb.ki_pos; | 695 | if (ppos) |
696 | *ppos = kiocb.ki_pos; | ||
684 | return ret; | 697 | return ret; |
685 | } | 698 | } |
686 | 699 | ||
@@ -1013,10 +1026,14 @@ static ssize_t do_readv(unsigned long fd, const struct iovec __user *vec, | |||
1013 | ssize_t ret = -EBADF; | 1026 | ssize_t ret = -EBADF; |
1014 | 1027 | ||
1015 | if (f.file) { | 1028 | if (f.file) { |
1016 | loff_t pos = file_pos_read(f.file); | 1029 | loff_t pos, *ppos = file_ppos(f.file); |
1017 | ret = vfs_readv(f.file, vec, vlen, &pos, flags); | 1030 | if (ppos) { |
1018 | if (ret >= 0) | 1031 | pos = *ppos; |
1019 | file_pos_write(f.file, pos); | 1032 | ppos = &pos; |
1033 | } | ||
1034 | ret = vfs_readv(f.file, vec, vlen, ppos, flags); | ||
1035 | if (ret >= 0 && ppos) | ||
1036 | f.file->f_pos = pos; | ||
1020 | fdput_pos(f); | 1037 | fdput_pos(f); |
1021 | } | 1038 | } |
1022 | 1039 | ||
@@ -1033,10 +1050,14 @@ static ssize_t do_writev(unsigned long fd, const struct iovec __user *vec, | |||
1033 | ssize_t ret = -EBADF; | 1050 | ssize_t ret = -EBADF; |
1034 | 1051 | ||
1035 | if (f.file) { | 1052 | if (f.file) { |
1036 | loff_t pos = file_pos_read(f.file); | 1053 | loff_t pos, *ppos = file_ppos(f.file); |
1037 | ret = vfs_writev(f.file, vec, vlen, &pos, flags); | 1054 | if (ppos) { |
1038 | if (ret >= 0) | 1055 | pos = *ppos; |
1039 | file_pos_write(f.file, pos); | 1056 | ppos = &pos; |
1057 | } | ||
1058 | ret = vfs_writev(f.file, vec, vlen, ppos, flags); | ||
1059 | if (ret >= 0 && ppos) | ||
1060 | f.file->f_pos = pos; | ||
1040 | fdput_pos(f); | 1061 | fdput_pos(f); |
1041 | } | 1062 | } |
1042 | 1063 | ||
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index 9859ababb82e..3ff32125f4b5 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c | |||
@@ -77,7 +77,7 @@ static int batadv_socket_open(struct inode *inode, struct file *file) | |||
77 | 77 | ||
78 | batadv_debugfs_deprecated(file, ""); | 78 | batadv_debugfs_deprecated(file, ""); |
79 | 79 | ||
80 | nonseekable_open(inode, file); | 80 | stream_open(inode, file); |
81 | 81 | ||
82 | socket_client = kmalloc(sizeof(*socket_client), GFP_KERNEL); | 82 | socket_client = kmalloc(sizeof(*socket_client), GFP_KERNEL); |
83 | if (!socket_client) { | 83 | if (!socket_client) { |
diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c index 3e610df8debf..e8ff13598c08 100644 --- a/net/batman-adv/log.c +++ b/net/batman-adv/log.c | |||
@@ -102,7 +102,7 @@ static int batadv_log_open(struct inode *inode, struct file *file) | |||
102 | batadv_debugfs_deprecated(file, | 102 | batadv_debugfs_deprecated(file, |
103 | "Use tracepoint batadv:batadv_dbg instead\n"); | 103 | "Use tracepoint batadv:batadv_dbg instead\n"); |
104 | 104 | ||
105 | nonseekable_open(inode, file); | 105 | stream_open(inode, file); |
106 | file->private_data = inode->i_private; | 106 | file->private_data = inode->i_private; |
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index abca57040f37..742e186bfadb 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c | |||
@@ -1143,7 +1143,7 @@ static int rfkill_fop_open(struct inode *inode, struct file *file) | |||
1143 | 1143 | ||
1144 | file->private_data = data; | 1144 | file->private_data = data; |
1145 | 1145 | ||
1146 | return nonseekable_open(inode, file); | 1146 | return stream_open(inode, file); |
1147 | 1147 | ||
1148 | free: | 1148 | free: |
1149 | mutex_unlock(&data->mtx); | 1149 | mutex_unlock(&data->mtx); |
diff --git a/sound/core/control.c b/sound/core/control.c index fad7db402443..a5cc9a874062 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -54,7 +54,7 @@ static int snd_ctl_open(struct inode *inode, struct file *file) | |||
54 | struct snd_ctl_file *ctl; | 54 | struct snd_ctl_file *ctl; |
55 | int i, err; | 55 | int i, err; |
56 | 56 | ||
57 | err = nonseekable_open(inode, file); | 57 | err = stream_open(inode, file); |
58 | if (err < 0) | 58 | if (err < 0) |
59 | return err; | 59 | return err; |
60 | 60 | ||
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index c0690d1ecd55..4666bb366c0c 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -382,7 +382,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file) | |||
382 | if ((file->f_flags & O_APPEND) && !(file->f_flags & O_NONBLOCK)) | 382 | if ((file->f_flags & O_APPEND) && !(file->f_flags & O_NONBLOCK)) |
383 | return -EINVAL; /* invalid combination */ | 383 | return -EINVAL; /* invalid combination */ |
384 | 384 | ||
385 | err = nonseekable_open(inode, file); | 385 | err = stream_open(inode, file); |
386 | if (err < 0) | 386 | if (err < 0) |
387 | return err; | 387 | return err; |
388 | 388 | ||
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 38e7deab6384..a11bdc0350fc 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c | |||
@@ -307,7 +307,7 @@ static int snd_seq_open(struct inode *inode, struct file *file) | |||
307 | struct snd_seq_user_client *user; | 307 | struct snd_seq_user_client *user; |
308 | int err; | 308 | int err; |
309 | 309 | ||
310 | err = nonseekable_open(inode, file); | 310 | err = stream_open(inode, file); |
311 | if (err < 0) | 311 | if (err < 0) |
312 | return err; | 312 | return err; |
313 | 313 | ||
diff --git a/sound/core/timer.c b/sound/core/timer.c index 61a0cec6e1f6..b842b61f66c2 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
@@ -1425,7 +1425,7 @@ static int snd_timer_user_open(struct inode *inode, struct file *file) | |||
1425 | struct snd_timer_user *tu; | 1425 | struct snd_timer_user *tu; |
1426 | int err; | 1426 | int err; |
1427 | 1427 | ||
1428 | err = nonseekable_open(inode, file); | 1428 | err = stream_open(inode, file); |
1429 | if (err < 0) | 1429 | if (err < 0) |
1430 | return err; | 1430 | return err; |
1431 | 1431 | ||