Commit 0dff23e5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] kNFSd: move fh_dup2 and fix it

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....
parent 2a8d08da
...@@ -55,6 +55,16 @@ ...@@ -55,6 +55,16 @@
#define NFSDDBG_FACILITY NFSDDBG_PROC #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 static int
do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open) do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
{ {
......
...@@ -209,14 +209,6 @@ fh_copy(struct svc_fh *dst, struct svc_fh *src) ...@@ -209,14 +209,6 @@ fh_copy(struct svc_fh *dst, struct svc_fh *src)
return dst; 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 * static __inline__ struct svc_fh *
fh_init(struct svc_fh *fhp, int maxsize) fh_init(struct svc_fh *fhp, int maxsize)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment