]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[XFS] Cleanup various fid related bits:
authorChristoph Hellwig <hch@infradead.org>
Tue, 18 Dec 2007 05:26:55 +0000 (16:26 +1100)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Thu, 7 Feb 2008 07:20:11 +0000 (18:20 +1100)
- merge xfs_fid2 into it's only caller xfs_dm_inode_to_fh.
- remove xfs_vget and opencode it in the two callers, simplifying
  both of them by avoiding the awkward calling convetion.
- assign directly to the dm_fid_t members in various places in the
  dmapi code instead of casting them to xfs_fid_t first (which
  is identical to dm_fid_t)

SGI-PV: 974747
SGI-Modid: xfs-linux-melb:xfs-kern:30258a

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Vlad Apostolov <vapo@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/linux-2.6/xfs_export.c
fs/xfs/xfs_vfsops.c
fs/xfs/xfs_vfsops.h
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.h

index 15bd4948832ce7b1f789074b4ec77f53d0a9e25a..ca4f66c4de16aaa743f5dcb7cc0e44ae02715ef1 100644 (file)
@@ -118,20 +118,29 @@ xfs_nfs_get_inode(
        u64                     ino,
        u32                     generation)
  {
-       xfs_fid_t               xfid;
-       bhv_vnode_t             *vp;
+       xfs_mount_t             *mp = XFS_M(sb);
+       xfs_inode_t             *ip;
        int                     error;
 
-       xfid.fid_len = sizeof(xfs_fid_t) - sizeof(xfid.fid_len);
-       xfid.fid_pad = 0;
-       xfid.fid_ino = ino;
-       xfid.fid_gen = generation;
+       /*
+        * NFS can sometimes send requests for ino 0.  Fail them gracefully.
+        */
+       if (ino == 0)
+               return ERR_PTR(-ESTALE);
 
-       error = xfs_vget(XFS_M(sb), &vp, &xfid);
+       error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0);
        if (error)
                return ERR_PTR(-error);
+       if (!ip)
+               return ERR_PTR(-EIO);
+
+       if (!ip->i_d.di_mode || ip->i_d.di_gen != generation) {
+               xfs_iput_new(ip, XFS_ILOCK_SHARED);
+               return ERR_PTR(-ENOENT);
+       }
 
-       return vp ? vn_to_inode(vp) : NULL;
+       xfs_iunlock(ip, XFS_ILOCK_SHARED);
+       return ip->i_vnode;
 }
 
 STATIC struct dentry *
index b8e16a6952be96ebd42f1aa074060233cd070fe8..43b78d9dc1193989c5f647aaa2770fe1d39454b1 100644 (file)
@@ -1408,56 +1408,3 @@ xfs_syncsub(
 
        return XFS_ERROR(last_error);
 }
-
-/*
- * xfs_vget - called by DMAPI and NFSD to get vnode from file handle
- */
-int
-xfs_vget(
-       xfs_mount_t     *mp,
-       bhv_vnode_t     **vpp,
-       xfs_fid_t       *xfid)
-{
-       xfs_inode_t     *ip;
-       int             error;
-       xfs_ino_t       ino;
-       unsigned int    igen;
-
-       /*
-        * Invalid.  Since handles can be created in user space and passed in
-        * via gethandle(), this is not cause for a panic.
-        */
-       if (xfid->fid_len != sizeof(*xfid) - sizeof(xfid->fid_len))
-               return XFS_ERROR(EINVAL);
-
-       ino  = xfid->fid_ino;
-       igen = xfid->fid_gen;
-
-       /*
-        * NFS can sometimes send requests for ino 0.  Fail them gracefully.
-        */
-       if (ino == 0)
-               return XFS_ERROR(ESTALE);
-
-       error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0);
-       if (error) {
-               *vpp = NULL;
-               return error;
-       }
-
-       if (ip == NULL) {
-               *vpp = NULL;
-               return XFS_ERROR(EIO);
-       }
-
-       if (ip->i_d.di_mode == 0 || ip->i_d.di_gen != igen) {
-               xfs_iput_new(ip, XFS_ILOCK_SHARED);
-               *vpp = NULL;
-               return XFS_ERROR(ENOENT);
-       }
-
-       *vpp = XFS_ITOV(ip);
-       xfs_iunlock(ip, XFS_ILOCK_SHARED);
-       return 0;
-}
-
index bf1c083513ddaed551cc0729a1c81356f70e7b3c..ca3ae7c879c97eaec26810ab56a305f9654a2f6e 100644 (file)
@@ -15,7 +15,6 @@ int xfs_mntupdate(struct xfs_mount *mp, int *flags,
                struct xfs_mount_args *args);
 int xfs_root(struct xfs_mount *mp, bhv_vnode_t **vpp);
 int xfs_sync(struct xfs_mount *mp, int flags);
-int xfs_vget(struct xfs_mount *mp, bhv_vnode_t **vpp, struct xfs_fid *xfid);
 void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
                int lnnum);
 void xfs_attr_quiesce(struct xfs_mount *mp);
index 7f380e885a6fee39fa1ca10332762fb91316913b..6b71d9f763c79014acb3956269be095cc14a2e62 100644 (file)
@@ -3457,27 +3457,6 @@ std_return:
        goto std_return;
 }
 
-
-int
-xfs_fid2(
-       xfs_inode_t     *ip,
-       xfs_fid_t       *xfid)
-{
-       xfs_itrace_entry(ip);
-
-       xfid->fid_len = sizeof(xfs_fid_t) - sizeof(xfid->fid_len);
-       xfid->fid_pad = 0;
-       /*
-        * use memcpy because the inode is a long long and there's no
-        * assurance that xfid->fid_ino is properly aligned.
-        */
-       memcpy(&xfid->fid_ino, &ip->i_ino, sizeof(xfid->fid_ino));
-       xfid->fid_gen = ip->i_d.di_gen;
-
-       return 0;
-}
-
-
 int
 xfs_rwlock(
        xfs_inode_t     *ip,
index b7e461c40cfbace8e0289ab1d131a67f8b813a86..a501aeffb808a999c0131a7bada7bbff653980ee 100644 (file)
@@ -39,7 +39,6 @@ int xfs_readdir(struct xfs_inode      *dp, void *dirent, size_t bufsize,
 int xfs_symlink(struct xfs_inode *dp, bhv_vname_t *dentry,
                char *target_path, mode_t mode, bhv_vnode_t **vpp,
                struct cred *credp);
-int xfs_fid2(struct xfs_inode *ip, struct xfs_fid *xfid);
 int xfs_rwlock(struct xfs_inode *ip, bhv_vrwlock_t locktype);
 void xfs_rwunlock(struct xfs_inode *ip, bhv_vrwlock_t locktype);
 int xfs_inode_flush(struct xfs_inode *ip, int flags);