Lines Matching refs:ip
97 static inline bool xfs_inode_on_unlinked_list(const struct xfs_inode *ip) in xfs_inode_on_unlinked_list() argument
99 return ip->i_prev_unlinked != 0; in xfs_inode_on_unlinked_list()
102 static inline bool xfs_inode_has_attr_fork(struct xfs_inode *ip) in xfs_inode_has_attr_fork() argument
104 return ip->i_forkoff > 0; in xfs_inode_has_attr_fork()
109 struct xfs_inode *ip, in xfs_ifork_ptr() argument
114 return &ip->i_df; in xfs_ifork_ptr()
116 if (!xfs_inode_has_attr_fork(ip)) in xfs_ifork_ptr()
118 return &ip->i_af; in xfs_ifork_ptr()
120 return ip->i_cowfp; in xfs_ifork_ptr()
127 static inline unsigned int xfs_inode_fork_boff(struct xfs_inode *ip) in xfs_inode_fork_boff() argument
129 return ip->i_forkoff << 3; in xfs_inode_fork_boff()
132 static inline unsigned int xfs_inode_data_fork_size(struct xfs_inode *ip) in xfs_inode_data_fork_size() argument
134 if (xfs_inode_has_attr_fork(ip)) in xfs_inode_data_fork_size()
135 return xfs_inode_fork_boff(ip); in xfs_inode_data_fork_size()
137 return XFS_LITINO(ip->i_mount); in xfs_inode_data_fork_size()
140 static inline unsigned int xfs_inode_attr_fork_size(struct xfs_inode *ip) in xfs_inode_attr_fork_size() argument
142 if (xfs_inode_has_attr_fork(ip)) in xfs_inode_attr_fork_size()
143 return XFS_LITINO(ip->i_mount) - xfs_inode_fork_boff(ip); in xfs_inode_attr_fork_size()
149 struct xfs_inode *ip, in xfs_inode_fork_size() argument
154 return xfs_inode_data_fork_size(ip); in xfs_inode_fork_size()
156 return xfs_inode_attr_fork_size(ip); in xfs_inode_fork_size()
169 static inline struct inode *VFS_I(struct xfs_inode *ip) in VFS_I() argument
171 return &ip->i_vnode; in VFS_I()
179 static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) in XFS_ISIZE() argument
181 if (S_ISREG(VFS_I(ip)->i_mode)) in XFS_ISIZE()
182 return i_size_read(VFS_I(ip)); in XFS_ISIZE()
183 return ip->i_disk_size; in XFS_ISIZE()
191 xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size) in xfs_new_eof() argument
193 xfs_fsize_t i_size = i_size_read(VFS_I(ip)); in xfs_new_eof()
197 return new_size > ip->i_disk_size ? new_size : 0; in xfs_new_eof()
204 __xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_set() argument
206 ip->i_flags |= flags; in __xfs_iflags_set()
210 xfs_iflags_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_set() argument
212 spin_lock(&ip->i_flags_lock); in xfs_iflags_set()
213 __xfs_iflags_set(ip, flags); in xfs_iflags_set()
214 spin_unlock(&ip->i_flags_lock); in xfs_iflags_set()
218 xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_clear() argument
220 spin_lock(&ip->i_flags_lock); in xfs_iflags_clear()
221 ip->i_flags &= ~flags; in xfs_iflags_clear()
222 spin_unlock(&ip->i_flags_lock); in xfs_iflags_clear()
226 __xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in __xfs_iflags_test() argument
228 return (ip->i_flags & flags); in __xfs_iflags_test()
232 xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test() argument
235 spin_lock(&ip->i_flags_lock); in xfs_iflags_test()
236 ret = __xfs_iflags_test(ip, flags); in xfs_iflags_test()
237 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test()
242 xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_clear() argument
246 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
247 ret = ip->i_flags & flags; in xfs_iflags_test_and_clear()
249 ip->i_flags &= ~flags; in xfs_iflags_test_and_clear()
250 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
255 xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned short flags) in xfs_iflags_test_and_set() argument
259 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
260 ret = ip->i_flags & flags; in xfs_iflags_test_and_set()
262 ip->i_flags |= flags; in xfs_iflags_test_and_set()
263 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
276 static inline bool xfs_is_reflink_inode(struct xfs_inode *ip) in xfs_is_reflink_inode() argument
278 return ip->i_diflags2 & XFS_DIFLAG2_REFLINK; in xfs_is_reflink_inode()
281 static inline bool xfs_is_metadata_inode(struct xfs_inode *ip) in xfs_is_metadata_inode() argument
283 struct xfs_mount *mp = ip->i_mount; in xfs_is_metadata_inode()
285 return ip == mp->m_rbmip || ip == mp->m_rsumip || in xfs_is_metadata_inode()
286 xfs_is_quota_inode(&mp->m_sb, ip->i_ino); in xfs_is_metadata_inode()
293 static inline bool xfs_inode_has_cow_data(struct xfs_inode *ip) in xfs_inode_has_cow_data() argument
295 return ip->i_cowfp && ip->i_cowfp->if_bytes; in xfs_inode_has_cow_data()
298 static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip) in xfs_inode_has_bigtime() argument
300 return ip->i_diflags2 & XFS_DIFLAG2_BIGTIME; in xfs_inode_has_bigtime()
303 static inline bool xfs_inode_has_large_extent_counts(struct xfs_inode *ip) in xfs_inode_has_large_extent_counts() argument
305 return ip->i_diflags2 & XFS_DIFLAG2_NREXT64; in xfs_inode_has_large_extent_counts()
311 #define xfs_inode_buftarg(ip) \ argument
312 (XFS_IS_REALTIME_INODE(ip) ? \
313 (ip)->i_mount->m_rtdev_targp : (ip)->i_mount->m_ddev_targp)
501 int xfs_release(struct xfs_inode *ip);
502 int xfs_inactive(struct xfs_inode *ip);
513 struct xfs_inode *ip);
536 int xfs_log_force_inode(struct xfs_inode *ip);
538 #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) argument
544 xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
545 xfs_extlen_t xfs_get_cowextsz_hint(struct xfs_inode *ip);
555 struct xfs_inode *ip, in xfs_itruncate_extents() argument
559 return xfs_itruncate_extents_flags(tpp, ip, whichfork, new_size, 0); in xfs_itruncate_extents()
568 extern void xfs_setup_inode(struct xfs_inode *ip);
569 extern void xfs_setup_iops(struct xfs_inode *ip);
570 extern void xfs_diflags_to_iflags(struct xfs_inode *ip, bool init);
572 static inline void xfs_update_stable_writes(struct xfs_inode *ip) in xfs_update_stable_writes() argument
574 if (bdev_stable_writes(xfs_inode_buftarg(ip)->bt_bdev)) in xfs_update_stable_writes()
575 mapping_set_stable_writes(VFS_I(ip)->i_mapping); in xfs_update_stable_writes()
577 mapping_clear_stable_writes(VFS_I(ip)->i_mapping); in xfs_update_stable_writes()
587 static inline void xfs_finish_inode_setup(struct xfs_inode *ip) in xfs_finish_inode_setup() argument
589 xfs_iflags_clear(ip, XFS_INEW); in xfs_finish_inode_setup()
591 unlock_new_inode(VFS_I(ip)); in xfs_finish_inode_setup()
594 static inline void xfs_setup_existing_inode(struct xfs_inode *ip) in xfs_setup_existing_inode() argument
596 xfs_setup_inode(ip); in xfs_setup_existing_inode()
597 xfs_setup_iops(ip); in xfs_setup_existing_inode()
598 xfs_finish_inode_setup(ip); in xfs_setup_existing_inode()
601 void xfs_irele(struct xfs_inode *ip);
608 bool xfs_inode_needs_inactive(struct xfs_inode *ip);
618 struct xfs_inode *ip) in xfs_inode_unlinked_incomplete() argument
620 return VFS_I(ip)->i_nlink == 0 && !xfs_inode_on_unlinked_list(ip); in xfs_inode_unlinked_incomplete()
622 int xfs_inode_reload_unlinked_bucket(struct xfs_trans *tp, struct xfs_inode *ip);
623 int xfs_inode_reload_unlinked(struct xfs_inode *ip);