• Home
  • Raw
  • Download

Lines Matching refs:ip

198 #define XFS_IFORK_Q(ip)			((ip)->i_d.di_forkoff != 0)  argument
199 #define XFS_IFORK_BOFF(ip) ((int)((ip)->i_d.di_forkoff << 3)) argument
201 #define XFS_IFORK_PTR(ip,w) \ argument
203 &(ip)->i_df : \
204 (ip)->i_afp)
205 #define XFS_IFORK_DSIZE(ip) \ argument
206 (XFS_IFORK_Q(ip) ? \
207 XFS_IFORK_BOFF(ip) : \
208 XFS_LITINO((ip)->i_mount, (ip)->i_d.di_version))
209 #define XFS_IFORK_ASIZE(ip) \ argument
210 (XFS_IFORK_Q(ip) ? \
211 XFS_LITINO((ip)->i_mount, (ip)->i_d.di_version) - \
212 XFS_IFORK_BOFF(ip) : \
214 #define XFS_IFORK_SIZE(ip,w) \ argument
216 XFS_IFORK_DSIZE(ip) : \
217 XFS_IFORK_ASIZE(ip))
218 #define XFS_IFORK_FORMAT(ip,w) \ argument
220 (ip)->i_d.di_format : \
221 (ip)->i_d.di_aformat)
222 #define XFS_IFORK_FMT_SET(ip,w,n) \ argument
224 ((ip)->i_d.di_format = (n)) : \
225 ((ip)->i_d.di_aformat = (n)))
226 #define XFS_IFORK_NEXTENTS(ip,w) \ argument
228 (ip)->i_d.di_nextents : \
229 (ip)->i_d.di_anextents)
230 #define XFS_IFORK_NEXT_SET(ip,w,n) \ argument
232 ((ip)->i_d.di_nextents = (n)) : \
233 ((ip)->i_d.di_anextents = (n)))
234 #define XFS_IFORK_MAXEXT(ip, w) \ argument
235 (XFS_IFORK_SIZE(ip, w) / sizeof(xfs_bmbt_rec_t))
285 static inline struct inode *VFS_I(struct xfs_inode *ip) in VFS_I() argument
287 return &ip->i_vnode; in VFS_I()
295 static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) in XFS_ISIZE() argument
297 if (S_ISREG(ip->i_d.di_mode)) in XFS_ISIZE()
298 return i_size_read(VFS_I(ip)); in XFS_ISIZE()
299 return ip->i_d.di_size; in XFS_ISIZE()
307 xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size) in xfs_new_eof() argument
309 xfs_fsize_t i_size = i_size_read(VFS_I(ip)); in xfs_new_eof()
313 return new_size > ip->i_d.di_size ? new_size : 0; in xfs_new_eof()
320 __xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_set() argument
322 ip->i_flags |= flags; in __xfs_iflags_set()
326 xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_set() argument
328 spin_lock(&ip->i_flags_lock); in xfs_iflags_set()
329 __xfs_iflags_set(ip, flags); in xfs_iflags_set()
330 spin_unlock(&ip->i_flags_lock); in xfs_iflags_set()
334 xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_clear() argument
336 spin_lock(&ip->i_flags_lock); in xfs_iflags_clear()
337 ip->i_flags &= ~flags; in xfs_iflags_clear()
338 spin_unlock(&ip->i_flags_lock); in xfs_iflags_clear()
342 __xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_test() argument
344 return (ip->i_flags & flags); in __xfs_iflags_test()
348 xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test() argument
351 spin_lock(&ip->i_flags_lock); in xfs_iflags_test()
352 ret = __xfs_iflags_test(ip, flags); in xfs_iflags_test()
353 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test()
358 xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_clear() argument
362 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
363 ret = ip->i_flags & flags; in xfs_iflags_test_and_clear()
365 ip->i_flags &= ~flags; in xfs_iflags_test_and_clear()
366 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
371 xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_set() argument
375 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
376 ret = ip->i_flags & flags; in xfs_iflags_test_and_set()
378 ip->i_flags |= flags; in xfs_iflags_test_and_set()
379 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
389 xfs_get_projid(struct xfs_inode *ip) in xfs_get_projid() argument
391 return (prid_t)ip->i_d.di_projid_hi << 16 | ip->i_d.di_projid_lo; in xfs_get_projid()
395 xfs_set_projid(struct xfs_inode *ip, in xfs_set_projid() argument
398 ip->i_d.di_projid_hi = (__uint16_t) (projid >> 16); in xfs_set_projid()
399 ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff); in xfs_set_projid()
432 extern void __xfs_iflock(struct xfs_inode *ip);
434 static inline int xfs_iflock_nowait(struct xfs_inode *ip) in xfs_iflock_nowait() argument
436 return !xfs_iflags_test_and_set(ip, XFS_IFLOCK); in xfs_iflock_nowait()
439 static inline void xfs_iflock(struct xfs_inode *ip) in xfs_iflock() argument
441 if (!xfs_iflock_nowait(ip)) in xfs_iflock()
442 __xfs_iflock(ip); in xfs_iflock()
445 static inline void xfs_ifunlock(struct xfs_inode *ip) in xfs_ifunlock() argument
447 xfs_iflags_clear(ip, XFS_IFLOCK); in xfs_ifunlock()
449 wake_up_bit(&ip->i_flags, __XFS_IFLOCK_BIT); in xfs_ifunlock()
452 static inline int xfs_isiflocked(struct xfs_inode *ip) in xfs_isiflocked() argument
454 return xfs_iflags_test(ip, XFS_IFLOCK); in xfs_isiflocked()
555 xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
557 #define IHOLD(ip) \ argument
559 ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
560 ihold(VFS_I(ip)); \
561 trace_xfs_ihold(ip, _THIS_IP_); \
564 #define IRELE(ip) \ argument
566 trace_xfs_irele(ip, _THIS_IP_); \
567 iput(VFS_I(ip)); \
618 #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) argument