Lines Matching refs:ip
87 static inline struct inode *VFS_I(struct xfs_inode *ip) in VFS_I() argument
89 return &ip->i_vnode; in VFS_I()
97 static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) in XFS_ISIZE() argument
99 if (S_ISREG(VFS_I(ip)->i_mode)) in XFS_ISIZE()
100 return i_size_read(VFS_I(ip)); in XFS_ISIZE()
101 return ip->i_disk_size; in XFS_ISIZE()
109 xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size) in xfs_new_eof() argument
111 xfs_fsize_t i_size = i_size_read(VFS_I(ip)); in xfs_new_eof()
115 return new_size > ip->i_disk_size ? new_size : 0; in xfs_new_eof()
122 __xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_set() argument
124 ip->i_flags |= flags; in __xfs_iflags_set()
128 xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_set() argument
130 spin_lock(&ip->i_flags_lock); in xfs_iflags_set()
131 __xfs_iflags_set(ip, flags); in xfs_iflags_set()
132 spin_unlock(&ip->i_flags_lock); in xfs_iflags_set()
136 xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_clear() argument
138 spin_lock(&ip->i_flags_lock); in xfs_iflags_clear()
139 ip->i_flags &= ~flags; in xfs_iflags_clear()
140 spin_unlock(&ip->i_flags_lock); in xfs_iflags_clear()
144 __xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_test() argument
146 return (ip->i_flags & flags); in __xfs_iflags_test()
150 xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test() argument
153 spin_lock(&ip->i_flags_lock); in xfs_iflags_test()
154 ret = __xfs_iflags_test(ip, flags); in xfs_iflags_test()
155 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test()
160 xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_clear() argument
164 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
165 ret = ip->i_flags & flags; in xfs_iflags_test_and_clear()
167 ip->i_flags &= ~flags; in xfs_iflags_test_and_clear()
168 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
173 xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_set() argument
177 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
178 ret = ip->i_flags & flags; in xfs_iflags_test_and_set()
180 ip->i_flags |= flags; in xfs_iflags_test_and_set()
181 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
194 static inline bool xfs_is_reflink_inode(struct xfs_inode *ip) in xfs_is_reflink_inode() argument
196 return ip->i_diflags2 & XFS_DIFLAG2_REFLINK; in xfs_is_reflink_inode()
199 static inline bool xfs_is_metadata_inode(struct xfs_inode *ip) in xfs_is_metadata_inode() argument
201 struct xfs_mount *mp = ip->i_mount; in xfs_is_metadata_inode()
203 return ip == mp->m_rbmip || ip == mp->m_rsumip || in xfs_is_metadata_inode()
204 xfs_is_quota_inode(&mp->m_sb, ip->i_ino); in xfs_is_metadata_inode()
211 static inline bool xfs_inode_has_cow_data(struct xfs_inode *ip) in xfs_inode_has_cow_data() argument
213 return ip->i_cowfp && ip->i_cowfp->if_bytes; in xfs_inode_has_cow_data()
216 static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip) in xfs_inode_has_bigtime() argument
218 return ip->i_diflags2 & XFS_DIFLAG2_BIGTIME; in xfs_inode_has_bigtime()
224 #define xfs_inode_buftarg(ip) \ argument
225 (XFS_IS_REALTIME_INODE(ip) ? \
226 (ip)->i_mount->m_rtdev_targp : (ip)->i_mount->m_ddev_targp)
403 int xfs_release(struct xfs_inode *ip);
404 void xfs_inactive(struct xfs_inode *ip);
415 struct xfs_inode *ip);
438 int xfs_log_force_inode(struct xfs_inode *ip);
440 #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) argument
446 xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
447 xfs_extlen_t xfs_get_cowextsz_hint(struct xfs_inode *ip);
457 struct xfs_inode *ip, in xfs_itruncate_extents() argument
461 return xfs_itruncate_extents_flags(tpp, ip, whichfork, new_size, 0); in xfs_itruncate_extents()
472 int xfs_update_prealloc_flags(struct xfs_inode *ip,
478 extern void xfs_setup_inode(struct xfs_inode *ip);
479 extern void xfs_setup_iops(struct xfs_inode *ip);
480 extern void xfs_diflags_to_iflags(struct xfs_inode *ip, bool init);
489 static inline void xfs_finish_inode_setup(struct xfs_inode *ip) in xfs_finish_inode_setup() argument
491 xfs_iflags_clear(ip, XFS_INEW); in xfs_finish_inode_setup()
493 unlock_new_inode(VFS_I(ip)); in xfs_finish_inode_setup()
496 static inline void xfs_setup_existing_inode(struct xfs_inode *ip) in xfs_setup_existing_inode() argument
498 xfs_setup_inode(ip); in xfs_setup_existing_inode()
499 xfs_setup_iops(ip); in xfs_setup_existing_inode()
500 xfs_finish_inode_setup(ip); in xfs_setup_existing_inode()
503 void xfs_irele(struct xfs_inode *ip);
510 bool xfs_inode_needs_inactive(struct xfs_inode *ip);