Lines Matching refs:ip

84 static inline bool xfs_inode_has_attr_fork(struct xfs_inode *ip)  in xfs_inode_has_attr_fork()  argument
86 return ip->i_forkoff > 0; in xfs_inode_has_attr_fork()
91 struct xfs_inode *ip, in xfs_ifork_ptr() argument
96 return &ip->i_df; in xfs_ifork_ptr()
98 if (!xfs_inode_has_attr_fork(ip)) in xfs_ifork_ptr()
100 return &ip->i_af; in xfs_ifork_ptr()
102 return ip->i_cowfp; in xfs_ifork_ptr()
109 static inline unsigned int xfs_inode_fork_boff(struct xfs_inode *ip) in xfs_inode_fork_boff() argument
111 return ip->i_forkoff << 3; in xfs_inode_fork_boff()
114 static inline unsigned int xfs_inode_data_fork_size(struct xfs_inode *ip) in xfs_inode_data_fork_size() argument
116 if (xfs_inode_has_attr_fork(ip)) in xfs_inode_data_fork_size()
117 return xfs_inode_fork_boff(ip); in xfs_inode_data_fork_size()
119 return XFS_LITINO(ip->i_mount); in xfs_inode_data_fork_size()
122 static inline unsigned int xfs_inode_attr_fork_size(struct xfs_inode *ip) in xfs_inode_attr_fork_size() argument
124 if (xfs_inode_has_attr_fork(ip)) in xfs_inode_attr_fork_size()
125 return XFS_LITINO(ip->i_mount) - xfs_inode_fork_boff(ip); in xfs_inode_attr_fork_size()
131 struct xfs_inode *ip, in xfs_inode_fork_size() argument
136 return xfs_inode_data_fork_size(ip); in xfs_inode_fork_size()
138 return xfs_inode_attr_fork_size(ip); in xfs_inode_fork_size()
151 static inline struct inode *VFS_I(struct xfs_inode *ip) in VFS_I() argument
153 return &ip->i_vnode; in VFS_I()
161 static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) in XFS_ISIZE() argument
163 if (S_ISREG(VFS_I(ip)->i_mode)) in XFS_ISIZE()
164 return i_size_read(VFS_I(ip)); in XFS_ISIZE()
165 return ip->i_disk_size; in XFS_ISIZE()
173 xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size) in xfs_new_eof() argument
175 xfs_fsize_t i_size = i_size_read(VFS_I(ip)); in xfs_new_eof()
179 return new_size > ip->i_disk_size ? new_size : 0; in xfs_new_eof()
186 __xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_set() argument
188 ip->i_flags |= flags; in __xfs_iflags_set()
192 xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_set() argument
194 spin_lock(&ip->i_flags_lock); in xfs_iflags_set()
195 __xfs_iflags_set(ip, flags); in xfs_iflags_set()
196 spin_unlock(&ip->i_flags_lock); in xfs_iflags_set()
200 xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_clear() argument
202 spin_lock(&ip->i_flags_lock); in xfs_iflags_clear()
203 ip->i_flags &= ~flags; in xfs_iflags_clear()
204 spin_unlock(&ip->i_flags_lock); in xfs_iflags_clear()
208 __xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_test() argument
210 return (ip->i_flags & flags); in __xfs_iflags_test()
214 xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test() argument
217 spin_lock(&ip->i_flags_lock); in xfs_iflags_test()
218 ret = __xfs_iflags_test(ip, flags); in xfs_iflags_test()
219 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test()
224 xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_clear() argument
228 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
229 ret = ip->i_flags & flags; in xfs_iflags_test_and_clear()
231 ip->i_flags &= ~flags; in xfs_iflags_test_and_clear()
232 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
237 xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_set() argument
241 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
242 ret = ip->i_flags & flags; in xfs_iflags_test_and_set()
244 ip->i_flags |= flags; in xfs_iflags_test_and_set()
245 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
258 static inline bool xfs_is_reflink_inode(struct xfs_inode *ip) in xfs_is_reflink_inode() argument
260 return ip->i_diflags2 & XFS_DIFLAG2_REFLINK; in xfs_is_reflink_inode()
263 static inline bool xfs_is_metadata_inode(struct xfs_inode *ip) in xfs_is_metadata_inode() argument
265 struct xfs_mount *mp = ip->i_mount; in xfs_is_metadata_inode()
267 return ip == mp->m_rbmip || ip == mp->m_rsumip || in xfs_is_metadata_inode()
268 xfs_is_quota_inode(&mp->m_sb, ip->i_ino); in xfs_is_metadata_inode()
275 static inline bool xfs_inode_has_cow_data(struct xfs_inode *ip) in xfs_inode_has_cow_data() argument
277 return ip->i_cowfp && ip->i_cowfp->if_bytes; in xfs_inode_has_cow_data()
280 static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip) in xfs_inode_has_bigtime() argument
282 return ip->i_diflags2 & XFS_DIFLAG2_BIGTIME; in xfs_inode_has_bigtime()
285 static inline bool xfs_inode_has_large_extent_counts(struct xfs_inode *ip) in xfs_inode_has_large_extent_counts() argument
287 return ip->i_diflags2 & XFS_DIFLAG2_NREXT64; in xfs_inode_has_large_extent_counts()
293 #define xfs_inode_buftarg(ip) \ argument
294 (XFS_IS_REALTIME_INODE(ip) ? \
295 (ip)->i_mount->m_rtdev_targp : (ip)->i_mount->m_ddev_targp)
472 int xfs_release(struct xfs_inode *ip);
473 void xfs_inactive(struct xfs_inode *ip);
484 struct xfs_inode *ip);
507 int xfs_log_force_inode(struct xfs_inode *ip);
509 #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) argument
515 xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
516 xfs_extlen_t xfs_get_cowextsz_hint(struct xfs_inode *ip);
526 struct xfs_inode *ip, in xfs_itruncate_extents() argument
530 return xfs_itruncate_extents_flags(tpp, ip, whichfork, new_size, 0); in xfs_itruncate_extents()
539 extern void xfs_setup_inode(struct xfs_inode *ip);
540 extern void xfs_setup_iops(struct xfs_inode *ip);
541 extern void xfs_diflags_to_iflags(struct xfs_inode *ip, bool init);
550 static inline void xfs_finish_inode_setup(struct xfs_inode *ip) in xfs_finish_inode_setup() argument
552 xfs_iflags_clear(ip, XFS_INEW); in xfs_finish_inode_setup()
554 unlock_new_inode(VFS_I(ip)); in xfs_finish_inode_setup()
557 static inline void xfs_setup_existing_inode(struct xfs_inode *ip) in xfs_setup_existing_inode() argument
559 xfs_setup_inode(ip); in xfs_setup_existing_inode()
560 xfs_setup_iops(ip); in xfs_setup_existing_inode()
561 xfs_finish_inode_setup(ip); in xfs_setup_existing_inode()
564 void xfs_irele(struct xfs_inode *ip);
571 bool xfs_inode_needs_inactive(struct xfs_inode *ip);