aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2009-11-04 18:12:35 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-11-13 13:23:02 -0500
commit0a3adadee42f2865bb867b8c5f4955b7def9baad (patch)
treede98be9152faba8ea38bae24a7f5cce33ae99148
parentea4878a24d7e6a467d369b962bab95bd6a12cbe0 (diff)
nfsd: make fs/nfsd/vfs.h for common includes
None of this stuff is used outside nfsd, so move it out of the common linux include directory. Actually, probably none of the stuff in include/linux/nfsd/nfsd.h really belongs there, so later we may remove that file entirely. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r--fs/nfsd/lockd.c1
-rw-r--r--fs/nfsd/nfs2acl.c1
-rw-r--r--fs/nfsd/nfs3acl.c1
-rw-r--r--fs/nfsd/nfs3proc.c1
-rw-r--r--fs/nfsd/nfs4proc.c1
-rw-r--r--fs/nfsd/nfs4recover.c1
-rw-r--r--fs/nfsd/nfs4state.c1
-rw-r--r--fs/nfsd/nfs4xdr.c1
-rw-r--r--fs/nfsd/nfsfh.c1
-rw-r--r--fs/nfsd/nfsproc.c1
-rw-r--r--fs/nfsd/nfssvc.c1
-rw-r--r--fs/nfsd/vfs.c1
-rw-r--r--fs/nfsd/vfs.h98
-rw-r--r--include/linux/nfsd/nfsd.h87
14 files changed, 111 insertions, 86 deletions
diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
index b2786a5f9afe..812bc64874f6 100644
--- a/fs/nfsd/lockd.c
+++ b/fs/nfsd/lockd.c
@@ -16,6 +16,7 @@
16#include <linux/sunrpc/svc.h> 16#include <linux/sunrpc/svc.h>
17#include <linux/nfsd/nfsd.h> 17#include <linux/nfsd/nfsd.h>
18#include <linux/lockd/bind.h> 18#include <linux/lockd/bind.h>
19#include "vfs.h"
19 20
20#define NFSDDBG_FACILITY NFSDDBG_LOCKD 21#define NFSDDBG_FACILITY NFSDDBG_LOCKD
21 22
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index e2a17f0a96a7..38c883d48b02 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -14,6 +14,7 @@
14#include <linux/nfsd/xdr3.h> 14#include <linux/nfsd/xdr3.h>
15#include <linux/posix_acl.h> 15#include <linux/posix_acl.h>
16#include <linux/nfsacl.h> 16#include <linux/nfsacl.h>
17#include "vfs.h"
17 18
18#define NFSDDBG_FACILITY NFSDDBG_PROC 19#define NFSDDBG_FACILITY NFSDDBG_PROC
19#define RETURN_STATUS(st) { resp->status = (st); return (st); } 20#define RETURN_STATUS(st) { resp->status = (st); return (st); }
diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c
index ff73596eb550..526d85a65f76 100644
--- a/fs/nfsd/nfs3acl.c
+++ b/fs/nfsd/nfs3acl.c
@@ -13,6 +13,7 @@
13#include <linux/nfsd/xdr3.h> 13#include <linux/nfsd/xdr3.h>
14#include <linux/posix_acl.h> 14#include <linux/posix_acl.h>
15#include <linux/nfsacl.h> 15#include <linux/nfsacl.h>
16#include "vfs.h"
16 17
17#define RETURN_STATUS(st) { resp->status = (st); return (st); } 18#define RETURN_STATUS(st) { resp->status = (st); return (st); }
18 19
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c
index a713c418a922..1a259d313e14 100644
--- a/fs/nfsd/nfs3proc.c
+++ b/fs/nfsd/nfs3proc.c
@@ -25,6 +25,7 @@
25#include <linux/nfsd/cache.h> 25#include <linux/nfsd/cache.h>
26#include <linux/nfsd/xdr3.h> 26#include <linux/nfsd/xdr3.h>
27#include <linux/nfs3.h> 27#include <linux/nfs3.h>
28#include "vfs.h"
28 29
29#define NFSDDBG_FACILITY NFSDDBG_PROC 30#define NFSDDBG_FACILITY NFSDDBG_PROC
30 31
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index bebc0c2e1b0a..60a93cdefef5 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -48,6 +48,7 @@
48#include <linux/nfsd/xdr4.h> 48#include <linux/nfsd/xdr4.h>
49#include <linux/nfs4_acl.h> 49#include <linux/nfs4_acl.h>
50#include <linux/sunrpc/gss_api.h> 50#include <linux/sunrpc/gss_api.h>
51#include "vfs.h"
51 52
52#define NFSDDBG_FACILITY NFSDDBG_PROC 53#define NFSDDBG_FACILITY NFSDDBG_PROC
53 54
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index b5348405046b..c7a6b245c7ad 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -47,6 +47,7 @@
47#include <linux/crypto.h> 47#include <linux/crypto.h>
48#include <linux/sched.h> 48#include <linux/sched.h>
49#include <linux/mount.h> 49#include <linux/mount.h>
50#include "vfs.h"
50 51
51#define NFSDDBG_FACILITY NFSDDBG_PROC 52#define NFSDDBG_FACILITY NFSDDBG_PROC
52 53
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index c8b621a120cd..850960e5d626 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -56,6 +56,7 @@
56#include <linux/module.h> 56#include <linux/module.h>
57#include <linux/sunrpc/svcauth_gss.h> 57#include <linux/sunrpc/svcauth_gss.h>
58#include <linux/sunrpc/clnt.h> 58#include <linux/sunrpc/clnt.h>
59#include "vfs.h"
59 60
60#define NFSDDBG_FACILITY NFSDDBG_PROC 61#define NFSDDBG_FACILITY NFSDDBG_PROC
61 62
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 0fbd50cee1f6..db0fc55670b3 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -57,6 +57,7 @@
57#include <linux/nfs4_acl.h> 57#include <linux/nfs4_acl.h>
58#include <linux/sunrpc/gss_api.h> 58#include <linux/sunrpc/gss_api.h>
59#include <linux/sunrpc/svcauth_gss.h> 59#include <linux/sunrpc/svcauth_gss.h>
60#include "vfs.h"
60 61
61#define NFSDDBG_FACILITY NFSDDBG_XDR 62#define NFSDDBG_FACILITY NFSDDBG_XDR
62 63
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 01965b2f3a76..d0d8a217a3ea 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -22,6 +22,7 @@
22#include <linux/sunrpc/svc.h> 22#include <linux/sunrpc/svc.h>
23#include <linux/sunrpc/svcauth_gss.h> 23#include <linux/sunrpc/svcauth_gss.h>
24#include <linux/nfsd/nfsd.h> 24#include <linux/nfsd/nfsd.h>
25#include "vfs.h"
25#include "auth.h" 26#include "auth.h"
26 27
27#define NFSDDBG_FACILITY NFSDDBG_FH 28#define NFSDDBG_FACILITY NFSDDBG_FH
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index c5393d1b8955..6c967e1ba37b 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -24,6 +24,7 @@
24#include <linux/nfsd/nfsd.h> 24#include <linux/nfsd/nfsd.h>
25#include <linux/nfsd/cache.h> 25#include <linux/nfsd/cache.h>
26#include <linux/nfsd/xdr.h> 26#include <linux/nfsd/xdr.h>
27#include "vfs.h"
27 28
28typedef struct svc_rqst svc_rqst; 29typedef struct svc_rqst svc_rqst;
29typedef struct svc_buf svc_buf; 30typedef struct svc_buf svc_buf;
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 67ea83eedd43..2944b31dcbe6 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -35,6 +35,7 @@
35#include <linux/lockd/bind.h> 35#include <linux/lockd/bind.h>
36#include <linux/nfsacl.h> 36#include <linux/nfsacl.h>
37#include <linux/seq_file.h> 37#include <linux/seq_file.h>
38#include "vfs.h"
38 39
39#define NFSDDBG_FACILITY NFSDDBG_SVC 40#define NFSDDBG_FACILITY NFSDDBG_SVC
40 41
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 638573968dcf..a7038ede671a 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -56,6 +56,7 @@
56#endif /* CONFIG_NFSD_V4 */ 56#endif /* CONFIG_NFSD_V4 */
57#include <linux/jhash.h> 57#include <linux/jhash.h>
58#include <linux/ima.h> 58#include <linux/ima.h>
59#include "vfs.h"
59 60
60#include <asm/uaccess.h> 61#include <asm/uaccess.h>
61 62
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
new file mode 100644
index 000000000000..b8011fd2fcab
--- /dev/null
+++ b/fs/nfsd/vfs.h
@@ -0,0 +1,98 @@
1/*
2 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
3 */
4
5#ifndef LINUX_NFSD_VFS_H
6#define LINUX_NFSD_VFS_H
7
8/*
9 * Flags for nfsd_permission
10 */
11#define NFSD_MAY_NOP 0
12#define NFSD_MAY_EXEC 1 /* == MAY_EXEC */
13#define NFSD_MAY_WRITE 2 /* == MAY_WRITE */
14#define NFSD_MAY_READ 4 /* == MAY_READ */
15#define NFSD_MAY_SATTR 8
16#define NFSD_MAY_TRUNC 16
17#define NFSD_MAY_LOCK 32
18#define NFSD_MAY_OWNER_OVERRIDE 64
19#define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/
20#define NFSD_MAY_BYPASS_GSS_ON_ROOT 256
21
22#define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE)
23#define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC)
24
25/*
26 * Callback function for readdir
27 */
28typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
29
30/* nfsd/vfs.c */
31int fh_lock_parent(struct svc_fh *, struct dentry *);
32int nfsd_racache_init(int);
33void nfsd_racache_shutdown(void);
34int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
35 struct svc_export **expp);
36__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *,
37 const char *, unsigned int, struct svc_fh *);
38__be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *,
39 const char *, unsigned int,
40 struct svc_export **, struct dentry **);
41__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *,
42 struct iattr *, int, time_t);
43#ifdef CONFIG_NFSD_V4
44__be32 nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *,
45 struct nfs4_acl *);
46int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **);
47#endif /* CONFIG_NFSD_V4 */
48__be32 nfsd_create(struct svc_rqst *, struct svc_fh *,
49 char *name, int len, struct iattr *attrs,
50 int type, dev_t rdev, struct svc_fh *res);
51#ifdef CONFIG_NFSD_V3
52__be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
53__be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
54 char *name, int len, struct iattr *attrs,
55 struct svc_fh *res, int createmode,
56 u32 *verifier, int *truncp, int *created);
57__be32 nfsd_commit(struct svc_rqst *, struct svc_fh *,
58 loff_t, unsigned long);
59#endif /* CONFIG_NFSD_V3 */
60__be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int,
61 int, struct file **);
62void nfsd_close(struct file *);
63__be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
64 loff_t, struct kvec *, int, unsigned long *);
65__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
66 loff_t, struct kvec *,int, unsigned long *, int *);
67__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
68 char *, int *);
69__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
70 char *name, int len, char *path, int plen,
71 struct svc_fh *res, struct iattr *);
72__be32 nfsd_link(struct svc_rqst *, struct svc_fh *,
73 char *, int, struct svc_fh *);
74__be32 nfsd_rename(struct svc_rqst *,
75 struct svc_fh *, char *, int,
76 struct svc_fh *, char *, int);
77__be32 nfsd_remove(struct svc_rqst *,
78 struct svc_fh *, char *, int);
79__be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
80 char *name, int len);
81int nfsd_truncate(struct svc_rqst *, struct svc_fh *,
82 unsigned long size);
83__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *,
84 loff_t *, struct readdir_cd *, filldir_t);
85__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
86 struct kstatfs *, int access);
87
88int nfsd_notify_change(struct inode *, struct iattr *);
89__be32 nfsd_permission(struct svc_rqst *, struct svc_export *,
90 struct dentry *, int);
91int nfsd_sync_dir(struct dentry *dp);
92
93#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
94struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int);
95int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *);
96#endif
97
98#endif /* LINUX_NFSD_VFS_H */
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 510ffdd5020e..e4518d090a8c 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -25,30 +25,10 @@
25 */ 25 */
26#define NFSD_SUPPORTED_MINOR_VERSION 1 26#define NFSD_SUPPORTED_MINOR_VERSION 1
27 27
28/*
29 * Flags for nfsd_permission
30 */
31#define NFSD_MAY_NOP 0
32#define NFSD_MAY_EXEC 1 /* == MAY_EXEC */
33#define NFSD_MAY_WRITE 2 /* == MAY_WRITE */
34#define NFSD_MAY_READ 4 /* == MAY_READ */
35#define NFSD_MAY_SATTR 8
36#define NFSD_MAY_TRUNC 16
37#define NFSD_MAY_LOCK 32
38#define NFSD_MAY_OWNER_OVERRIDE 64
39#define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/
40#define NFSD_MAY_BYPASS_GSS_ON_ROOT 256
41
42#define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE)
43#define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC)
44
45/*
46 * Callback function for readdir
47 */
48struct readdir_cd { 28struct readdir_cd {
49 __be32 err; /* 0, nfserr, or nfserr_eof */ 29 __be32 err; /* 0, nfserr, or nfserr_eof */
50}; 30};
51typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int); 31
52 32
53extern struct svc_program nfsd_program; 33extern struct svc_program nfsd_program;
54extern struct svc_version nfsd_version2, nfsd_version3, 34extern struct svc_version nfsd_version2, nfsd_version3,
@@ -73,69 +53,6 @@ int nfsd_nrpools(void);
73int nfsd_get_nrthreads(int n, int *); 53int nfsd_get_nrthreads(int n, int *);
74int nfsd_set_nrthreads(int n, int *); 54int nfsd_set_nrthreads(int n, int *);
75 55
76/* nfsd/vfs.c */
77int fh_lock_parent(struct svc_fh *, struct dentry *);
78int nfsd_racache_init(int);
79void nfsd_racache_shutdown(void);
80int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
81 struct svc_export **expp);
82__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *,
83 const char *, unsigned int, struct svc_fh *);
84__be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *,
85 const char *, unsigned int,
86 struct svc_export **, struct dentry **);
87__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *,
88 struct iattr *, int, time_t);
89#ifdef CONFIG_NFSD_V4
90__be32 nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *,
91 struct nfs4_acl *);
92int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **);
93#endif /* CONFIG_NFSD_V4 */
94__be32 nfsd_create(struct svc_rqst *, struct svc_fh *,
95 char *name, int len, struct iattr *attrs,
96 int type, dev_t rdev, struct svc_fh *res);
97#ifdef CONFIG_NFSD_V3
98__be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
99__be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
100 char *name, int len, struct iattr *attrs,
101 struct svc_fh *res, int createmode,
102 u32 *verifier, int *truncp, int *created);
103__be32 nfsd_commit(struct svc_rqst *, struct svc_fh *,
104 loff_t, unsigned long);
105#endif /* CONFIG_NFSD_V3 */
106__be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int,
107 int, struct file **);
108void nfsd_close(struct file *);
109__be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
110 loff_t, struct kvec *, int, unsigned long *);
111__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
112 loff_t, struct kvec *,int, unsigned long *, int *);
113__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
114 char *, int *);
115__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
116 char *name, int len, char *path, int plen,
117 struct svc_fh *res, struct iattr *);
118__be32 nfsd_link(struct svc_rqst *, struct svc_fh *,
119 char *, int, struct svc_fh *);
120__be32 nfsd_rename(struct svc_rqst *,
121 struct svc_fh *, char *, int,
122 struct svc_fh *, char *, int);
123__be32 nfsd_remove(struct svc_rqst *,
124 struct svc_fh *, char *, int);
125__be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
126 char *name, int len);
127int nfsd_truncate(struct svc_rqst *, struct svc_fh *,
128 unsigned long size);
129__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *,
130 loff_t *, struct readdir_cd *, filldir_t);
131__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
132 struct kstatfs *, int access);
133
134int nfsd_notify_change(struct inode *, struct iattr *);
135__be32 nfsd_permission(struct svc_rqst *, struct svc_export *,
136 struct dentry *, int);
137int nfsd_sync_dir(struct dentry *dp);
138
139#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) 56#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
140#ifdef CONFIG_NFSD_V2_ACL 57#ifdef CONFIG_NFSD_V2_ACL
141extern struct svc_version nfsd_acl_version2; 58extern struct svc_version nfsd_acl_version2;
@@ -147,8 +64,6 @@ extern struct svc_version nfsd_acl_version3;
147#else 64#else
148#define nfsd_acl_version3 NULL 65#define nfsd_acl_version3 NULL
149#endif 66#endif
150struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int);
151int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *);
152#endif 67#endif
153 68
154enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL }; 69enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL };