aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c7496f263860..35ec87e490b1 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1820,7 +1820,7 @@ struct super_operations {
1820#define I_SYNC (1 << __I_SYNC) 1820#define I_SYNC (1 << __I_SYNC)
1821#define I_REFERENCED (1 << 8) 1821#define I_REFERENCED (1 << 8)
1822#define __I_DIO_WAKEUP 9 1822#define __I_DIO_WAKEUP 9
1823#define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) 1823#define I_DIO_WAKEUP (1 << __I_DIO_WAKEUP)
1824#define I_LINKABLE (1 << 10) 1824#define I_LINKABLE (1 << 10)
1825#define I_DIRTY_TIME (1 << 11) 1825#define I_DIRTY_TIME (1 << 11)
1826#define __I_DIRTY_TIME_EXPIRED 12 1826#define __I_DIRTY_TIME_EXPIRED 12
@@ -2644,6 +2644,9 @@ enum {
2644 2644
2645 /* filesystem can handle aio writes beyond i_size */ 2645 /* filesystem can handle aio writes beyond i_size */
2646 DIO_ASYNC_EXTEND = 0x04, 2646 DIO_ASYNC_EXTEND = 0x04,
2647
2648 /* inode/fs/bdev does not need truncate protection */
2649 DIO_SKIP_DIO_COUNT = 0x08,
2647}; 2650};
2648 2651
2649void dio_end_io(struct bio *bio, int error); 2652void dio_end_io(struct bio *bio, int error);
@@ -2666,7 +2669,31 @@ static inline ssize_t blockdev_direct_IO(struct kiocb *iocb,
2666#endif 2669#endif
2667 2670
2668void inode_dio_wait(struct inode *inode); 2671void inode_dio_wait(struct inode *inode);
2669void inode_dio_done(struct inode *inode); 2672
2673/*
2674 * inode_dio_begin - signal start of a direct I/O requests
2675 * @inode: inode the direct I/O happens on
2676 *
2677 * This is called once we've finished processing a direct I/O request,
2678 * and is used to wake up callers waiting for direct I/O to be quiesced.
2679 */
2680static inline void inode_dio_begin(struct inode *inode)
2681{
2682 atomic_inc(&inode->i_dio_count);
2683}
2684
2685/*
2686 * inode_dio_end - signal finish of a direct I/O requests
2687 * @inode: inode the direct I/O happens on
2688 *
2689 * This is called once we've finished processing a direct I/O request,
2690 * and is used to wake up callers waiting for direct I/O to be quiesced.
2691 */
2692static inline void inode_dio_end(struct inode *inode)
2693{
2694 if (atomic_dec_and_test(&inode->i_dio_count))
2695 wake_up_bit(&inode->i_state, __I_DIO_WAKEUP);
2696}
2670 2697
2671extern void inode_set_flags(struct inode *inode, unsigned int flags, 2698extern void inode_set_flags(struct inode *inode, unsigned int flags,
2672 unsigned int mask); 2699 unsigned int mask);