diff options
| author | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-09-12 20:03:04 -0700 |
|---|---|---|
| committer | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-09-12 20:03:04 -0700 |
| commit | 38d7463e67da354603897116876a29bbad5962ba (patch) | |
| tree | 24a9c06b71a33ffe509412bfeccfd3fac0777d17 /include/linux | |
| parent | bca102e6cd1a20997456381aaaabb1006107df26 (diff) | |
| parent | c39f732042a43ded87dbe10efa3a2e0990e0f3d9 (diff) | |
Merge bk://linus.bkbits.net/linux-2.5
into maxwell.earthlink.net:/usr/src/linus-2.5
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/lockd/bind.h | 5 | ||||
| -rw-r--r-- | include/linux/lockd/lockd.h | 8 | ||||
| -rw-r--r-- | include/linux/lockd/sm_inter.h | 1 | ||||
| -rw-r--r-- | include/linux/lockd/xdr.h | 2 | ||||
| -rw-r--r-- | include/linux/nfsd/auth.h | 18 | ||||
| -rw-r--r-- | include/linux/nfsd/export.h | 45 | ||||
| -rw-r--r-- | include/linux/nfsd/nfsfh.h | 13 |
7 files changed, 47 insertions, 45 deletions
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index 40dd93194089..820faee16a9b 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h @@ -19,14 +19,10 @@ struct svc_client; /* opaque type */ * This is the set of functions for lockd->nfsd communication */ struct nlmsvc_binding { - void (*exp_readlock)(void); - void (*exp_unlock)(void); - struct svc_client * (*exp_getclient)(struct sockaddr_in *); u32 (*fopen)(struct svc_rqst *, struct nfs_fh *, struct file *); void (*fclose)(struct file *); - void (*detach)(void); }; extern struct nlmsvc_binding * nlmsvc_ops; @@ -34,7 +30,6 @@ extern struct nlmsvc_binding * nlmsvc_ops; /* * Functions exported by the lockd module */ -extern void nlmsvc_invalidate_client(struct svc_client *clnt); extern int nlmclnt_proc(struct inode *, int, struct file_lock *); extern int lockd_up(void); extern void lockd_down(void); diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index caa826a929e4..556153082cd0 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -39,13 +39,13 @@ struct nlm_host { struct nlm_host * h_next; /* linked list (hash table) */ struct sockaddr_in h_addr; /* peer address */ - struct svc_client * h_exportent; /* NFS client */ struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ char h_name[20]; /* remote hostname */ u32 h_version; /* interface version */ unsigned short h_proto; /* transport proto */ unsigned short h_authflavor; /* RPC authentication type */ unsigned short h_reclaiming : 1, + h_server : 1, /* server side, not client side */ h_inuse : 1, h_killed : 1, h_monitored : 1; @@ -143,13 +143,14 @@ void nlmclnt_freegrantargs(struct nlm_rqst *); */ struct nlm_host * nlmclnt_lookup_host(struct sockaddr_in *, int, int); struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *); -struct nlm_host * nlm_lookup_host(struct svc_client *, - struct sockaddr_in *, int, int); +struct nlm_host * nlm_lookup_host(int server, struct sockaddr_in *, int, int); struct rpc_clnt * nlm_bind_host(struct nlm_host *); void nlm_rebind_host(struct nlm_host *); struct nlm_host * nlm_get_host(struct nlm_host *); void nlm_release_host(struct nlm_host *); void nlm_shutdown_hosts(void); +extern struct nlm_host *nlm_find_client(void); + /* * Server-side lock handling @@ -173,6 +174,7 @@ u32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **, void nlm_release_file(struct nlm_file *); void nlmsvc_mark_resources(void); void nlmsvc_free_host_resources(struct nlm_host *); +void nlmsvc_invalidate_all(void); static __inline__ struct inode * nlmsvc_file_inode(struct nlm_file *file) diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h index d93b074668ce..1080bb6ae315 100644 --- a/include/linux/lockd/sm_inter.h +++ b/include/linux/lockd/sm_inter.h @@ -28,6 +28,7 @@ struct nsm_args { u32 prog; /* RPC callback info */ u32 vers; u32 proc; + u32 proto; /* protocol (udp/tcp) plus server/client flag */ }; /* diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h index 51657ceffa2d..ef14dbd2a67c 100644 --- a/include/linux/lockd/xdr.h +++ b/include/linux/lockd/xdr.h @@ -76,6 +76,8 @@ struct nlm_reboot { int len; u32 state; u32 addr; + u32 vers; + u32 proto; }; /* diff --git a/include/linux/nfsd/auth.h b/include/linux/nfsd/auth.h index ec2c9d7bfb26..575a0c0fea2a 100644 --- a/include/linux/nfsd/auth.h +++ b/include/linux/nfsd/auth.h @@ -23,23 +23,5 @@ */ void nfsd_setuser(struct svc_rqst *, struct svc_export *); -#if 0 -/* - * These must match the actual size of uid_t and gid_t - */ -#define UGID_BITS (8 * sizeof(uid_t)) -#define UGID_SHIFT 8 -#define UGID_MASK ((1 << UGID_SHIFT) - 1) -#define UGID_NRENTRIES ((1 << (UGID_BITS - UGID_SHIFT)) + 1) -#define UGID_NONE ((unsigned short)-1) - -typedef struct svc_uidmap { - uid_t * um_ruid[UGID_NRENTRIES]; - uid_t * um_luid[UGID_NRENTRIES]; - gid_t * um_rgid[UGID_NRENTRIES]; - gid_t * um_lgid[UGID_NRENTRIES]; -} svc_uidmap; -#endif - #endif /* __KERNEL__ */ #endif /* LINUX_NFSD_AUTH_H */ diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 9de10bf92e32..8c79deb497ee 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h @@ -45,38 +45,36 @@ #ifdef __KERNEL__ -/* The following are hashtable sizes and must be powers of 2 */ -#define NFSCLNT_EXPMAX 16 - struct svc_client { struct svc_client * cl_next; char cl_ident[NFSCLNT_IDMAX]; - int cl_idlen; - int cl_naddr; - struct in_addr cl_addr[NFSCLNT_ADDRMAX]; - struct svc_uidmap * cl_umap; - struct list_head cl_export[NFSCLNT_EXPMAX]; - struct list_head cl_expfsid[NFSCLNT_EXPMAX]; - struct list_head cl_list; }; struct svc_export { struct list_head ex_hash; - struct list_head ex_fsid_hash; - struct list_head ex_list; - char ex_path[NFS_MAXPATHLEN+1]; - struct svc_export * ex_parent; struct svc_client * ex_client; int ex_flags; struct vfsmount * ex_mnt; struct dentry * ex_dentry; - dev_t ex_dev; - ino_t ex_ino; uid_t ex_anon_uid; gid_t ex_anon_gid; int ex_fsid; }; +/* an "export key" (expkey) maps a filehandlefragement to an + * svc_export for a given client. There can be two per export, one + * for type 0 (dev/ino), one for type 1 (fsid) + */ +struct svc_expkey { + struct list_head ek_hash; + + struct svc_client *ek_client; + int ek_fsidtype; + u32 ek_fsid[2]; + + struct svc_export *ek_export; +}; + #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) #define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY) @@ -94,16 +92,25 @@ 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); +struct svc_export * exp_parent(struct svc_client *clp, struct vfsmount *mnt, + struct dentry *dentry); int exp_rootfh(struct svc_client *, char *path, struct knfsd_fh *, int maxsize); int nfserrno(int errno); -void exp_nlmdetach(void); +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__ */ diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 53f55cc17a50..af0b03c0ce83 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h @@ -199,6 +199,19 @@ typedef struct svc_fh { } svc_fh; +static inline void mk_fsid_v0(u32 *fsidv, dev_t dev, ino_t ino) +{ + fsidv[0] = htonl((MAJOR(dev)<<16) | + MINOR(dev)); + fsidv[1] = ino_t_to_u32(ino); +} + +static inline void mk_fsid_v1(u32 *fsidv, u32 fsid) +{ + fsidv[0] = fsid; +} + + /* * Shorthand for dprintk()'s */ |
