diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-03-05 21:46:05 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-04-17 21:40:25 -0400 |
commit | 979ebab11623894528d4d37b947533ea4e8649d1 (patch) | |
tree | b7d2554818c1c0e8b2d5a7c581567be3c740247c /fs/xfs/linux-2.6 | |
parent | bc4ac74a4e5bd7db02976eb1b681e1d11f81c9ce (diff) |
[XFS] cleanup vnode use in xfs_create/mknod/mkdir
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30546a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 346701183318..62899a1ec7f7 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -273,7 +273,7 @@ xfs_vn_mknod( | |||
273 | dev_t rdev) | 273 | dev_t rdev) |
274 | { | 274 | { |
275 | struct inode *inode; | 275 | struct inode *inode; |
276 | bhv_vnode_t *vp = NULL, *dvp = vn_from_inode(dir); | 276 | struct xfs_inode *ip = NULL; |
277 | xfs_acl_t *default_acl = NULL; | 277 | xfs_acl_t *default_acl = NULL; |
278 | attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS; | 278 | attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS; |
279 | int error; | 279 | int error; |
@@ -285,11 +285,11 @@ xfs_vn_mknod( | |||
285 | if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff)) | 285 | if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff)) |
286 | return -EINVAL; | 286 | return -EINVAL; |
287 | 287 | ||
288 | if (test_default_acl && test_default_acl(dvp)) { | 288 | if (test_default_acl && test_default_acl(dir)) { |
289 | if (!_ACL_ALLOC(default_acl)) { | 289 | if (!_ACL_ALLOC(default_acl)) { |
290 | return -ENOMEM; | 290 | return -ENOMEM; |
291 | } | 291 | } |
292 | if (!_ACL_GET_DEFAULT(dvp, default_acl)) { | 292 | if (!_ACL_GET_DEFAULT(dir, default_acl)) { |
293 | _ACL_FREE(default_acl); | 293 | _ACL_FREE(default_acl); |
294 | default_acl = NULL; | 294 | default_acl = NULL; |
295 | } | 295 | } |
@@ -305,10 +305,10 @@ xfs_vn_mknod( | |||
305 | case S_IFSOCK: | 305 | case S_IFSOCK: |
306 | rdev = sysv_encode_dev(rdev); | 306 | rdev = sysv_encode_dev(rdev); |
307 | case S_IFREG: | 307 | case S_IFREG: |
308 | error = xfs_create(XFS_I(dir), dentry, mode, rdev, &vp, NULL); | 308 | error = xfs_create(XFS_I(dir), dentry, mode, rdev, &ip, NULL); |
309 | break; | 309 | break; |
310 | case S_IFDIR: | 310 | case S_IFDIR: |
311 | error = xfs_mkdir(XFS_I(dir), dentry, mode, &vp, NULL); | 311 | error = xfs_mkdir(XFS_I(dir), dentry, mode, &ip, NULL); |
312 | break; | 312 | break; |
313 | default: | 313 | default: |
314 | error = EINVAL; | 314 | error = EINVAL; |
@@ -318,19 +318,20 @@ xfs_vn_mknod( | |||
318 | if (unlikely(error)) | 318 | if (unlikely(error)) |
319 | goto out_free_acl; | 319 | goto out_free_acl; |
320 | 320 | ||
321 | error = xfs_init_security(vp, dir); | 321 | inode = ip->i_vnode; |
322 | |||
323 | error = xfs_init_security(inode, dir); | ||
322 | if (unlikely(error)) | 324 | if (unlikely(error)) |
323 | goto out_cleanup_inode; | 325 | goto out_cleanup_inode; |
324 | 326 | ||
325 | if (default_acl) { | 327 | if (default_acl) { |
326 | error = _ACL_INHERIT(vp, mode, default_acl); | 328 | error = _ACL_INHERIT(inode, mode, default_acl); |
327 | if (unlikely(error)) | 329 | if (unlikely(error)) |
328 | goto out_cleanup_inode; | 330 | goto out_cleanup_inode; |
329 | xfs_iflags_set(XFS_I(vp), XFS_IMODIFIED); | 331 | xfs_iflags_set(ip, XFS_IMODIFIED); |
330 | _ACL_FREE(default_acl); | 332 | _ACL_FREE(default_acl); |
331 | } | 333 | } |
332 | 334 | ||
333 | inode = vn_to_inode(vp); | ||
334 | 335 | ||
335 | if (S_ISDIR(mode)) | 336 | if (S_ISDIR(mode)) |
336 | xfs_validate_fields(inode); | 337 | xfs_validate_fields(inode); |
@@ -339,7 +340,7 @@ xfs_vn_mknod( | |||
339 | return -error; | 340 | return -error; |
340 | 341 | ||
341 | out_cleanup_inode: | 342 | out_cleanup_inode: |
342 | xfs_cleanup_inode(dir, vp, dentry, mode); | 343 | xfs_cleanup_inode(dir, inode, dentry, mode); |
343 | out_free_acl: | 344 | out_free_acl: |
344 | if (default_acl) | 345 | if (default_acl) |
345 | _ACL_FREE(default_acl); | 346 | _ACL_FREE(default_acl); |