Lines Matching refs:ip
58 struct xfs_inode *ip = XFS_I(inode); in xfs_initxattrs() local
62 error = xfs_attr_set(ip, xattr->name, xattr->value, in xfs_initxattrs()
123 struct xfs_inode *ip = NULL; in xfs_vn_mknod() local
150 error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip); in xfs_vn_mknod()
154 inode = VFS_I(ip); in xfs_vn_mknod()
228 struct xfs_inode *ip; in xfs_vn_ci_lookup() local
238 error = xfs_lookup(XFS_I(dir), &xname, &ip, &ci_name); in xfs_vn_ci_lookup()
252 return d_splice_alias(VFS_I(ip), dentry); in xfs_vn_ci_lookup()
257 dentry = d_add_ci(dentry, VFS_I(ip), &dname); in xfs_vn_ci_lookup()
411 struct xfs_inode *ip = XFS_I(inode); in xfs_vn_getattr() local
412 struct xfs_mount *mp = ip->i_mount; in xfs_vn_getattr()
414 trace_xfs_getattr(ip); in xfs_vn_getattr()
419 stat->size = XFS_ISIZE(ip); in xfs_vn_getattr()
421 stat->mode = ip->i_d.di_mode; in xfs_vn_getattr()
422 stat->nlink = ip->i_d.di_nlink; in xfs_vn_getattr()
423 stat->uid = ip->i_d.di_uid; in xfs_vn_getattr()
424 stat->gid = ip->i_d.di_gid; in xfs_vn_getattr()
425 stat->ino = ip->i_ino; in xfs_vn_getattr()
430 XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks); in xfs_vn_getattr()
437 stat->rdev = MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff, in xfs_vn_getattr()
438 sysv_minor(ip->i_df.if_u2.if_rdev)); in xfs_vn_getattr()
441 if (XFS_IS_REALTIME_INODE(ip)) { in xfs_vn_getattr()
448 xfs_get_extsz_hint(ip) << mp->m_sb.sb_blocklog; in xfs_vn_getattr()
461 struct xfs_inode *ip, in xfs_setattr_mode() argument
464 struct inode *inode = VFS_I(ip); in xfs_setattr_mode()
468 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_setattr_mode()
473 ip->i_d.di_mode &= S_IFMT; in xfs_setattr_mode()
474 ip->i_d.di_mode |= mode & ~S_IFMT; in xfs_setattr_mode()
482 struct xfs_inode *ip, in xfs_setattr_nonsize() argument
486 xfs_mount_t *mp = ip->i_mount; in xfs_setattr_nonsize()
487 struct inode *inode = VFS_I(ip); in xfs_setattr_nonsize()
496 trace_xfs_setattr(ip); in xfs_setattr_nonsize()
525 uid = ip->i_d.di_uid; in xfs_setattr_nonsize()
531 gid = ip->i_d.di_gid; in xfs_setattr_nonsize()
541 error = xfs_qm_vop_dqalloc(ip, uid, gid, xfs_get_projid(ip), in xfs_setattr_nonsize()
552 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_setattr_nonsize()
564 iuid = ip->i_d.di_uid; in xfs_setattr_nonsize()
565 igid = ip->i_d.di_gid; in xfs_setattr_nonsize()
577 error = xfs_qm_vop_chown_reserve(tp, ip, udqp, gdqp, in xfs_setattr_nonsize()
585 xfs_trans_ijoin(tp, ip, 0); in xfs_setattr_nonsize()
597 if ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) && in xfs_setattr_nonsize()
599 ip->i_d.di_mode &= ~(S_ISUID|S_ISGID); in xfs_setattr_nonsize()
609 olddquot1 = xfs_qm_vop_chown(tp, ip, in xfs_setattr_nonsize()
610 &ip->i_udquot, udqp); in xfs_setattr_nonsize()
612 ip->i_d.di_uid = uid; in xfs_setattr_nonsize()
620 olddquot2 = xfs_qm_vop_chown(tp, ip, in xfs_setattr_nonsize()
621 &ip->i_gdquot, gdqp); in xfs_setattr_nonsize()
623 ip->i_d.di_gid = gid; in xfs_setattr_nonsize()
632 xfs_setattr_mode(tp, ip, iattr); in xfs_setattr_nonsize()
639 ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; in xfs_setattr_nonsize()
640 ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; in xfs_setattr_nonsize()
644 ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; in xfs_setattr_nonsize()
645 ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; in xfs_setattr_nonsize()
649 ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; in xfs_setattr_nonsize()
650 ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; in xfs_setattr_nonsize()
653 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_setattr_nonsize()
661 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_setattr_nonsize()
691 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_setattr_nonsize()
703 struct xfs_inode *ip, in xfs_setattr_size() argument
707 struct xfs_mount *mp = ip->i_mount; in xfs_setattr_size()
708 struct inode *inode = VFS_I(ip); in xfs_setattr_size()
716 trace_xfs_setattr(ip); in xfs_setattr_size()
728 ASSERT(S_ISREG(ip->i_d.di_mode)); in xfs_setattr_size()
734 xfs_ilock(ip, lock_flags); in xfs_setattr_size()
743 if (newsize == 0 && oldsize == 0 && ip->i_d.di_nextents == 0) { in xfs_setattr_size()
750 xfs_iunlock(ip, lock_flags); in xfs_setattr_size()
752 return xfs_setattr_nonsize(ip, iattr, 0); in xfs_setattr_size()
758 error = xfs_qm_dqattach(ip, 0); in xfs_setattr_size()
776 error = xfs_zero_eof(ip, newsize, oldsize); in xfs_setattr_size()
793 if (oldsize != ip->i_d.di_size && newsize > ip->i_d.di_size) { in xfs_setattr_size()
794 error = -filemap_write_and_wait_range(VFS_I(ip)->i_mapping, in xfs_setattr_size()
795 ip->i_d.di_size, newsize); in xfs_setattr_size()
821 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_setattr_size()
823 xfs_trans_ijoin(tp, ip, 0); in xfs_setattr_size()
853 ip->i_d.di_size = newsize; in xfs_setattr_size()
854 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_setattr_size()
857 error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, newsize); in xfs_setattr_size()
868 xfs_iflags_set(ip, XFS_ITRUNCATED); in xfs_setattr_size()
871 xfs_inode_clear_eofblocks_tag(ip); in xfs_setattr_size()
878 xfs_setattr_mode(tp, ip, iattr); in xfs_setattr_size()
882 ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; in xfs_setattr_size()
883 ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; in xfs_setattr_size()
887 ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; in xfs_setattr_size()
888 ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; in xfs_setattr_size()
891 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_setattr_size()
901 xfs_iunlock(ip, lock_flags); in xfs_setattr_size()
927 struct xfs_inode *ip = XFS_I(inode); in xfs_vn_update_time() local
928 struct xfs_mount *mp = ip->i_mount; in xfs_vn_update_time()
932 trace_xfs_update_time(ip); in xfs_vn_update_time()
941 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_vn_update_time()
944 ip->i_d.di_ctime.t_sec = (__int32_t)now->tv_sec; in xfs_vn_update_time()
945 ip->i_d.di_ctime.t_nsec = (__int32_t)now->tv_nsec; in xfs_vn_update_time()
949 ip->i_d.di_mtime.t_sec = (__int32_t)now->tv_sec; in xfs_vn_update_time()
950 ip->i_d.di_mtime.t_nsec = (__int32_t)now->tv_nsec; in xfs_vn_update_time()
954 ip->i_d.di_atime.t_sec = (__int32_t)now->tv_sec; in xfs_vn_update_time()
955 ip->i_d.di_atime.t_nsec = (__int32_t)now->tv_nsec; in xfs_vn_update_time()
957 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); in xfs_vn_update_time()
958 xfs_trans_log_inode(tp, ip, XFS_ILOG_TIMESTAMP); in xfs_vn_update_time()
1013 xfs_inode_t *ip = XFS_I(inode); in xfs_vn_fiemap() local
1040 error = xfs_getbmap(ip, &bm, xfs_fiemap_format, fieinfo); in xfs_vn_fiemap()
1128 struct xfs_inode *ip) in xfs_diflags_to_iflags() argument
1130 if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) in xfs_diflags_to_iflags()
1134 if (ip->i_d.di_flags & XFS_DIFLAG_APPEND) in xfs_diflags_to_iflags()
1138 if (ip->i_d.di_flags & XFS_DIFLAG_SYNC) in xfs_diflags_to_iflags()
1142 if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME) in xfs_diflags_to_iflags()
1162 struct xfs_inode *ip) in xfs_setup_inode() argument
1164 struct inode *inode = &ip->i_vnode; in xfs_setup_inode()
1166 inode->i_ino = ip->i_ino; in xfs_setup_inode()
1173 inode->i_mode = ip->i_d.di_mode; in xfs_setup_inode()
1174 set_nlink(inode, ip->i_d.di_nlink); in xfs_setup_inode()
1175 inode->i_uid = ip->i_d.di_uid; in xfs_setup_inode()
1176 inode->i_gid = ip->i_d.di_gid; in xfs_setup_inode()
1182 MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff, in xfs_setup_inode()
1183 sysv_minor(ip->i_df.if_u2.if_rdev)); in xfs_setup_inode()
1190 inode->i_generation = ip->i_d.di_gen; in xfs_setup_inode()
1191 i_size_write(inode, ip->i_d.di_size); in xfs_setup_inode()
1192 inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec; in xfs_setup_inode()
1193 inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec; in xfs_setup_inode()
1194 inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; in xfs_setup_inode()
1195 inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; in xfs_setup_inode()
1196 inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; in xfs_setup_inode()
1197 inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; in xfs_setup_inode()
1198 xfs_diflags_to_iflags(inode, ip); in xfs_setup_inode()
1215 if (!(ip->i_df.if_flags & XFS_IFINLINE)) in xfs_setup_inode()
1228 if (!XFS_IFORK_Q(ip)) { in xfs_setup_inode()
1233 xfs_iflags_clear(ip, XFS_INEW); in xfs_setup_inode()