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()
229 failaddr = xfs_inode_validate_cowextsize(ip->i_mount, ip->i_cowextsize, in xfs_inode_inherit_flags2()
230 VFS_I(ip)->i_mode, ip->i_diflags, ip->i_diflags2); in xfs_inode_inherit_flags2()
232 ip->i_diflags2 &= ~XFS_DIFLAG2_COWEXTSIZE; in xfs_inode_inherit_flags2()
233 ip->i_cowextsize = 0; in xfs_inode_inherit_flags2()
267 struct xfs_inode *ip) in xfs_inode_init() argument
272 struct inode *inode = VFS_I(ip); in xfs_inode_init()
289 ip->i_projid = 0; in xfs_inode_init()
311 ip->i_projid = xfs_get_initial_prid(pip); in xfs_inode_init()
314 ip->i_disk_size = 0; in xfs_inode_init()
315 ip->i_df.if_nextents = 0; in xfs_inode_init()
316 ASSERT(ip->i_nblocks == 0); in xfs_inode_init()
318 ip->i_extsize = 0; in xfs_inode_init()
319 ip->i_diflags = 0; in xfs_inode_init()
323 ip->i_cowextsize = 0; in xfs_inode_init()
327 xfs_trans_ichgtime(tp, ip, times); in xfs_inode_init()
335 ip->i_df.if_format = XFS_DINODE_FMT_DEV; in xfs_inode_init()
341 xfs_inode_inherit_flags(ip, pip); in xfs_inode_init()
343 xfs_inode_inherit_flags2(ip, pip); in xfs_inode_init()
346 ip->i_df.if_format = XFS_DINODE_FMT_EXTENTS; in xfs_inode_init()
347 ip->i_df.if_bytes = 0; in xfs_inode_init()
348 ip->i_df.if_data = NULL; in xfs_inode_init()
355 ip->i_forkoff = xfs_default_attroffset(ip) >> 3; in xfs_inode_init()
356 xfs_ifork_init_attr(ip, XFS_DINODE_FMT_EXTENTS, 0); in xfs_inode_init()
366 xfs_trans_log_inode(tp, ip, flags); in xfs_inode_init()
412 struct xfs_inode *ip; in xfs_iunlink_update_backref() local
418 ip = xfs_iunlink_lookup(pag, next_agino); in xfs_iunlink_update_backref()
419 if (!ip) in xfs_iunlink_update_backref()
422 ip->i_prev_unlinked = prev_agino; in xfs_iunlink_update_backref()
471 struct xfs_inode *ip) in xfs_iunlink_insert_inode() argument
476 xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino); in xfs_iunlink_insert_inode()
508 error = xfs_iunlink_log_inode(tp, ip, pag, next_agino); in xfs_iunlink_insert_inode()
511 ip->i_next_unlinked = next_agino; in xfs_iunlink_insert_inode()
515 ip->i_prev_unlinked = NULLAGINO; in xfs_iunlink_insert_inode()
521 * a tmpfile via O_TMPFILE. The inode @ip must have nlink == 0.
529 struct xfs_inode *ip) in xfs_iunlink() argument
536 ASSERT(VFS_I(ip)->i_nlink == 0); in xfs_iunlink()
537 ASSERT(VFS_I(ip)->i_mode != 0); in xfs_iunlink()
538 trace_xfs_iunlink(ip); in xfs_iunlink()
540 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_iunlink()
547 error = xfs_iunlink_insert_inode(tp, pag, agibp, ip); in xfs_iunlink()
558 struct xfs_inode *ip) in xfs_iunlink_remove_inode() argument
562 xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino); in xfs_iunlink_remove_inode()
567 trace_xfs_iunlink_remove(ip); in xfs_iunlink_remove_inode()
586 error = xfs_iunlink_log_inode(tp, ip, pag, NULLAGINO); in xfs_iunlink_remove_inode()
594 error = xfs_iunlink_update_backref(pag, ip->i_prev_unlinked, in xfs_iunlink_remove_inode()
595 ip->i_next_unlinked); in xfs_iunlink_remove_inode()
597 error = xfs_iunlink_reload_next(tp, agibp, ip->i_prev_unlinked, in xfs_iunlink_remove_inode()
598 ip->i_next_unlinked); in xfs_iunlink_remove_inode()
605 prev_ip = xfs_iunlink_lookup(pag, ip->i_prev_unlinked); in xfs_iunlink_remove_inode()
607 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iunlink_remove_inode()
612 ip->i_next_unlinked); in xfs_iunlink_remove_inode()
613 prev_ip->i_next_unlinked = ip->i_next_unlinked; in xfs_iunlink_remove_inode()
617 ip->i_next_unlinked); in xfs_iunlink_remove_inode()
620 ip->i_next_unlinked = NULLAGINO; in xfs_iunlink_remove_inode()
621 ip->i_prev_unlinked = 0; in xfs_iunlink_remove_inode()
632 struct xfs_inode *ip) in xfs_iunlink_remove() argument
637 trace_xfs_iunlink_remove(ip); in xfs_iunlink_remove()
644 return xfs_iunlink_remove_inode(tp, pag, agibp, ip); in xfs_iunlink_remove()
655 struct xfs_inode *ip) in xfs_droplink() argument
657 struct inode *inode = VFS_I(ip); in xfs_droplink()
659 xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); in xfs_droplink()
664 ip->i_ino); in xfs_droplink()
670 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_droplink()
675 return xfs_iunlink(tp, ip); in xfs_droplink()
684 struct xfs_inode *ip) in xfs_bumplink() argument
686 struct inode *inode = VFS_I(ip); in xfs_bumplink()
688 xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); in xfs_bumplink()
693 ip->i_ino); in xfs_bumplink()
697 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_bumplink()
705 struct xfs_inode *ip, in xfs_inode_uninit() argument
708 struct xfs_mount *mp = ip->i_mount; in xfs_inode_uninit()
717 error = xfs_difree(tp, pag, ip->i_ino, xic); in xfs_inode_uninit()
721 error = xfs_iunlink_remove(tp, pag, ip); in xfs_inode_uninit()
730 if (ip->i_df.if_format == XFS_DINODE_FMT_LOCAL) { in xfs_inode_uninit()
731 kfree(ip->i_df.if_data); in xfs_inode_uninit()
732 ip->i_df.if_data = NULL; in xfs_inode_uninit()
733 ip->i_df.if_bytes = 0; in xfs_inode_uninit()
736 VFS_I(ip)->i_mode = 0; /* mark incore inode as free */ in xfs_inode_uninit()
737 ip->i_diflags = 0; in xfs_inode_uninit()
738 ip->i_diflags2 = mp->m_ino_geo.new_diflags2; in xfs_inode_uninit()
739 ip->i_forkoff = 0; /* mark the attr fork not in use */ in xfs_inode_uninit()
740 ip->i_df.if_format = XFS_DINODE_FMT_EXTENTS; in xfs_inode_uninit()
746 VFS_I(ip)->i_generation++; in xfs_inode_uninit()
747 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_inode_uninit()