aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r--fs/xfs/xfs_inode.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index e96eb0835fe6..bc823720d88f 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -305,6 +305,47 @@ typedef struct xfs_inode {
305#endif 305#endif
306} xfs_inode_t; 306} xfs_inode_t;
307 307
308
309/*
310 * i_flags helper functions
311 */
312static inline void
313__xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
314{
315 ip->i_flags |= flags;
316}
317
318static inline void
319xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
320{
321 spin_lock(&ip->i_flags_lock);
322 __xfs_iflags_set(ip, flags);
323 spin_unlock(&ip->i_flags_lock);
324}
325
326static inline void
327xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags)
328{
329 spin_lock(&ip->i_flags_lock);
330 ip->i_flags &= ~flags;
331 spin_unlock(&ip->i_flags_lock);
332}
333
334static inline int
335__xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
336{
337 return (ip->i_flags & flags);
338}
339
340static inline int
341xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
342{
343 int ret;
344 spin_lock(&ip->i_flags_lock);
345 ret = __xfs_iflags_test(ip, flags);
346 spin_unlock(&ip->i_flags_lock);
347 return ret;
348}
308#endif /* __KERNEL__ */ 349#endif /* __KERNEL__ */
309 350
310 351