From 981d3487f7b5a57e94a789e7a129f054fd7ad628 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 12 Sep 2002 01:42:59 -0700 Subject: [PATCH] kNFSd 14: Filehandle lookup makes use of new export table structure. Filehandle lookup currently breaks out the interesting pieces of a filehandle and passes them to exp_get or exp_get_fsid, which put the pieces back into a filehandle fragment. We define a new interface "exp_find" which does a lookup based on a filehandle fragment to avoid this double handling. In the process, common code in exp_get_key and exp_get_fsid_key is united into exp_find_key. Also, filehandle composition now uses the mk_fsid_v? inline functions. --- include/linux/nfsd/export.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 97592dbe9a4b..d6a346aef097 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h @@ -98,8 +98,7 @@ void exp_readlock(void); void exp_readunlock(void); struct svc_client * exp_getclient(struct sockaddr_in *sin); void exp_putclient(struct svc_client *clp); -struct svc_export * exp_get(struct svc_client *clp, dev_t dev, ino_t ino); -struct svc_export * exp_get_fsid(struct svc_client *clp, int fsid); +struct svc_expkey * exp_find_key(struct svc_client *clp, int fsid_type, u32 *fsidv); struct svc_export * exp_get_by_name(struct svc_client *clp, struct vfsmount *mnt, struct dentry *dentry); @@ -109,6 +108,15 @@ int exp_rootfh(struct svc_client *, char *path, struct knfsd_fh *, int maxsize); int nfserrno(int errno); +static inline struct svc_export * +exp_find(struct svc_client *clp, int fsid_type, u32 *fsidv) +{ + struct svc_expkey *ek = exp_find_key(clp, fsid_type, fsidv); + if (ek) + return ek->ek_export; + else + return NULL; +} #endif /* __KERNEL__ */ -- cgit v1.2.3