nfsd: let "insecure" flag vary by pseudoflavor
[safe/jmp/linux-2.6] / include / linux / nfsd / export.h
index 5ed4f27..4cafbe1 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
+/* All flags that we claim to support.  (Note we don't support NOACL.) */
+#define NFSEXP_ALLFLAGS                0x7E3F
 
 /* The flags that may vary depending on security flavor: */
-#define NFSEXP_SECINFO_FLAGS   0
+#define NFSEXP_SECINFO_FLAGS   (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
+                                       | NFSEXP_ALLSQUASH \
+                                       | NFSEXP_INSECURE_PORT)
 
 #ifdef __KERNEL__
 
@@ -83,9 +85,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;
@@ -106,33 +107,28 @@ 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_RDONLY(exp)         ((exp)->ex_flags & NFSEXP_READONLY)
 #define EX_NOHIDE(exp)         ((exp)->ex_flags & NFSEXP_NOHIDE)
 #define EX_WGATHER(exp)                ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
 
+int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp);
+__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 *    exp_parent(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 path *);
+struct svc_export *    rqst_exp_parent(struct svc_rqst *,
+                                       struct path *);
 int                    exp_rootfh(struct auth_domain *, 
                                        char *path, struct knfsd_fh *, int maxsize);
 __be32                 exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
@@ -149,9 +145,7 @@ 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__ */