]> git.hungrycats.org Git - linux/commitdiff
[PATCH] kNFSd: move fh_dup2 and fix it
authorAndrew Morton <akpm@osdl.org>
Thu, 26 Feb 2004 14:49:20 +0000 (06:49 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 26 Feb 2004 14:49:20 +0000 (06:49 -0800)
From: NeilBrown <neilb@cse.unsw.edu.au>

fh_dup2 duplicates an entire svc_fh structure, so in addition to dget()'ing
the dentry, it also needs to bump the reference count on fh_export.

Moved it out of the header file into nfsfh.c for the simple reason that I
couldn't figure out how to reorganize the headers files right so that the
fh_dup2 could use the definition of svc_fh.  Since fh_dup2 is never actually
used outside of nfs4proc.c, it could just as well be moved there....

fs/nfsd/nfs4proc.c
include/linux/nfsd/nfsfh.h

index 1e6e7e6251d575bcb917b589e6703c9dcecec44e..7f00a8b91f01e9328a3657f464d50d5e75f92e69 100644 (file)
 
 #define NFSDDBG_FACILITY               NFSDDBG_PROC
 
+static inline void
+fh_dup2(struct svc_fh *dst, struct svc_fh *src)
+{
+       fh_put(dst);
+       dget(src->fh_dentry);
+       if (src->fh_export)
+               cache_get(&src->fh_export->h);
+       *dst = *src;
+}
+
 static int
 do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
 {
index 7a0ff0c14337d4b38144e5a383720d3715d70f82..06281634b083a92a566a27816f931709652a07e6 100644 (file)
@@ -209,14 +209,6 @@ fh_copy(struct svc_fh *dst, struct svc_fh *src)
        return dst;
 }
 
-static __inline__ void
-fh_dup2(struct svc_fh *dst, struct svc_fh *src)
-{
-       fh_put(dst);
-       dget(src->fh_dentry);
-       *dst = *src;
-}
-
 static __inline__ struct svc_fh *
 fh_init(struct svc_fh *fhp, int maxsize)
 {