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