summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-11-22 10:37:38 -0500
committerJens Axboe <axboe@kernel.dk>2019-02-24 10:20:17 -0500
commitfb7e160019f4abb4082740bfeb27a38f6389c745 (patch)
tree7898b05dee28219f4a573c7b31249c733c570b49 /include/linux/fs.h
parent758a58d0bc67457f1215321a536226654a830eeb (diff)
fs: add an iopoll method to struct file_operations
This new methods is used to explicitly poll for I/O completion for an iocb. It must be called for any iocb submitted asynchronously (that is with a non-null ki_complete) which has the IOCB_HIPRI flag set. The method is assisted by a new ki_cookie field in struct iocb to store the polling cookie. Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 29d8e2cfed0e..dedcc2e9265c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -310,6 +310,7 @@ struct kiocb {
310 int ki_flags; 310 int ki_flags;
311 u16 ki_hint; 311 u16 ki_hint;
312 u16 ki_ioprio; /* See linux/ioprio.h */ 312 u16 ki_ioprio; /* See linux/ioprio.h */
313 unsigned int ki_cookie; /* for ->iopoll */
313} __randomize_layout; 314} __randomize_layout;
314 315
315static inline bool is_sync_kiocb(struct kiocb *kiocb) 316static inline bool is_sync_kiocb(struct kiocb *kiocb)
@@ -1787,6 +1788,7 @@ struct file_operations {
1787 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 1788 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
1788 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *); 1789 ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
1789 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); 1790 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
1791 int (*iopoll)(struct kiocb *kiocb, bool spin);
1790 int (*iterate) (struct file *, struct dir_context *); 1792 int (*iterate) (struct file *, struct dir_context *);
1791 int (*iterate_shared) (struct file *, struct dir_context *); 1793 int (*iterate_shared) (struct file *, struct dir_context *);
1792 __poll_t (*poll) (struct file *, struct poll_table_struct *); 1794 __poll_t (*poll) (struct file *, struct poll_table_struct *);