diff options
Diffstat (limited to 'fs/xfs/xfs_vfsops.c')
| -rw-r--r-- | fs/xfs/xfs_vfsops.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index b8e16a6952be..43b78d9dc119 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
| @@ -1408,56 +1408,3 @@ xfs_syncsub( | |||
| 1408 | 1408 | ||
| 1409 | return XFS_ERROR(last_error); | 1409 | return XFS_ERROR(last_error); |
| 1410 | } | 1410 | } |
| 1411 | |||
| 1412 | /* | ||
| 1413 | * xfs_vget - called by DMAPI and NFSD to get vnode from file handle | ||
| 1414 | */ | ||
| 1415 | int | ||
| 1416 | xfs_vget( | ||
| 1417 | xfs_mount_t *mp, | ||
| 1418 | bhv_vnode_t **vpp, | ||
| 1419 | xfs_fid_t *xfid) | ||
| 1420 | { | ||
| 1421 | xfs_inode_t *ip; | ||
| 1422 | int error; | ||
| 1423 | xfs_ino_t ino; | ||
| 1424 | unsigned int igen; | ||
| 1425 | |||
| 1426 | /* | ||
| 1427 | * Invalid. Since handles can be created in user space and passed in | ||
| 1428 | * via gethandle(), this is not cause for a panic. | ||
| 1429 | */ | ||
| 1430 | if (xfid->fid_len != sizeof(*xfid) - sizeof(xfid->fid_len)) | ||
| 1431 | return XFS_ERROR(EINVAL); | ||
| 1432 | |||
| 1433 | ino = xfid->fid_ino; | ||
| 1434 | igen = xfid->fid_gen; | ||
| 1435 | |||
| 1436 | /* | ||
| 1437 | * NFS can sometimes send requests for ino 0. Fail them gracefully. | ||
| 1438 | */ | ||
| 1439 | if (ino == 0) | ||
| 1440 | return XFS_ERROR(ESTALE); | ||
| 1441 | |||
| 1442 | error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0); | ||
| 1443 | if (error) { | ||
| 1444 | *vpp = NULL; | ||
| 1445 | return error; | ||
| 1446 | } | ||
| 1447 | |||
| 1448 | if (ip == NULL) { | ||
| 1449 | *vpp = NULL; | ||
| 1450 | return XFS_ERROR(EIO); | ||
| 1451 | } | ||
| 1452 | |||
| 1453 | if (ip->i_d.di_mode == 0 || ip->i_d.di_gen != igen) { | ||
| 1454 | xfs_iput_new(ip, XFS_ILOCK_SHARED); | ||
| 1455 | *vpp = NULL; | ||
| 1456 | return XFS_ERROR(ENOENT); | ||
| 1457 | } | ||
| 1458 | |||
| 1459 | *vpp = XFS_ITOV(ip); | ||
| 1460 | xfs_iunlock(ip, XFS_ILOCK_SHARED); | ||
| 1461 | return 0; | ||
| 1462 | } | ||
| 1463 | |||
