diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 126 |
1 files changed, 0 insertions, 126 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 3fef54b11582..04f3e302feee 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -76,132 +76,6 @@ xfs_open( | |||
76 | } | 76 | } |
77 | 77 | ||
78 | /* | 78 | /* |
79 | * xfs_getattr | ||
80 | */ | ||
81 | int | ||
82 | xfs_getattr( | ||
83 | xfs_inode_t *ip, | ||
84 | bhv_vattr_t *vap, | ||
85 | int flags) | ||
86 | { | ||
87 | bhv_vnode_t *vp = XFS_ITOV(ip); | ||
88 | xfs_mount_t *mp = ip->i_mount; | ||
89 | |||
90 | xfs_itrace_entry(ip); | ||
91 | |||
92 | if (XFS_FORCED_SHUTDOWN(mp)) | ||
93 | return XFS_ERROR(EIO); | ||
94 | |||
95 | if (!(flags & ATTR_LAZY)) | ||
96 | xfs_ilock(ip, XFS_ILOCK_SHARED); | ||
97 | |||
98 | vap->va_size = XFS_ISIZE(ip); | ||
99 | if (vap->va_mask == XFS_AT_SIZE) | ||
100 | goto all_done; | ||
101 | |||
102 | vap->va_nblocks = | ||
103 | XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks); | ||
104 | vap->va_nodeid = ip->i_ino; | ||
105 | #if XFS_BIG_INUMS | ||
106 | vap->va_nodeid += mp->m_inoadd; | ||
107 | #endif | ||
108 | vap->va_nlink = ip->i_d.di_nlink; | ||
109 | |||
110 | /* | ||
111 | * Quick exit for non-stat callers | ||
112 | */ | ||
113 | if ((vap->va_mask & | ||
114 | ~(XFS_AT_SIZE|XFS_AT_FSID|XFS_AT_NODEID| | ||
115 | XFS_AT_NLINK|XFS_AT_BLKSIZE)) == 0) | ||
116 | goto all_done; | ||
117 | |||
118 | /* | ||
119 | * Copy from in-core inode. | ||
120 | */ | ||
121 | vap->va_mode = ip->i_d.di_mode; | ||
122 | vap->va_uid = ip->i_d.di_uid; | ||
123 | vap->va_gid = ip->i_d.di_gid; | ||
124 | vap->va_projid = ip->i_d.di_projid; | ||
125 | |||
126 | /* | ||
127 | * Check vnode type block/char vs. everything else. | ||
128 | */ | ||
129 | switch (ip->i_d.di_mode & S_IFMT) { | ||
130 | case S_IFBLK: | ||
131 | case S_IFCHR: | ||
132 | vap->va_rdev = ip->i_df.if_u2.if_rdev; | ||
133 | vap->va_blocksize = BLKDEV_IOSIZE; | ||
134 | break; | ||
135 | default: | ||
136 | vap->va_rdev = 0; | ||
137 | |||
138 | if (!(XFS_IS_REALTIME_INODE(ip))) { | ||
139 | vap->va_blocksize = xfs_preferred_iosize(mp); | ||
140 | } else { | ||
141 | |||
142 | /* | ||
143 | * If the file blocks are being allocated from a | ||
144 | * realtime partition, then return the inode's | ||
145 | * realtime extent size or the realtime volume's | ||
146 | * extent size. | ||
147 | */ | ||
148 | vap->va_blocksize = | ||
149 | xfs_get_extsz_hint(ip) << mp->m_sb.sb_blocklog; | ||
150 | } | ||
151 | break; | ||
152 | } | ||
153 | |||
154 | vn_atime_to_timespec(vp, &vap->va_atime); | ||
155 | vap->va_mtime.tv_sec = ip->i_d.di_mtime.t_sec; | ||
156 | vap->va_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; | ||
157 | vap->va_ctime.tv_sec = ip->i_d.di_ctime.t_sec; | ||
158 | vap->va_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; | ||
159 | |||
160 | /* | ||
161 | * Exit for stat callers. See if any of the rest of the fields | ||
162 | * to be filled in are needed. | ||
163 | */ | ||
164 | if ((vap->va_mask & | ||
165 | (XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS| | ||
166 | XFS_AT_GENCOUNT|XFS_AT_VCODE)) == 0) | ||
167 | goto all_done; | ||
168 | |||
169 | /* | ||
170 | * Convert di_flags to xflags. | ||
171 | */ | ||
172 | vap->va_xflags = xfs_ip2xflags(ip); | ||
173 | |||
174 | /* | ||
175 | * Exit for inode revalidate. See if any of the rest of | ||
176 | * the fields to be filled in are needed. | ||
177 | */ | ||
178 | if ((vap->va_mask & | ||
179 | (XFS_AT_EXTSIZE|XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS| | ||
180 | XFS_AT_GENCOUNT|XFS_AT_VCODE)) == 0) | ||
181 | goto all_done; | ||
182 | |||
183 | vap->va_extsize = ip->i_d.di_extsize << mp->m_sb.sb_blocklog; | ||
184 | vap->va_nextents = | ||
185 | (ip->i_df.if_flags & XFS_IFEXTENTS) ? | ||
186 | ip->i_df.if_bytes / sizeof(xfs_bmbt_rec_t) : | ||
187 | ip->i_d.di_nextents; | ||
188 | if (ip->i_afp) | ||
189 | vap->va_anextents = | ||
190 | (ip->i_afp->if_flags & XFS_IFEXTENTS) ? | ||
191 | ip->i_afp->if_bytes / sizeof(xfs_bmbt_rec_t) : | ||
192 | ip->i_d.di_anextents; | ||
193 | else | ||
194 | vap->va_anextents = 0; | ||
195 | vap->va_gen = ip->i_d.di_gen; | ||
196 | |||
197 | all_done: | ||
198 | if (!(flags & ATTR_LAZY)) | ||
199 | xfs_iunlock(ip, XFS_ILOCK_SHARED); | ||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | |||
204 | /* | ||
205 | * xfs_setattr | 79 | * xfs_setattr |
206 | */ | 80 | */ |
207 | int | 81 | int |