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/export.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/export.c')
-rw-r--r-- | fs/nfsd/export.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index e56827b88fd2..a3c7d0ceb24f 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -28,9 +28,6 @@ | |||
28 | typedef struct auth_domain svc_client; | 28 | typedef struct auth_domain svc_client; |
29 | typedef struct svc_export svc_export; | 29 | typedef struct svc_export svc_export; |
30 | 30 | ||
31 | static void exp_do_unexport(svc_export *unexp); | ||
32 | static int exp_verify_string(char *cp, int max); | ||
33 | |||
34 | /* | 31 | /* |
35 | * We have two caches. | 32 | * We have two caches. |
36 | * One maps client+vfsmnt+dentry to export options - the export map | 33 | * One maps client+vfsmnt+dentry to export options - the export map |
@@ -802,6 +799,7 @@ exp_find_key(svc_client *clp, int fsid_type, u32 *fsidv, struct cache_req *reqp) | |||
802 | return ek; | 799 | return ek; |
803 | } | 800 | } |
804 | 801 | ||
802 | #ifdef CONFIG_NFSD_DEPRECATED | ||
805 | static int exp_set_key(svc_client *clp, int fsid_type, u32 *fsidv, | 803 | static int exp_set_key(svc_client *clp, int fsid_type, u32 *fsidv, |
806 | struct svc_export *exp) | 804 | struct svc_export *exp) |
807 | { | 805 | { |
@@ -852,6 +850,7 @@ exp_get_fsid_key(svc_client *clp, int fsid) | |||
852 | 850 | ||
853 | return exp_find_key(clp, FSID_NUM, fsidv, NULL); | 851 | return exp_find_key(clp, FSID_NUM, fsidv, NULL); |
854 | } | 852 | } |
853 | #endif | ||
855 | 854 | ||
856 | static svc_export *exp_get_by_name(svc_client *clp, const struct path *path, | 855 | static svc_export *exp_get_by_name(svc_client *clp, const struct path *path, |
857 | struct cache_req *reqp) | 856 | struct cache_req *reqp) |
@@ -893,6 +892,7 @@ static struct svc_export *exp_parent(svc_client *clp, struct path *path) | |||
893 | return exp; | 892 | return exp; |
894 | } | 893 | } |
895 | 894 | ||
895 | #ifdef CONFIG_NFSD_DEPRECATED | ||
896 | /* | 896 | /* |
897 | * Hashtable locking. Write locks are placed only by user processes | 897 | * Hashtable locking. Write locks are placed only by user processes |
898 | * wanting to modify export information. | 898 | * wanting to modify export information. |
@@ -925,6 +925,19 @@ exp_writeunlock(void) | |||
925 | { | 925 | { |
926 | up_write(&hash_sem); | 926 | up_write(&hash_sem); |
927 | } | 927 | } |
928 | #else | ||
929 | |||
930 | /* hash_sem not needed once deprecated interface is removed */ | ||
931 | void exp_readlock(void) {} | ||
932 | static inline void exp_writelock(void){} | ||
933 | void exp_readunlock(void) {} | ||
934 | static inline void exp_writeunlock(void){} | ||
935 | |||
936 | #endif | ||
937 | |||
938 | #ifdef CONFIG_NFSD_DEPRECATED | ||
939 | static void exp_do_unexport(svc_export *unexp); | ||
940 | static int exp_verify_string(char *cp, int max); | ||
928 | 941 | ||
929 | static void exp_fsid_unhash(struct svc_export *exp) | 942 | static void exp_fsid_unhash(struct svc_export *exp) |
930 | { | 943 | { |
@@ -1147,6 +1160,7 @@ out_unlock: | |||
1147 | exp_writeunlock(); | 1160 | exp_writeunlock(); |
1148 | return err; | 1161 | return err; |
1149 | } | 1162 | } |
1163 | #endif /* CONFIG_NFSD_DEPRECATED */ | ||
1150 | 1164 | ||
1151 | /* | 1165 | /* |
1152 | * Obtain the root fh on behalf of a client. | 1166 | * Obtain the root fh on behalf of a client. |
@@ -1529,6 +1543,7 @@ const struct seq_operations nfs_exports_op = { | |||
1529 | .show = e_show, | 1543 | .show = e_show, |
1530 | }; | 1544 | }; |
1531 | 1545 | ||
1546 | #ifdef CONFIG_NFSD_DEPRECATED | ||
1532 | /* | 1547 | /* |
1533 | * Add or modify a client. | 1548 | * Add or modify a client. |
1534 | * Change requests may involve the list of host addresses. The list of | 1549 | * Change requests may involve the list of host addresses. The list of |
@@ -1618,6 +1633,7 @@ exp_verify_string(char *cp, int max) | |||
1618 | printk(KERN_NOTICE "nfsd: couldn't validate string %s\n", cp); | 1633 | printk(KERN_NOTICE "nfsd: couldn't validate string %s\n", cp); |
1619 | return 0; | 1634 | return 0; |
1620 | } | 1635 | } |
1636 | #endif /* CONFIG_NFSD_DEPRECATED */ | ||
1621 | 1637 | ||
1622 | /* | 1638 | /* |
1623 | * Initialize the exports module. | 1639 | * Initialize the exports module. |