Lines Matching refs:ip
79 static inline struct inode *VFS_I(struct xfs_inode *ip) in VFS_I() argument
81 return &ip->i_vnode; in VFS_I()
89 static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) in XFS_ISIZE() argument
91 if (S_ISREG(ip->i_d.di_mode)) in XFS_ISIZE()
92 return i_size_read(VFS_I(ip)); in XFS_ISIZE()
93 return ip->i_d.di_size; in XFS_ISIZE()
101 xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size) in xfs_new_eof() argument
103 xfs_fsize_t i_size = i_size_read(VFS_I(ip)); in xfs_new_eof()
107 return new_size > ip->i_d.di_size ? new_size : 0; in xfs_new_eof()
114 __xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_set() argument
116 ip->i_flags |= flags; in __xfs_iflags_set()
120 xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_set() argument
122 spin_lock(&ip->i_flags_lock); in xfs_iflags_set()
123 __xfs_iflags_set(ip, flags); in xfs_iflags_set()
124 spin_unlock(&ip->i_flags_lock); in xfs_iflags_set()
128 xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_clear() argument
130 spin_lock(&ip->i_flags_lock); in xfs_iflags_clear()
131 ip->i_flags &= ~flags; in xfs_iflags_clear()
132 spin_unlock(&ip->i_flags_lock); in xfs_iflags_clear()
136 __xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_test() argument
138 return (ip->i_flags & flags); in __xfs_iflags_test()
142 xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test() argument
145 spin_lock(&ip->i_flags_lock); in xfs_iflags_test()
146 ret = __xfs_iflags_test(ip, flags); in xfs_iflags_test()
147 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test()
152 xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_clear() argument
156 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
157 ret = ip->i_flags & flags; in xfs_iflags_test_and_clear()
159 ip->i_flags &= ~flags; in xfs_iflags_test_and_clear()
160 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
165 xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_set() argument
169 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
170 ret = ip->i_flags & flags; in xfs_iflags_test_and_set()
172 ip->i_flags |= flags; in xfs_iflags_test_and_set()
173 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
183 xfs_get_projid(struct xfs_inode *ip) in xfs_get_projid() argument
185 return (prid_t)ip->i_d.di_projid_hi << 16 | ip->i_d.di_projid_lo; in xfs_get_projid()
189 xfs_set_projid(struct xfs_inode *ip, in xfs_set_projid() argument
192 ip->i_d.di_projid_hi = (__uint16_t) (projid >> 16); in xfs_set_projid()
193 ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff); in xfs_set_projid()
233 extern void __xfs_iflock(struct xfs_inode *ip);
235 static inline int xfs_iflock_nowait(struct xfs_inode *ip) in xfs_iflock_nowait() argument
237 return !xfs_iflags_test_and_set(ip, XFS_IFLOCK); in xfs_iflock_nowait()
240 static inline void xfs_iflock(struct xfs_inode *ip) in xfs_iflock() argument
242 if (!xfs_iflock_nowait(ip)) in xfs_iflock()
243 __xfs_iflock(ip); in xfs_iflock()
246 static inline void xfs_ifunlock(struct xfs_inode *ip) in xfs_ifunlock() argument
248 xfs_iflags_clear(ip, XFS_IFLOCK); in xfs_ifunlock()
250 wake_up_bit(&ip->i_flags, __XFS_IFLOCK_BIT); in xfs_ifunlock()
253 static inline int xfs_isiflocked(struct xfs_inode *ip) in xfs_isiflocked() argument
255 return xfs_iflags_test(ip, XFS_IFLOCK); in xfs_isiflocked()
374 int xfs_release(struct xfs_inode *ip);
375 void xfs_inactive(struct xfs_inode *ip);
383 struct xfs_inode *ip);
413 #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) argument
419 xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
435 int xfs_update_prealloc_flags(struct xfs_inode *ip,
437 int xfs_zero_eof(struct xfs_inode *ip, xfs_off_t offset,
439 int xfs_iozero(struct xfs_inode *ip, loff_t pos, size_t count);
450 extern void xfs_setup_inode(struct xfs_inode *ip);
451 static inline void xfs_finish_inode_setup(struct xfs_inode *ip) in xfs_finish_inode_setup() argument
453 xfs_iflags_clear(ip, XFS_INEW); in xfs_finish_inode_setup()
455 unlock_new_inode(VFS_I(ip)); in xfs_finish_inode_setup()
458 static inline void xfs_setup_existing_inode(struct xfs_inode *ip) in xfs_setup_existing_inode() argument
460 xfs_setup_inode(ip); in xfs_setup_existing_inode()
461 xfs_finish_inode_setup(ip); in xfs_setup_existing_inode()
464 #define IHOLD(ip) \ argument
466 ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
467 ihold(VFS_I(ip)); \
468 trace_xfs_ihold(ip, _THIS_IP_); \
471 #define IRELE(ip) \ argument
473 trace_xfs_irele(ip, _THIS_IP_); \
474 iput(VFS_I(ip)); \