Lines Matching full:ip

29 	struct xfs_inode	*ip,  in xfs_flags2diflags()  argument
34 (ip->i_diflags & XFS_DIFLAG_PREALLOC); in xfs_flags2diflags()
50 if (S_ISDIR(VFS_I(ip)->i_mode)) { in xfs_flags2diflags()
59 } else if (S_ISREG(VFS_I(ip)->i_mode)) { in xfs_flags2diflags()
71 struct xfs_inode *ip, in xfs_flags2diflags2() argument
75 (ip->i_diflags2 & (XFS_DIFLAG2_REFLINK | in xfs_flags2diflags2()
89 struct xfs_inode *ip) in xfs_ip2xflags() argument
93 if (ip->i_diflags & XFS_DIFLAG_ANY) { in xfs_ip2xflags()
94 if (ip->i_diflags & XFS_DIFLAG_REALTIME) in xfs_ip2xflags()
96 if (ip->i_diflags & XFS_DIFLAG_PREALLOC) in xfs_ip2xflags()
98 if (ip->i_diflags & XFS_DIFLAG_IMMUTABLE) in xfs_ip2xflags()
100 if (ip->i_diflags & XFS_DIFLAG_APPEND) in xfs_ip2xflags()
102 if (ip->i_diflags & XFS_DIFLAG_SYNC) in xfs_ip2xflags()
104 if (ip->i_diflags & XFS_DIFLAG_NOATIME) in xfs_ip2xflags()
106 if (ip->i_diflags & XFS_DIFLAG_NODUMP) in xfs_ip2xflags()
108 if (ip->i_diflags & XFS_DIFLAG_RTINHERIT) in xfs_ip2xflags()
110 if (ip->i_diflags & XFS_DIFLAG_PROJINHERIT) in xfs_ip2xflags()
112 if (ip->i_diflags & XFS_DIFLAG_NOSYMLINKS) in xfs_ip2xflags()
114 if (ip->i_diflags & XFS_DIFLAG_EXTSIZE) in xfs_ip2xflags()
116 if (ip->i_diflags & XFS_DIFLAG_EXTSZINHERIT) in xfs_ip2xflags()
118 if (ip->i_diflags & XFS_DIFLAG_NODEFRAG) in xfs_ip2xflags()
120 if (ip->i_diflags & XFS_DIFLAG_FILESTREAM) in xfs_ip2xflags()
124 if (ip->i_diflags2 & XFS_DIFLAG2_ANY) { in xfs_ip2xflags()
125 if (ip->i_diflags2 & XFS_DIFLAG2_DAX) in xfs_ip2xflags()
127 if (ip->i_diflags2 & XFS_DIFLAG2_COWEXTSIZE) in xfs_ip2xflags()
131 if (xfs_inode_has_attr_fork(ip)) in xfs_ip2xflags()
149 struct xfs_inode *ip, in xfs_inode_inherit_flags() argument
154 umode_t mode = VFS_I(ip)->i_mode; in xfs_inode_inherit_flags()
161 ip->i_extsize = pip->i_extsize; in xfs_inode_inherit_flags()
167 xfs_has_realtime(ip->i_mount)) in xfs_inode_inherit_flags()
171 ip->i_extsize = pip->i_extsize; in xfs_inode_inherit_flags()
192 ip->i_diflags |= di_flags; in xfs_inode_inherit_flags()
204 failaddr = xfs_inode_validate_extsize(ip->i_mount, ip->i_extsize, in xfs_inode_inherit_flags()
205 VFS_I(ip)->i_mode, ip->i_diflags); in xfs_inode_inherit_flags()
207 ip->i_diflags &= ~(XFS_DIFLAG_EXTSIZE | in xfs_inode_inherit_flags()
209 ip->i_extsize = 0; in xfs_inode_inherit_flags()
216 struct xfs_inode *ip, in xfs_inode_inherit_flags2() argument
222 ip->i_diflags2 |= XFS_DIFLAG2_COWEXTSIZE; in xfs_inode_inherit_flags2()
223 ip->i_cowextsize = pip->i_cowextsize; in xfs_inode_inherit_flags2()
226 ip->i_diflags2 |= XFS_DIFLAG2_DAX; in xfs_inode_inherit_flags2()
228 ip->i_diflags2 |= XFS_DIFLAG2_METADATA; in xfs_inode_inherit_flags2()
231 failaddr = xfs_inode_validate_cowextsize(ip->i_mount, ip->i_cowextsize, in xfs_inode_inherit_flags2()
232 VFS_I(ip)->i_mode, ip->i_diflags, ip->i_diflags2); in xfs_inode_inherit_flags2()
234 ip->i_diflags2 &= ~XFS_DIFLAG2_COWEXTSIZE; in xfs_inode_inherit_flags2()
235 ip->i_cowextsize = 0; in xfs_inode_inherit_flags2()
269 struct xfs_inode *ip) in xfs_inode_init() argument
274 struct inode *inode = VFS_I(ip); in xfs_inode_init()
291 ip->i_projid = 0; in xfs_inode_init()
302 ip->i_projid = xfs_get_initial_prid(pip); in xfs_inode_init()
305 ip->i_disk_size = 0; in xfs_inode_init()
306 ip->i_df.if_nextents = 0; in xfs_inode_init()
307 ASSERT(ip->i_nblocks == 0); in xfs_inode_init()
309 ip->i_extsize = 0; in xfs_inode_init()
310 ip->i_diflags = 0; in xfs_inode_init()
315 ip->i_cowextsize = 0; in xfs_inode_init()
319 xfs_trans_ichgtime(tp, ip, times); in xfs_inode_init()
327 ip->i_df.if_format = XFS_DINODE_FMT_DEV; in xfs_inode_init()
333 xfs_inode_inherit_flags(ip, pip); in xfs_inode_init()
335 xfs_inode_inherit_flags2(ip, pip); in xfs_inode_init()
338 ip->i_df.if_format = XFS_DINODE_FMT_EXTENTS; in xfs_inode_init()
339 ip->i_df.if_bytes = 0; in xfs_inode_init()
340 ip->i_df.if_data = NULL; in xfs_inode_init()
347 ip->i_forkoff = xfs_default_attroffset(ip) >> 3; in xfs_inode_init()
348 xfs_ifork_init_attr(ip, XFS_DINODE_FMT_EXTENTS, 0); in xfs_inode_init()
358 xfs_trans_log_inode(tp, ip, flags); in xfs_inode_init()
404 struct xfs_inode *ip; in xfs_iunlink_update_backref() local
410 ip = xfs_iunlink_lookup(pag, next_agino); in xfs_iunlink_update_backref()
411 if (!ip) in xfs_iunlink_update_backref()
414 ip->i_prev_unlinked = prev_agino; in xfs_iunlink_update_backref()
463 struct xfs_inode *ip) in xfs_iunlink_insert_inode() argument
468 xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino); in xfs_iunlink_insert_inode()
500 error = xfs_iunlink_log_inode(tp, ip, pag, next_agino); in xfs_iunlink_insert_inode()
503 ip->i_next_unlinked = next_agino; in xfs_iunlink_insert_inode()
507 ip->i_prev_unlinked = NULLAGINO; in xfs_iunlink_insert_inode()
513 * a tmpfile via O_TMPFILE. The inode @ip must have nlink == 0.
521 struct xfs_inode *ip) in xfs_iunlink() argument
528 ASSERT(VFS_I(ip)->i_nlink == 0); in xfs_iunlink()
529 ASSERT(VFS_I(ip)->i_mode != 0); in xfs_iunlink()
530 trace_xfs_iunlink(ip); in xfs_iunlink()
532 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_iunlink()
539 error = xfs_iunlink_insert_inode(tp, pag, agibp, ip); in xfs_iunlink()
550 struct xfs_inode *ip) in xfs_iunlink_remove_inode() argument
554 xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino); in xfs_iunlink_remove_inode()
559 trace_xfs_iunlink_remove(ip); in xfs_iunlink_remove_inode()
578 error = xfs_iunlink_log_inode(tp, ip, pag, NULLAGINO); in xfs_iunlink_remove_inode()
586 error = xfs_iunlink_update_backref(pag, ip->i_prev_unlinked, in xfs_iunlink_remove_inode()
587 ip->i_next_unlinked); in xfs_iunlink_remove_inode()
589 error = xfs_iunlink_reload_next(tp, agibp, ip->i_prev_unlinked, in xfs_iunlink_remove_inode()
590 ip->i_next_unlinked); in xfs_iunlink_remove_inode()
597 prev_ip = xfs_iunlink_lookup(pag, ip->i_prev_unlinked); in xfs_iunlink_remove_inode()
599 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iunlink_remove_inode()
604 ip->i_next_unlinked); in xfs_iunlink_remove_inode()
605 prev_ip->i_next_unlinked = ip->i_next_unlinked; in xfs_iunlink_remove_inode()
609 ip->i_next_unlinked); in xfs_iunlink_remove_inode()
612 ip->i_next_unlinked = NULLAGINO; in xfs_iunlink_remove_inode()
613 ip->i_prev_unlinked = 0; in xfs_iunlink_remove_inode()
624 struct xfs_inode *ip) in xfs_iunlink_remove() argument
629 trace_xfs_iunlink_remove(ip); in xfs_iunlink_remove()
636 return xfs_iunlink_remove_inode(tp, pag, agibp, ip); in xfs_iunlink_remove()
647 struct xfs_inode *ip) in xfs_droplink() argument
649 struct inode *inode = VFS_I(ip); in xfs_droplink()
651 xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); in xfs_droplink()
656 ip->i_ino); in xfs_droplink()
662 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_droplink()
667 return xfs_iunlink(tp, ip); in xfs_droplink()
676 struct xfs_inode *ip) in xfs_bumplink() argument
678 struct inode *inode = VFS_I(ip); in xfs_bumplink()
680 xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); in xfs_bumplink()
685 ip->i_ino); in xfs_bumplink()
689 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_bumplink()
697 struct xfs_inode *ip, in xfs_inode_uninit() argument
700 struct xfs_mount *mp = ip->i_mount; in xfs_inode_uninit()
709 error = xfs_difree(tp, pag, ip->i_ino, xic); in xfs_inode_uninit()
713 error = xfs_iunlink_remove(tp, pag, ip); in xfs_inode_uninit()
722 if (ip->i_df.if_format == XFS_DINODE_FMT_LOCAL) { in xfs_inode_uninit()
723 kfree(ip->i_df.if_data); in xfs_inode_uninit()
724 ip->i_df.if_data = NULL; in xfs_inode_uninit()
725 ip->i_df.if_bytes = 0; in xfs_inode_uninit()
728 VFS_I(ip)->i_mode = 0; /* mark incore inode as free */ in xfs_inode_uninit()
729 ip->i_diflags = 0; in xfs_inode_uninit()
730 ip->i_diflags2 = mp->m_ino_geo.new_diflags2; in xfs_inode_uninit()
731 ip->i_forkoff = 0; /* mark the attr fork not in use */ in xfs_inode_uninit()
732 ip->i_df.if_format = XFS_DINODE_FMT_EXTENTS; in xfs_inode_uninit()
738 VFS_I(ip)->i_generation++; in xfs_inode_uninit()
739 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_inode_uninit()