aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-02-22 11:58:50 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-03-25 20:28:11 -0400
commite2e40f2c1ed433c5e224525c8c862fd32e5d3df2 (patch)
tree6210d9452c526157744b0d83454eaea20bcf9a0e /include/linux/fs.h
parent04b2fa9f8f36ec6fb6fd1c9dc9df6fff0cd27323 (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.h22
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;
314struct address_space; 314struct address_space;
315struct writeback_control; 315struct writeback_control;
316 316
317#define IOCB_EVENTFD (1 << 0)
318
319struct 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
327static inline bool is_sync_kiocb(struct kiocb *kiocb)
328{
329 return kiocb->ki_complete == NULL;
330}
331
332static 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