aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-04 16:57:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-04 16:57:43 -0400
commit408afb8d7847faea115508ba154346e33edfc7d5 (patch)
tree9b558f8477d7400ad5e8849c2624471915654ade /Documentation/filesystems
parentb058efc1acfd99027b4c70458e72c3d20a1a5bbc (diff)
parent1da92779e2e8f309d5aecbbed346e7f812b174e8 (diff)
Merge branch 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull aio updates from Al Viro: "Majority of AIO stuff this cycle. aio-fsync and aio-poll, mostly. The only thing I'm holding back for a day or so is Adam's aio ioprio - his last-minute fixup is trivial (missing stub in !CONFIG_BLOCK case), but let it sit in -next for decency sake..." * 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) aio: sanitize the limit checking in io_submit(2) aio: fold do_io_submit() into callers aio: shift copyin of iocb into io_submit_one() aio_read_events_ring(): make a bit more readable aio: all callers of aio_{read,write,fsync,poll} treat 0 and -EIOCBQUEUED the same way aio: take list removal to (some) callers of aio_complete() aio: add missing break for the IOCB_CMD_FDSYNC case random: convert to ->poll_mask timerfd: convert to ->poll_mask eventfd: switch to ->poll_mask pipe: convert to ->poll_mask crypto: af_alg: convert to ->poll_mask net/rxrpc: convert to ->poll_mask net/iucv: convert to ->poll_mask net/phonet: convert to ->poll_mask net/nfc: convert to ->poll_mask net/caif: convert to ->poll_mask net/bluetooth: convert to ->poll_mask net/sctp: convert to ->poll_mask net/tipc: convert to ->poll_mask ...
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/Locking9
-rw-r--r--Documentation/filesystems/vfs.txt15
2 files changed, 21 insertions, 3 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 15853d522941..2c391338c675 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -440,7 +440,9 @@ prototypes:
440 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); 440 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
441 int (*iterate) (struct file *, struct dir_context *); 441 int (*iterate) (struct file *, struct dir_context *);
442 int (*iterate_shared) (struct file *, struct dir_context *); 442 int (*iterate_shared) (struct file *, struct dir_context *);
443 unsigned int (*poll) (struct file *, struct poll_table_struct *); 443 __poll_t (*poll) (struct file *, struct poll_table_struct *);
444 struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
445 __poll_t (*poll_mask) (struct file *, __poll_t);
444 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 446 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
445 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 447 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
446 int (*mmap) (struct file *, struct vm_area_struct *); 448 int (*mmap) (struct file *, struct vm_area_struct *);
@@ -471,7 +473,7 @@ prototypes:
471}; 473};
472 474
473locking rules: 475locking rules:
474 All may block. 476 All except for ->poll_mask may block.
475 477
476->llseek() locking has moved from llseek to the individual llseek 478->llseek() locking has moved from llseek to the individual llseek
477implementations. If your fs is not using generic_file_llseek, you 479implementations. If your fs is not using generic_file_llseek, you
@@ -503,6 +505,9 @@ in sys_read() and friends.
503the lease within the individual filesystem to record the result of the 505the lease within the individual filesystem to record the result of the
504operation 506operation
505 507
508->poll_mask can be called with or without the waitqueue lock for the waitqueue
509returned from ->get_poll_head.
510
506--------------------------- dquot_operations ------------------------------- 511--------------------------- dquot_operations -------------------------------
507prototypes: 512prototypes:
508 int (*write_dquot) (struct dquot *); 513 int (*write_dquot) (struct dquot *);
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 5fd325df59e2..829a7b7857a4 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -856,7 +856,9 @@ struct file_operations {
856 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *); 856 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
857 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); 857 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
858 int (*iterate) (struct file *, struct dir_context *); 858 int (*iterate) (struct file *, struct dir_context *);
859 unsigned int (*poll) (struct file *, struct poll_table_struct *); 859 __poll_t (*poll) (struct file *, struct poll_table_struct *);
860 struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
861 __poll_t (*poll_mask) (struct file *, __poll_t);
860 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 862 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
861 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 863 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
862 int (*mmap) (struct file *, struct vm_area_struct *); 864 int (*mmap) (struct file *, struct vm_area_struct *);
@@ -901,6 +903,17 @@ otherwise noted.
901 activity on this file and (optionally) go to sleep until there 903 activity on this file and (optionally) go to sleep until there
902 is activity. Called by the select(2) and poll(2) system calls 904 is activity. Called by the select(2) and poll(2) system calls
903 905
906 get_poll_head: Returns the struct wait_queue_head that callers can
907 wait on. Callers need to check the returned events using ->poll_mask
908 once woken. Can return NULL to indicate polling is not supported,
909 or any error code using the ERR_PTR convention to indicate that a
910 grave error occured and ->poll_mask shall not be called.
911
912 poll_mask: return the mask of EPOLL* values describing the file descriptor
913 state. Called either before going to sleep on the waitqueue returned by
914 get_poll_head, or after it has been woken. If ->get_poll_head and
915 ->poll_mask are implemented ->poll does not need to be implement.
916
904 unlocked_ioctl: called by the ioctl(2) system call. 917 unlocked_ioctl: called by the ioctl(2) system call.
905 918
906 compat_ioctl: called by the ioctl(2) system call when 32 bit system calls 919 compat_ioctl: called by the ioctl(2) system call when 32 bit system calls