diff options
author | NeilBrown <neilb@suse.de> | 2010-09-21 22:55:07 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-09-22 15:33:14 -0400 |
commit | 1e1405673e4e40a94ed7620553eb440a21040402 (patch) | |
tree | 2553812b11feeefbf2b68c226f45d52e7a12f5b5 /fs/nfsd/nfsctl.c | |
parent | c67874f942e30039442d925b03793e0a46ddcddd (diff) |
nfsd: allow deprecated interface to be compiled out.
Add CONFIG_NFSD_DEPRECATED, default to y.
Only include deprecated interface if this is defined.
This allows distros to remove this interface before the official
removal, and allows developers to test without it.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 7f0fc8861b85..b278e444e2f4 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -22,6 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | enum { | 23 | enum { |
24 | NFSD_Root = 1, | 24 | NFSD_Root = 1, |
25 | #ifdef CONFIG_NFSD_DEPRECATED | ||
25 | NFSD_Svc, | 26 | NFSD_Svc, |
26 | NFSD_Add, | 27 | NFSD_Add, |
27 | NFSD_Del, | 28 | NFSD_Del, |
@@ -29,6 +30,7 @@ enum { | |||
29 | NFSD_Unexport, | 30 | NFSD_Unexport, |
30 | NFSD_Getfd, | 31 | NFSD_Getfd, |
31 | NFSD_Getfs, | 32 | NFSD_Getfs, |
33 | #endif | ||
32 | NFSD_List, | 34 | NFSD_List, |
33 | NFSD_Export_features, | 35 | NFSD_Export_features, |
34 | NFSD_Fh, | 36 | NFSD_Fh, |
@@ -54,6 +56,7 @@ enum { | |||
54 | /* | 56 | /* |
55 | * write() for these nodes. | 57 | * write() for these nodes. |
56 | */ | 58 | */ |
59 | #ifdef CONFIG_NFSD_DEPRECATED | ||
57 | static ssize_t write_svc(struct file *file, char *buf, size_t size); | 60 | static ssize_t write_svc(struct file *file, char *buf, size_t size); |
58 | static ssize_t write_add(struct file *file, char *buf, size_t size); | 61 | static ssize_t write_add(struct file *file, char *buf, size_t size); |
59 | static ssize_t write_del(struct file *file, char *buf, size_t size); | 62 | static ssize_t write_del(struct file *file, char *buf, size_t size); |
@@ -61,6 +64,7 @@ static ssize_t write_export(struct file *file, char *buf, size_t size); | |||
61 | static ssize_t write_unexport(struct file *file, char *buf, size_t size); | 64 | static ssize_t write_unexport(struct file *file, char *buf, size_t size); |
62 | static ssize_t write_getfd(struct file *file, char *buf, size_t size); | 65 | static ssize_t write_getfd(struct file *file, char *buf, size_t size); |
63 | static ssize_t write_getfs(struct file *file, char *buf, size_t size); | 66 | static ssize_t write_getfs(struct file *file, char *buf, size_t size); |
67 | #endif | ||
64 | static ssize_t write_filehandle(struct file *file, char *buf, size_t size); | 68 | static ssize_t write_filehandle(struct file *file, char *buf, size_t size); |
65 | static ssize_t write_unlock_ip(struct file *file, char *buf, size_t size); | 69 | static ssize_t write_unlock_ip(struct file *file, char *buf, size_t size); |
66 | static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size); | 70 | static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size); |
@@ -76,6 +80,7 @@ static ssize_t write_recoverydir(struct file *file, char *buf, size_t size); | |||
76 | #endif | 80 | #endif |
77 | 81 | ||
78 | static ssize_t (*write_op[])(struct file *, char *, size_t) = { | 82 | static ssize_t (*write_op[])(struct file *, char *, size_t) = { |
83 | #ifdef CONFIG_NFSD_DEPRECATED | ||
79 | [NFSD_Svc] = write_svc, | 84 | [NFSD_Svc] = write_svc, |
80 | [NFSD_Add] = write_add, | 85 | [NFSD_Add] = write_add, |
81 | [NFSD_Del] = write_del, | 86 | [NFSD_Del] = write_del, |
@@ -83,6 +88,7 @@ static ssize_t (*write_op[])(struct file *, char *, size_t) = { | |||
83 | [NFSD_Unexport] = write_unexport, | 88 | [NFSD_Unexport] = write_unexport, |
84 | [NFSD_Getfd] = write_getfd, | 89 | [NFSD_Getfd] = write_getfd, |
85 | [NFSD_Getfs] = write_getfs, | 90 | [NFSD_Getfs] = write_getfs, |
91 | #endif | ||
86 | [NFSD_Fh] = write_filehandle, | 92 | [NFSD_Fh] = write_filehandle, |
87 | [NFSD_FO_UnlockIP] = write_unlock_ip, | 93 | [NFSD_FO_UnlockIP] = write_unlock_ip, |
88 | [NFSD_FO_UnlockFS] = write_unlock_fs, | 94 | [NFSD_FO_UnlockFS] = write_unlock_fs, |
@@ -196,6 +202,7 @@ static const struct file_operations pool_stats_operations = { | |||
196 | * payload - write methods | 202 | * payload - write methods |
197 | */ | 203 | */ |
198 | 204 | ||
205 | #ifdef CONFIG_NFSD_DEPRECATED | ||
199 | /** | 206 | /** |
200 | * write_svc - Start kernel's NFSD server | 207 | * write_svc - Start kernel's NFSD server |
201 | * | 208 | * |
@@ -491,6 +498,7 @@ static ssize_t write_getfd(struct file *file, char *buf, size_t size) | |||
491 | out: | 498 | out: |
492 | return err; | 499 | return err; |
493 | } | 500 | } |
501 | #endif /* CONFIG_NFSD_DEPRECATED */ | ||
494 | 502 | ||
495 | /** | 503 | /** |
496 | * write_unlock_ip - Release all locks used by a client | 504 | * write_unlock_ip - Release all locks used by a client |
@@ -1365,6 +1373,7 @@ static ssize_t write_recoverydir(struct file *file, char *buf, size_t size) | |||
1365 | static int nfsd_fill_super(struct super_block * sb, void * data, int silent) | 1373 | static int nfsd_fill_super(struct super_block * sb, void * data, int silent) |
1366 | { | 1374 | { |
1367 | static struct tree_descr nfsd_files[] = { | 1375 | static struct tree_descr nfsd_files[] = { |
1376 | #ifdef CONFIG_NFSD_DEPRECATED | ||
1368 | [NFSD_Svc] = {".svc", &transaction_ops, S_IWUSR}, | 1377 | [NFSD_Svc] = {".svc", &transaction_ops, S_IWUSR}, |
1369 | [NFSD_Add] = {".add", &transaction_ops, S_IWUSR}, | 1378 | [NFSD_Add] = {".add", &transaction_ops, S_IWUSR}, |
1370 | [NFSD_Del] = {".del", &transaction_ops, S_IWUSR}, | 1379 | [NFSD_Del] = {".del", &transaction_ops, S_IWUSR}, |
@@ -1372,6 +1381,7 @@ static int nfsd_fill_super(struct super_block * sb, void * data, int silent) | |||
1372 | [NFSD_Unexport] = {".unexport", &transaction_ops, S_IWUSR}, | 1381 | [NFSD_Unexport] = {".unexport", &transaction_ops, S_IWUSR}, |
1373 | [NFSD_Getfd] = {".getfd", &transaction_ops, S_IWUSR|S_IRUSR}, | 1382 | [NFSD_Getfd] = {".getfd", &transaction_ops, S_IWUSR|S_IRUSR}, |
1374 | [NFSD_Getfs] = {".getfs", &transaction_ops, S_IWUSR|S_IRUSR}, | 1383 | [NFSD_Getfs] = {".getfs", &transaction_ops, S_IWUSR|S_IRUSR}, |
1384 | #endif | ||
1375 | [NFSD_List] = {"exports", &exports_operations, S_IRUGO}, | 1385 | [NFSD_List] = {"exports", &exports_operations, S_IRUGO}, |
1376 | [NFSD_Export_features] = {"export_features", | 1386 | [NFSD_Export_features] = {"export_features", |
1377 | &export_features_operations, S_IRUGO}, | 1387 | &export_features_operations, S_IRUGO}, |