nfsd: enable V4ROOT exports
[safe/jmp/linux-2.6] / include / linux / nfsd / export.h
index 5cd1924..8ae78a6 100644 (file)
 #ifndef NFSD_EXPORT_H
 #define NFSD_EXPORT_H
 
-#include <asm/types.h>
-#ifdef __KERNEL__
 # include <linux/types.h>
-# include <linux/in.h>
+#ifdef __KERNEL__
+# include <linux/nfsd/nfsfh.h>
 #endif
 
 /*
 #define NFSEXP_FSID            0x2000
 #define        NFSEXP_CROSSMOUNT       0x4000
 #define        NFSEXP_NOACL            0x8000  /* reserved for possible ACL related use */
-#define NFSEXP_ALLFLAGS                0xFE3F
+/*
+ * The NFSEXP_V4ROOT flag causes the kernel to give access only to NFSv4
+ * clients, and only to the single directory that is the root of the
+ * export; further lookup and readdir operations are treated as if every
+ * subdirectory was a mountpoint, and ignored if they are not themselves
+ * exported.  This is used by nfsd and mountd to construct the NFSv4
+ * pseudofilesystem, which provides access only to paths leading to each
+ * exported filesystem.
+ */
+#define        NFSEXP_V4ROOT           0x10000
+/* All flags that we claim to support.  (Note we don't support NOACL.) */
+#define NFSEXP_ALLFLAGS                0x17E3F
 
 /* The flags that may vary depending on security flavor: */
 #define NFSEXP_SECINFO_FLAGS   (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
-                                       | NFSEXP_ALLSQUASH)
+                                       | NFSEXP_ALLSQUASH \
+                                       | NFSEXP_INSECURE_PORT)
 
 #ifdef __KERNEL__
 
@@ -84,9 +95,8 @@ struct svc_export {
        struct cache_head       h;
        struct auth_domain *    ex_client;
        int                     ex_flags;
-       struct vfsmount *       ex_mnt;
-       struct dentry *         ex_dentry;
-       char *                  ex_path;
+       struct path             ex_path;
+       char                    *ex_pathname;
        uid_t                   ex_anon_uid;
        gid_t                   ex_anon_gid;
        int                     ex_fsid;
@@ -107,11 +117,9 @@ struct svc_expkey {
        int                     ek_fsidtype;
        u32                     ek_fsid[6];
 
-       struct vfsmount *       ek_mnt;
-       struct dentry *         ek_dentry;
+       struct path             ek_path;
 };
 
-#define EX_SECURE(exp)         (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
 #define EX_ISSYNC(exp)         (!((exp)->ex_flags & NFSEXP_ASYNC))
 #define EX_NOHIDE(exp)         ((exp)->ex_flags & NFSEXP_NOHIDE)
 #define EX_WGATHER(exp)                ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
@@ -122,25 +130,15 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp);
 /*
  * Function declarations
  */
-void                   nfsd_export_init(void);
+int                    nfsd_export_init(void);
 void                   nfsd_export_shutdown(void);
 void                   nfsd_export_flush(void);
 void                   exp_readlock(void);
 void                   exp_readunlock(void);
-struct svc_export *    exp_get_by_name(struct auth_domain *clp,
-                                       struct vfsmount *mnt,
-                                       struct dentry *dentry,
-                                       struct cache_req *reqp);
 struct svc_export *    rqst_exp_get_by_name(struct svc_rqst *,
-                                            struct vfsmount *,
-                                            struct dentry *);
-struct svc_export *    exp_parent(struct auth_domain *clp,
-                                  struct vfsmount *mnt,
-                                  struct dentry *dentry,
-                                  struct cache_req *reqp);
+                                            struct path *);
 struct svc_export *    rqst_exp_parent(struct svc_rqst *,
-                                       struct vfsmount *mnt,
-                                       struct dentry *dentry);
+                                       struct path *);
 int                    exp_rootfh(struct auth_domain *, 
                                        char *path, struct knfsd_fh *, int maxsize);
 __be32                 exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
@@ -157,9 +155,6 @@ static inline void exp_get(struct svc_export *exp)
 {
        cache_get(&exp->h);
 }
-extern struct svc_export *
-exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv,
-        struct cache_req *reqp);
 struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *);
 
 #endif /* __KERNEL__ */