aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.h
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-08-13 02:41:16 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-08-13 02:41:16 -0400
commitc63942d3eeffb98219e05d0976862ab9907d297d (patch)
tree2f00c2aa9df30c3e91c06aa46c5722382093c5de /fs/xfs/xfs_inode.h
parent39d2f1ab2a36ac527a6c41cfe689f50c239eaca3 (diff)
[XFS] replace inode flush semaphore with a completion
Use the new completion flush code to implement the inode flush lock. Removes one of the final users of semaphores in the XFS code base. SGI-PV: 981498 SGI-Modid: xfs-linux-melb:xfs-kern:31817a Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r--fs/xfs/xfs_inode.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 571724404355..f771df6bfa6f 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -223,7 +223,7 @@ typedef struct xfs_inode {
223 struct xfs_inode_log_item *i_itemp; /* logging information */ 223 struct xfs_inode_log_item *i_itemp; /* logging information */
224 mrlock_t i_lock; /* inode lock */ 224 mrlock_t i_lock; /* inode lock */
225 mrlock_t i_iolock; /* inode IO lock */ 225 mrlock_t i_iolock; /* inode IO lock */
226 sema_t i_flock; /* inode flush lock */ 226 struct completion i_flush; /* inode flush completion q */
227 atomic_t i_pincount; /* inode pin count */ 227 atomic_t i_pincount; /* inode pin count */
228 wait_queue_head_t i_ipin_wait; /* inode pinning wait queue */ 228 wait_queue_head_t i_ipin_wait; /* inode pinning wait queue */
229 spinlock_t i_flags_lock; /* inode i_flags lock */ 229 spinlock_t i_flags_lock; /* inode i_flags lock */
@@ -482,11 +482,8 @@ int xfs_ilock_nowait(xfs_inode_t *, uint);
482void xfs_iunlock(xfs_inode_t *, uint); 482void xfs_iunlock(xfs_inode_t *, uint);
483void xfs_ilock_demote(xfs_inode_t *, uint); 483void xfs_ilock_demote(xfs_inode_t *, uint);
484int xfs_isilocked(xfs_inode_t *, uint); 484int xfs_isilocked(xfs_inode_t *, uint);
485void xfs_iflock(xfs_inode_t *);
486int xfs_iflock_nowait(xfs_inode_t *);
487uint xfs_ilock_map_shared(xfs_inode_t *); 485uint xfs_ilock_map_shared(xfs_inode_t *);
488void xfs_iunlock_map_shared(xfs_inode_t *, uint); 486void xfs_iunlock_map_shared(xfs_inode_t *, uint);
489void xfs_ifunlock(xfs_inode_t *);
490void xfs_ireclaim(xfs_inode_t *); 487void xfs_ireclaim(xfs_inode_t *);
491int xfs_finish_reclaim(xfs_inode_t *, int, int); 488int xfs_finish_reclaim(xfs_inode_t *, int, int);
492int xfs_finish_reclaim_all(struct xfs_mount *, int); 489int xfs_finish_reclaim_all(struct xfs_mount *, int);
@@ -580,6 +577,26 @@ extern struct kmem_zone *xfs_ifork_zone;
580extern struct kmem_zone *xfs_inode_zone; 577extern struct kmem_zone *xfs_inode_zone;
581extern struct kmem_zone *xfs_ili_zone; 578extern struct kmem_zone *xfs_ili_zone;
582 579
580/*
581 * Manage the i_flush queue embedded in the inode. This completion
582 * queue synchronizes processes attempting to flush the in-core
583 * inode back to disk.
584 */
585static inline void xfs_iflock(xfs_inode_t *ip)
586{
587 wait_for_completion(&ip->i_flush);
588}
589
590static inline int xfs_iflock_nowait(xfs_inode_t *ip)
591{
592 return try_wait_for_completion(&ip->i_flush);
593}
594
595static inline void xfs_ifunlock(xfs_inode_t *ip)
596{
597 complete(&ip->i_flush);
598}
599
583#endif /* __KERNEL__ */ 600#endif /* __KERNEL__ */
584 601
585#endif /* __XFS_INODE_H__ */ 602#endif /* __XFS_INODE_H__ */