aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-03-05 21:46:43 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-04-17 21:41:14 -0400
commitaf048193fcfe2650e7ed3b1ab3d48b1ed0efb467 (patch)
tree0e02606bb4db074fdf18c3e4af2d9b28544a900f
parentdcf49cc5cfbbc0070ad4307428f8282dc7e04e58 (diff)
[XFS] cleanup vnode use in xfs_iops.c
SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30552a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 01d9b3f1e044..53f8feb28e58 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -62,12 +62,11 @@ void
62xfs_synchronize_atime( 62xfs_synchronize_atime(
63 xfs_inode_t *ip) 63 xfs_inode_t *ip)
64{ 64{
65 bhv_vnode_t *vp; 65 struct inode *inode = ip->i_vnode;
66 66
67 vp = XFS_ITOV_NULL(ip); 67 if (inode) {
68 if (vp) { 68 ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec;
69 ip->i_d.di_atime.t_sec = (__int32_t)vp->i_atime.tv_sec; 69 ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec;
70 ip->i_d.di_atime.t_nsec = (__int32_t)vp->i_atime.tv_nsec;
71 } 70 }
72} 71}
73 72
@@ -80,11 +79,10 @@ void
80xfs_mark_inode_dirty_sync( 79xfs_mark_inode_dirty_sync(
81 xfs_inode_t *ip) 80 xfs_inode_t *ip)
82{ 81{
83 bhv_vnode_t *vp; 82 struct inode *inode = ip->i_vnode;
84 83
85 vp = XFS_ITOV_NULL(ip); 84 if (inode)
86 if (vp) 85 mark_inode_dirty_sync(inode);
87 mark_inode_dirty_sync(vn_to_inode(vp));
88} 86}
89 87
90/* 88/*
@@ -215,26 +213,26 @@ xfs_validate_fields(
215 */ 213 */
216STATIC int 214STATIC int
217xfs_init_security( 215xfs_init_security(
218 bhv_vnode_t *vp, 216 struct inode *inode,
219 struct inode *dir) 217 struct inode *dir)
220{ 218{
221 struct inode *ip = vn_to_inode(vp); 219 struct xfs_inode *ip = XFS_I(inode);
222 size_t length; 220 size_t length;
223 void *value; 221 void *value;
224 char *name; 222 char *name;
225 int error; 223 int error;
226 224
227 error = security_inode_init_security(ip, dir, &name, &value, &length); 225 error = security_inode_init_security(inode, dir, &name,
226 &value, &length);
228 if (error) { 227 if (error) {
229 if (error == -EOPNOTSUPP) 228 if (error == -EOPNOTSUPP)
230 return 0; 229 return 0;
231 return -error; 230 return -error;
232 } 231 }
233 232
234 error = xfs_attr_set(XFS_I(ip), name, value, 233 error = xfs_attr_set(ip, name, value, length, ATTR_SECURE);
235 length, ATTR_SECURE);
236 if (!error) 234 if (!error)
237 xfs_iflags_set(XFS_I(ip), XFS_IMODIFIED); 235 xfs_iflags_set(ip, XFS_IMODIFIED);
238 236
239 kfree(name); 237 kfree(name);
240 kfree(value); 238 kfree(value);
@@ -244,7 +242,7 @@ xfs_init_security(
244STATIC void 242STATIC void
245xfs_cleanup_inode( 243xfs_cleanup_inode(
246 struct inode *dir, 244 struct inode *dir,
247 bhv_vnode_t *vp, 245 struct inode *inode,
248 struct dentry *dentry, 246 struct dentry *dentry,
249 int mode) 247 int mode)
250{ 248{
@@ -255,14 +253,14 @@ xfs_cleanup_inode(
255 * xfs_init_security we must back out. 253 * xfs_init_security we must back out.
256 * ENOSPC can hit here, among other things. 254 * ENOSPC can hit here, among other things.
257 */ 255 */
258 teardown.d_inode = vn_to_inode(vp); 256 teardown.d_inode = inode;
259 teardown.d_name = dentry->d_name; 257 teardown.d_name = dentry->d_name;
260 258
261 if (S_ISDIR(mode)) 259 if (S_ISDIR(mode))
262 xfs_rmdir(XFS_I(dir), &teardown); 260 xfs_rmdir(XFS_I(dir), &teardown);
263 else 261 else
264 xfs_remove(XFS_I(dir), &teardown); 262 xfs_remove(XFS_I(dir), &teardown);
265 VN_RELE(vp); 263 iput(inode);
266} 264}
267 265
268STATIC int 266STATIC int