diff options
author | Christoph Hellwig <hch@lst.de> | 2015-02-22 11:58:50 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-03-25 20:28:11 -0400 |
commit | e2e40f2c1ed433c5e224525c8c862fd32e5d3df2 (patch) | |
tree | 6210d9452c526157744b0d83454eaea20bcf9a0e /include/linux/fs.h | |
parent | 04b2fa9f8f36ec6fb6fd1c9dc9df6fff0cd27323 (diff) |
fs: move struct kiocb to fs.h
struct kiocb now is a generic I/O container, so move it to fs.h.
Also do a #include diet for aio.h while we're at it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 447932aed1e1..48c1472bde4a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -314,6 +314,28 @@ struct page; | |||
314 | struct address_space; | 314 | struct address_space; |
315 | struct writeback_control; | 315 | struct writeback_control; |
316 | 316 | ||
317 | #define IOCB_EVENTFD (1 << 0) | ||
318 | |||
319 | struct kiocb { | ||
320 | struct file *ki_filp; | ||
321 | loff_t ki_pos; | ||
322 | void (*ki_complete)(struct kiocb *iocb, long ret, long ret2); | ||
323 | void *private; | ||
324 | int ki_flags; | ||
325 | }; | ||
326 | |||
327 | static inline bool is_sync_kiocb(struct kiocb *kiocb) | ||
328 | { | ||
329 | return kiocb->ki_complete == NULL; | ||
330 | } | ||
331 | |||
332 | static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) | ||
333 | { | ||
334 | *kiocb = (struct kiocb) { | ||
335 | .ki_filp = filp, | ||
336 | }; | ||
337 | } | ||
338 | |||
317 | /* | 339 | /* |
318 | * "descriptor" for what we're up to with a read. | 340 | * "descriptor" for what we're up to with a read. |
319 | * This allows us to use the same read code yet | 341 | * This allows us to use the same read code yet |