]> git.hungrycats.org Git - linux/commitdiff
Clean up the nfs_fhget() function. Have the called pass the
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Tue, 7 Oct 2003 11:43:43 +0000 (07:43 -0400)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Tue, 7 Oct 2003 11:43:43 +0000 (07:43 -0400)
superblock as a parameter instead of passing it in the form
of a dentry.

fs/nfs/dir.c
fs/nfs/inode.c
include/linux/nfs_fs.h

index 57acac971890440496913b870086f068096f85dc..6587f4ede169d2a48d002cb19bfe9bc9629aec63 100644 (file)
@@ -688,7 +688,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
                        goto out_unlock;
        }
        error = -EACCES;
-       inode = nfs_fhget(dentry, &fhandle, &fattr);
+       inode = nfs_fhget(dentry->d_sb, &fhandle, &fattr);
        if (!inode)
                goto out_unlock;
 no_entry:
@@ -791,7 +791,7 @@ static int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle,
                if (error)
                        goto out_err;
        }
-       inode = nfs_fhget(dentry, fhandle, fattr);
+       inode = nfs_fhget(dentry->d_sb, fhandle, fattr);
        if (inode) {
                d_instantiate(dentry, inode);
                nfs_renew_times(dentry);
index 4ed5e21d1f7d2dc62967098f47ec459b4d9ba2a7..2607af8c6f1ebec2de98b90612c58ec2646fa714 100644 (file)
@@ -53,7 +53,6 @@
  */
 #define NFS_MAX_READAHEAD      RPC_MAXREQS
 
-static struct inode * __nfs_fhget(struct super_block *, struct nfs_fh *, struct nfs_fattr *);
 void nfs_zap_caches(struct inode *);
 static void nfs_invalidate_inode(struct inode *);
 
@@ -273,7 +272,7 @@ nfs_get_root(struct inode **rooti, rpc_authflavor_t authflavor, struct super_blo
                return error;
        }
 
-       *rooti = __nfs_fhget(sb, rootfh, &fattr);
+       *rooti = nfs_fhget(sb, rootfh, &fattr);
        if (error == -EACCES && authflavor > RPC_AUTH_MAXFLAVOR) {
                if (*rooti) {
                        NFS_FLAGS(*rooti) |= NFS_INO_FAKE_ROOT;
@@ -692,33 +691,15 @@ nfs_init_locked(struct inode *inode, void *opaque)
        return 0;
 }
 
-/*
- * This is our own version of iget that looks up inodes by file handle
- * instead of inode number.  We use this technique instead of using
- * the vfs read_inode function because there is no way to pass the
- * file handle or current attributes into the read_inode function.
- *
- */
-struct inode *
-nfs_fhget(struct dentry *dentry, struct nfs_fh *fhandle,
-                                struct nfs_fattr *fattr)
-{
-       struct super_block *sb = dentry->d_sb;
-
-       dprintk("NFS: nfs_fhget(%s/%s fileid=%Ld)\n",
-               dentry->d_parent->d_name.name, dentry->d_name.name,
-               (long long)fattr->fileid);
-       return __nfs_fhget(sb, fhandle, fattr);
-}
-
 /* Don't use READDIRPLUS on directories that we believe are too large */
 #define NFS_LIMIT_READDIRPLUS (8*PAGE_SIZE)
 
 /*
- * Look up the inode by super block and fattr->fileid.
+ * This is our front-end to iget that looks up inodes by file handle
+ * instead of inode number.
  */
-static struct inode *
-__nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
+struct inode *
+nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
 {
        struct nfs_find_desc desc = {
                .fh     = fh,
@@ -801,7 +782,7 @@ __nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
                unlock_new_inode(inode);
        } else
                nfs_refresh_inode(inode, fattr);
-       dprintk("NFS: __nfs_fhget(%s/%Ld ct=%d)\n",
+       dprintk("NFS: nfs_fhget(%s/%Ld ct=%d)\n",
                inode->i_sb->s_id,
                (long long)NFS_FILEID(inode),
                atomic_read(&inode->i_count));
@@ -810,7 +791,7 @@ out:
        return inode;
 
 out_no_inode:
-       printk("__nfs_fhget: iget failed\n");
+       printk("nfs_fhget: iget failed\n");
        goto out;
 }
 
index be2bfde9904452992eb289b28562a13e75d66a83..7a87a46878a3dba74f8d942dd7dbc0bc48acfc05 100644 (file)
@@ -238,7 +238,7 @@ loff_t req_offset(struct nfs_page *req)
  * linux/fs/nfs/inode.c
  */
 extern void nfs_zap_caches(struct inode *);
-extern struct inode *nfs_fhget(struct dentry *, struct nfs_fh *,
+extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
                                struct nfs_fattr *);
 extern int __nfs_refresh_inode(struct inode *, struct nfs_fattr *);
 extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);