Lines Matching full:ip
104 static inline bool xfs_inode_on_unlinked_list(const struct xfs_inode *ip) in xfs_inode_on_unlinked_list() argument
106 return ip->i_prev_unlinked != 0; in xfs_inode_on_unlinked_list()
109 static inline bool xfs_inode_has_attr_fork(const struct xfs_inode *ip) in xfs_inode_has_attr_fork() argument
111 return ip->i_forkoff > 0; in xfs_inode_has_attr_fork()
116 struct xfs_inode *ip, in xfs_ifork_ptr() argument
121 return &ip->i_df; in xfs_ifork_ptr()
123 if (!xfs_inode_has_attr_fork(ip)) in xfs_ifork_ptr()
125 return &ip->i_af; in xfs_ifork_ptr()
127 return ip->i_cowfp; in xfs_ifork_ptr()
134 static inline unsigned int xfs_inode_fork_boff(struct xfs_inode *ip) in xfs_inode_fork_boff() argument
136 return ip->i_forkoff << 3; in xfs_inode_fork_boff()
139 static inline unsigned int xfs_inode_data_fork_size(struct xfs_inode *ip) in xfs_inode_data_fork_size() argument
141 if (xfs_inode_has_attr_fork(ip)) in xfs_inode_data_fork_size()
142 return xfs_inode_fork_boff(ip); in xfs_inode_data_fork_size()
144 return XFS_LITINO(ip->i_mount); in xfs_inode_data_fork_size()
147 static inline unsigned int xfs_inode_attr_fork_size(struct xfs_inode *ip) in xfs_inode_attr_fork_size() argument
149 if (xfs_inode_has_attr_fork(ip)) in xfs_inode_attr_fork_size()
150 return XFS_LITINO(ip->i_mount) - xfs_inode_fork_boff(ip); in xfs_inode_attr_fork_size()
156 struct xfs_inode *ip, in xfs_inode_fork_size() argument
161 return xfs_inode_data_fork_size(ip); in xfs_inode_fork_size()
163 return xfs_inode_attr_fork_size(ip); in xfs_inode_fork_size()
176 static inline struct inode *VFS_I(struct xfs_inode *ip) in VFS_I() argument
178 return &ip->i_vnode; in VFS_I()
182 static inline const struct inode *VFS_IC(const struct xfs_inode *ip) in VFS_IC() argument
184 return &ip->i_vnode; in VFS_IC()
192 static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip) in XFS_ISIZE() argument
194 if (S_ISREG(VFS_I(ip)->i_mode)) in XFS_ISIZE()
195 return i_size_read(VFS_I(ip)); in XFS_ISIZE()
196 return ip->i_disk_size; in XFS_ISIZE()
204 xfs_new_eof(struct xfs_inode *ip, xfs_fsize_t new_size) in xfs_new_eof() argument
206 xfs_fsize_t i_size = i_size_read(VFS_I(ip)); in xfs_new_eof()
210 return new_size > ip->i_disk_size ? new_size : 0; in xfs_new_eof()
217 __xfs_iflags_set(xfs_inode_t *ip, unsigned long flags) in __xfs_iflags_set() argument
219 ip->i_flags |= flags; in __xfs_iflags_set()
223 xfs_iflags_set(xfs_inode_t *ip, unsigned long flags) in xfs_iflags_set() argument
225 spin_lock(&ip->i_flags_lock); in xfs_iflags_set()
226 __xfs_iflags_set(ip, flags); in xfs_iflags_set()
227 spin_unlock(&ip->i_flags_lock); in xfs_iflags_set()
231 xfs_iflags_clear(xfs_inode_t *ip, unsigned long flags) in xfs_iflags_clear() argument
233 spin_lock(&ip->i_flags_lock); in xfs_iflags_clear()
234 ip->i_flags &= ~flags; in xfs_iflags_clear()
235 spin_unlock(&ip->i_flags_lock); in xfs_iflags_clear()
239 __xfs_iflags_test(const struct xfs_inode *ip, unsigned long flags) in __xfs_iflags_test() argument
241 return (ip->i_flags & flags); in __xfs_iflags_test()
245 xfs_iflags_test(xfs_inode_t *ip, unsigned long flags) in xfs_iflags_test() argument
248 spin_lock(&ip->i_flags_lock); in xfs_iflags_test()
249 ret = __xfs_iflags_test(ip, flags); in xfs_iflags_test()
250 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test()
255 xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned long flags) in xfs_iflags_test_and_clear() argument
259 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
260 ret = ip->i_flags & flags; in xfs_iflags_test_and_clear()
262 ip->i_flags &= ~flags; in xfs_iflags_test_and_clear()
263 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_clear()
268 xfs_iflags_test_and_set(xfs_inode_t *ip, unsigned long flags) in xfs_iflags_test_and_set() argument
272 spin_lock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
273 ret = ip->i_flags & flags; in xfs_iflags_test_and_set()
275 ip->i_flags |= flags; in xfs_iflags_test_and_set()
276 spin_unlock(&ip->i_flags_lock); in xfs_iflags_test_and_set()
280 static inline bool xfs_is_reflink_inode(const struct xfs_inode *ip) in xfs_is_reflink_inode() argument
282 return ip->i_diflags2 & XFS_DIFLAG2_REFLINK; in xfs_is_reflink_inode()
285 static inline bool xfs_is_metadir_inode(const struct xfs_inode *ip) in xfs_is_metadir_inode() argument
287 return ip->i_diflags2 & XFS_DIFLAG2_METADATA; in xfs_is_metadir_inode()
290 static inline bool xfs_is_internal_inode(const struct xfs_inode *ip) in xfs_is_internal_inode() argument
292 struct xfs_mount *mp = ip->i_mount; in xfs_is_internal_inode()
296 return xfs_is_metadir_inode(ip); in xfs_is_internal_inode()
302 return ip->i_ino == mp->m_sb.sb_rbmino || in xfs_is_internal_inode()
303 ip->i_ino == mp->m_sb.sb_rsumino || in xfs_is_internal_inode()
304 xfs_is_quota_inode(&mp->m_sb, ip->i_ino); in xfs_is_internal_inode()
307 static inline bool xfs_is_zoned_inode(const struct xfs_inode *ip) in xfs_is_zoned_inode() argument
309 return xfs_has_zoned(ip->i_mount) && XFS_IS_REALTIME_INODE(ip); in xfs_is_zoned_inode()
312 bool xfs_is_always_cow_inode(const struct xfs_inode *ip);
314 static inline bool xfs_is_cow_inode(const struct xfs_inode *ip) in xfs_is_cow_inode() argument
316 return xfs_is_reflink_inode(ip) || xfs_is_always_cow_inode(ip); in xfs_is_cow_inode()
319 static inline bool xfs_inode_has_filedata(const struct xfs_inode *ip) in xfs_inode_has_filedata() argument
321 return ip->i_df.if_nextents > 0 || ip->i_delayed_blks > 0; in xfs_inode_has_filedata()
328 static inline bool xfs_inode_has_cow_data(const struct xfs_inode *ip) in xfs_inode_has_cow_data() argument
330 return ip->i_cowfp && ip->i_cowfp->if_bytes; in xfs_inode_has_cow_data()
333 static inline bool xfs_inode_has_bigtime(const struct xfs_inode *ip) in xfs_inode_has_bigtime() argument
335 return ip->i_diflags2 & XFS_DIFLAG2_BIGTIME; in xfs_inode_has_bigtime()
338 static inline bool xfs_inode_has_large_extent_counts(const struct xfs_inode *ip) in xfs_inode_has_large_extent_counts() argument
340 return ip->i_diflags2 & XFS_DIFLAG2_NREXT64; in xfs_inode_has_large_extent_counts()
347 static inline bool xfs_inode_has_bigrtalloc(const struct xfs_inode *ip) in xfs_inode_has_bigrtalloc() argument
349 return XFS_IS_REALTIME_INODE(ip) && ip->i_mount->m_sb.sb_rextsize > 1; in xfs_inode_has_bigrtalloc()
355 #define xfs_inode_buftarg(ip) \ argument
356 (XFS_IS_REALTIME_INODE(ip) ? \
357 (ip)->i_mount->m_rtdev_targp : (ip)->i_mount->m_ddev_targp)
361 struct xfs_inode *ip) in xfs_inode_can_atomicwrite() argument
363 struct xfs_mount *mp = ip->i_mount; in xfs_inode_can_atomicwrite()
364 struct xfs_buftarg *target = xfs_inode_buftarg(ip); in xfs_inode_can_atomicwrite()
555 int xfs_inactive(struct xfs_inode *ip);
563 struct xfs_inode *ip);
585 int xfs_log_force_inode(struct xfs_inode *ip);
587 #define xfs_ipincount(ip) ((unsigned int) atomic_read(&ip->i_pincount)) argument
599 struct xfs_inode *ip, in xfs_itruncate_extents() argument
603 return xfs_itruncate_extents_flags(tpp, ip, whichfork, new_size, 0); in xfs_itruncate_extents()
610 static inline void xfs_update_stable_writes(struct xfs_inode *ip) in xfs_update_stable_writes() argument
612 if (bdev_stable_writes(xfs_inode_buftarg(ip)->bt_bdev)) in xfs_update_stable_writes()
613 mapping_set_stable_writes(VFS_I(ip)->i_mapping); in xfs_update_stable_writes()
615 mapping_clear_stable_writes(VFS_I(ip)->i_mapping); in xfs_update_stable_writes()
625 static inline void xfs_finish_inode_setup(struct xfs_inode *ip) in xfs_finish_inode_setup() argument
627 xfs_iflags_clear(ip, XFS_INEW); in xfs_finish_inode_setup()
629 unlock_new_inode(VFS_I(ip)); in xfs_finish_inode_setup()
632 static inline void xfs_setup_existing_inode(struct xfs_inode *ip) in xfs_setup_existing_inode() argument
634 xfs_setup_inode(ip); in xfs_setup_existing_inode()
635 xfs_setup_iops(ip); in xfs_setup_existing_inode()
636 xfs_finish_inode_setup(ip); in xfs_setup_existing_inode()
639 void xfs_irele(struct xfs_inode *ip);
646 bool xfs_inode_needs_inactive(struct xfs_inode *ip);
662 const struct xfs_inode *ip) in xfs_inode_unlinked_incomplete() argument
664 return VFS_IC(ip)->i_nlink == 0 && !xfs_inode_on_unlinked_list(ip); in xfs_inode_unlinked_incomplete()
666 int xfs_inode_reload_unlinked_bucket(struct xfs_trans *tp, struct xfs_inode *ip);
667 int xfs_inode_reload_unlinked(struct xfs_inode *ip);
669 bool xfs_ifork_zapped(const struct xfs_inode *ip, int whichfork);
670 void xfs_inode_count_blocks(struct xfs_trans *tp, struct xfs_inode *ip,
672 unsigned int xfs_inode_alloc_unitsize(struct xfs_inode *ip);