diff options
author | Jeff Layton | 2020-10-09 14:24:34 -0400 |
---|---|---|
committer | Ilya Dryomov | 2021-02-16 12:09:51 +0100 |
commit | 64f28c627a27abb053561275bf94fbcc78e66198 (patch) | |
tree | 23b8cae11ad12c1e870736113dc40ecfaa30ffef /fs/ceph/super.h | |
parent | 64f36da5625f7f9853b86750eaa89d499d16a2e9 (diff) |
ceph: clean up inode work queueing
Add a generic function for taking an inode reference, setting the I_WORK
bit and queueing i_work. Turn the ceph_queue_* functions into static
inline wrappers that pass in the right bit.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index b62d8fee3b86..59153ee201c0 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -962,11 +962,26 @@ extern int ceph_inode_holds_cap(struct inode *inode, int mask); extern bool ceph_inode_set_size(struct inode *inode, loff_t size); extern void __ceph_do_pending_vmtruncate(struct inode *inode); -extern void ceph_queue_vmtruncate(struct inode *inode); -extern void ceph_queue_invalidate(struct inode *inode); -extern void ceph_queue_writeback(struct inode *inode); + extern void ceph_async_iput(struct inode *inode); +void ceph_queue_inode_work(struct inode *inode, int work_bit); + +static inline void ceph_queue_vmtruncate(struct inode *inode) +{ + ceph_queue_inode_work(inode, CEPH_I_WORK_VMTRUNCATE); +} + +static inline void ceph_queue_invalidate(struct inode *inode) +{ + ceph_queue_inode_work(inode, CEPH_I_WORK_INVALIDATE_PAGES); +} + +static inline void ceph_queue_writeback(struct inode *inode) +{ + ceph_queue_inode_work(inode, CEPH_I_WORK_WRITEBACK); +} + extern int __ceph_do_getattr(struct inode *inode, struct page *locked_page, int mask, bool force); static inline int ceph_do_getattr(struct inode *inode, int mask, bool force) |