aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-06-24 01:04:03 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:06:33 -0400
commitfd39ca9a808c6026989bc2188868a0574eb37108 (patch)
tree9dbb4df308afd32e1a913e3df9c828863c6f98ee /fs
parenta76b4319ca85b5e3a8098470c623a272d40271cd (diff)
[PATCH] knfsd: nfsd4: make needlessly global code static
This patch contains the following possible cleanups: - make needlessly global code static Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4acl.c4
-rw-r--r--fs/nfsd/nfs4callback.c7
-rw-r--r--fs/nfsd/nfs4idmap.c12
-rw-r--r--fs/nfsd/nfs4state.c57
-rw-r--r--fs/nfsd/nfs4xdr.c4
5 files changed, 43 insertions, 41 deletions
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 11ebf6c4aa5..4a2105552ac 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -125,7 +125,7 @@ static short ace2type(struct nfs4_ace *);
125static int _posix_to_nfsv4_one(struct posix_acl *, struct nfs4_acl *, unsigned int); 125static int _posix_to_nfsv4_one(struct posix_acl *, struct nfs4_acl *, unsigned int);
126static struct posix_acl *_nfsv4_to_posix_one(struct nfs4_acl *, unsigned int); 126static struct posix_acl *_nfsv4_to_posix_one(struct nfs4_acl *, unsigned int);
127int nfs4_acl_add_ace(struct nfs4_acl *, u32, u32, u32, int, uid_t); 127int nfs4_acl_add_ace(struct nfs4_acl *, u32, u32, u32, int, uid_t);
128int nfs4_acl_split(struct nfs4_acl *, struct nfs4_acl *); 128static int nfs4_acl_split(struct nfs4_acl *, struct nfs4_acl *);
129 129
130struct nfs4_acl * 130struct nfs4_acl *
131nfs4_acl_posix_to_nfsv4(struct posix_acl *pacl, struct posix_acl *dpacl, 131nfs4_acl_posix_to_nfsv4(struct posix_acl *pacl, struct posix_acl *dpacl,
@@ -775,7 +775,7 @@ out_err:
775 return pacl; 775 return pacl;
776} 776}
777 777
778int 778static int
779nfs4_acl_split(struct nfs4_acl *acl, struct nfs4_acl *dacl) 779nfs4_acl_split(struct nfs4_acl *acl, struct nfs4_acl *dacl)
780{ 780{
781 struct list_head *h, *n; 781 struct list_head *h, *n;
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 38c3e1c47d8..68bb245491f 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -54,7 +54,6 @@
54 54
55/* declarations */ 55/* declarations */
56static void nfs4_cb_null(struct rpc_task *task); 56static void nfs4_cb_null(struct rpc_task *task);
57extern spinlock_t recall_lock;
58 57
59/* Index of predefined Linux callback client operations */ 58/* Index of predefined Linux callback client operations */
60 59
@@ -329,12 +328,12 @@ out:
329 .p_bufsiz = MAX(NFS4_##argtype##_sz,NFS4_##restype##_sz) << 2, \ 328 .p_bufsiz = MAX(NFS4_##argtype##_sz,NFS4_##restype##_sz) << 2, \
330} 329}
331 330
332struct rpc_procinfo nfs4_cb_procedures[] = { 331static struct rpc_procinfo nfs4_cb_procedures[] = {
333 PROC(CB_NULL, NULL, enc_cb_null, dec_cb_null), 332 PROC(CB_NULL, NULL, enc_cb_null, dec_cb_null),
334 PROC(CB_RECALL, COMPOUND, enc_cb_recall, dec_cb_recall), 333 PROC(CB_RECALL, COMPOUND, enc_cb_recall, dec_cb_recall),
335}; 334};
336 335
337struct rpc_version nfs_cb_version4 = { 336static struct rpc_version nfs_cb_version4 = {
338 .number = 1, 337 .number = 1,
339 .nrprocs = sizeof(nfs4_cb_procedures)/sizeof(nfs4_cb_procedures[0]), 338 .nrprocs = sizeof(nfs4_cb_procedures)/sizeof(nfs4_cb_procedures[0]),
340 .procs = nfs4_cb_procedures 339 .procs = nfs4_cb_procedures
@@ -348,7 +347,7 @@ static struct rpc_version * nfs_cb_version[] = {
348/* 347/*
349 * Use the SETCLIENTID credential 348 * Use the SETCLIENTID credential
350 */ 349 */
351struct rpc_cred * 350static struct rpc_cred *
352nfsd4_lookupcred(struct nfs4_client *clp, int taskflags) 351nfsd4_lookupcred(struct nfs4_client *clp, int taskflags)
353{ 352{
354 struct auth_cred acred; 353 struct auth_cred acred;
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index 4ba540841cf..5605a26efc5 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -104,7 +104,7 @@ ent_update(struct ent *new, struct ent *itm)
104 ent_init(new, itm); 104 ent_init(new, itm);
105} 105}
106 106
107void 107static void
108ent_put(struct cache_head *ch, struct cache_detail *cd) 108ent_put(struct cache_head *ch, struct cache_detail *cd)
109{ 109{
110 if (cache_put(ch, cd)) { 110 if (cache_put(ch, cd)) {
@@ -186,7 +186,7 @@ warn_no_idmapd(struct cache_detail *detail)
186static int idtoname_parse(struct cache_detail *, char *, int); 186static int idtoname_parse(struct cache_detail *, char *, int);
187static struct ent *idtoname_lookup(struct ent *, int); 187static struct ent *idtoname_lookup(struct ent *, int);
188 188
189struct cache_detail idtoname_cache = { 189static struct cache_detail idtoname_cache = {
190 .hash_size = ENT_HASHMAX, 190 .hash_size = ENT_HASHMAX,
191 .hash_table = idtoname_table, 191 .hash_table = idtoname_table,
192 .name = "nfs4.idtoname", 192 .name = "nfs4.idtoname",
@@ -277,7 +277,7 @@ nametoid_hash(struct ent *ent)
277 return hash_str(ent->name, ENT_HASHBITS); 277 return hash_str(ent->name, ENT_HASHBITS);
278} 278}
279 279
280void 280static void
281nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp, 281nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
282 int *blen) 282 int *blen)
283{ 283{
@@ -317,9 +317,9 @@ nametoid_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h)
317} 317}
318 318
319static struct ent *nametoid_lookup(struct ent *, int); 319static struct ent *nametoid_lookup(struct ent *, int);
320int nametoid_parse(struct cache_detail *, char *, int); 320static int nametoid_parse(struct cache_detail *, char *, int);
321 321
322struct cache_detail nametoid_cache = { 322static struct cache_detail nametoid_cache = {
323 .hash_size = ENT_HASHMAX, 323 .hash_size = ENT_HASHMAX,
324 .hash_table = nametoid_table, 324 .hash_table = nametoid_table,
325 .name = "nfs4.nametoid", 325 .name = "nfs4.nametoid",
@@ -330,7 +330,7 @@ struct cache_detail nametoid_cache = {
330 .warn_no_listener = warn_no_idmapd, 330 .warn_no_listener = warn_no_idmapd,
331}; 331};
332 332
333int 333static int
334nametoid_parse(struct cache_detail *cd, char *buf, int buflen) 334nametoid_parse(struct cache_detail *cd, char *buf, int buflen)
335{ 335{
336 struct ent ent, *res; 336 struct ent ent, *res;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 1b2f67f5eef..8a5f777b1e9 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -54,18 +54,21 @@
54/* Globals */ 54/* Globals */
55static time_t lease_time = 90; /* default lease time */ 55static time_t lease_time = 90; /* default lease time */
56static time_t user_lease_time = 90; 56static time_t user_lease_time = 90;
57time_t boot_time; 57static time_t boot_time;
58static int in_grace = 1; 58static int in_grace = 1;
59static u32 current_clientid = 1; 59static u32 current_clientid = 1;
60static u32 current_ownerid = 1; 60static u32 current_ownerid = 1;
61static u32 current_fileid = 1; 61static u32 current_fileid = 1;
62static u32 current_delegid = 1; 62static u32 current_delegid = 1;
63static u32 nfs4_init; 63static u32 nfs4_init;
64stateid_t zerostateid; /* bits all 0 */ 64static stateid_t zerostateid; /* bits all 0 */
65stateid_t onestateid; /* bits all 1 */ 65static stateid_t onestateid; /* bits all 1 */
66
67#define ZERO_STATEID(stateid) (!memcmp((stateid), &zerostateid, sizeof(stateid_t)))
68#define ONE_STATEID(stateid) (!memcmp((stateid), &onestateid, sizeof(stateid_t)))
66 69
67/* forward declarations */ 70/* forward declarations */
68struct nfs4_stateid * find_stateid(stateid_t *stid, int flags); 71static struct nfs4_stateid * find_stateid(stateid_t *stid, int flags);
69static struct nfs4_delegation * find_delegation_stateid(struct inode *ino, stateid_t *stid); 72static struct nfs4_delegation * find_delegation_stateid(struct inode *ino, stateid_t *stid);
70static void release_stateid_lockowners(struct nfs4_stateid *open_stp); 73static void release_stateid_lockowners(struct nfs4_stateid *open_stp);
71 74
@@ -77,10 +80,10 @@ static void release_stateid_lockowners(struct nfs4_stateid *open_stp);
77 */ 80 */
78static DECLARE_MUTEX(client_sema); 81static DECLARE_MUTEX(client_sema);
79 82
80kmem_cache_t *stateowner_slab = NULL; 83static kmem_cache_t *stateowner_slab = NULL;
81kmem_cache_t *file_slab = NULL; 84static kmem_cache_t *file_slab = NULL;
82kmem_cache_t *stateid_slab = NULL; 85static kmem_cache_t *stateid_slab = NULL;
83kmem_cache_t *deleg_slab = NULL; 86static kmem_cache_t *deleg_slab = NULL;
84 87
85void 88void
86nfs4_lock_state(void) 89nfs4_lock_state(void)
@@ -116,7 +119,7 @@ static void release_stateid(struct nfs4_stateid *stp, int flags);
116 */ 119 */
117 120
118/* recall_lock protects the del_recall_lru */ 121/* recall_lock protects the del_recall_lru */
119spinlock_t recall_lock = SPIN_LOCK_UNLOCKED; 122static spinlock_t recall_lock = SPIN_LOCK_UNLOCKED;
120static struct list_head del_recall_lru; 123static struct list_head del_recall_lru;
121 124
122static void 125static void
@@ -456,7 +459,7 @@ check_name(struct xdr_netobj name) {
456 return 1; 459 return 1;
457} 460}
458 461
459void 462static void
460add_to_unconfirmed(struct nfs4_client *clp, unsigned int strhashval) 463add_to_unconfirmed(struct nfs4_client *clp, unsigned int strhashval)
461{ 464{
462 unsigned int idhashval; 465 unsigned int idhashval;
@@ -468,7 +471,7 @@ add_to_unconfirmed(struct nfs4_client *clp, unsigned int strhashval)
468 clp->cl_time = get_seconds(); 471 clp->cl_time = get_seconds();
469} 472}
470 473
471void 474static void
472move_to_confirmed(struct nfs4_client *clp) 475move_to_confirmed(struct nfs4_client *clp)
473{ 476{
474 unsigned int idhashval = clientid_hashval(clp->cl_clientid.cl_id); 477 unsigned int idhashval = clientid_hashval(clp->cl_clientid.cl_id);
@@ -567,7 +570,7 @@ parse_octet(unsigned int *lenp, char **addrp)
567} 570}
568 571
569/* parse and set the setclientid ipv4 callback address */ 572/* parse and set the setclientid ipv4 callback address */
570int 573static int
571parse_ipv4(unsigned int addr_len, char *addr_val, unsigned int *cbaddrp, unsigned short *cbportp) 574parse_ipv4(unsigned int addr_len, char *addr_val, unsigned int *cbaddrp, unsigned short *cbportp)
572{ 575{
573 int temp = 0; 576 int temp = 0;
@@ -603,7 +606,7 @@ parse_ipv4(unsigned int addr_len, char *addr_val, unsigned int *cbaddrp, unsigne
603 return 1; 606 return 1;
604} 607}
605 608
606void 609static void
607gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se) 610gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se)
608{ 611{
609 struct nfs4_callback *cb = &clp->cl_callback; 612 struct nfs4_callback *cb = &clp->cl_callback;
@@ -1186,7 +1189,7 @@ release_stateid(struct nfs4_stateid *stp, int flags)
1186 stp = NULL; 1189 stp = NULL;
1187} 1190}
1188 1191
1189void 1192static void
1190move_to_close_lru(struct nfs4_stateowner *sop) 1193move_to_close_lru(struct nfs4_stateowner *sop)
1191{ 1194{
1192 dprintk("NFSD: move_to_close_lru nfs4_stateowner %p\n", sop); 1195 dprintk("NFSD: move_to_close_lru nfs4_stateowner %p\n", sop);
@@ -1196,7 +1199,7 @@ move_to_close_lru(struct nfs4_stateowner *sop)
1196 sop->so_time = get_seconds(); 1199 sop->so_time = get_seconds();
1197} 1200}
1198 1201
1199void 1202static void
1200release_state_owner(struct nfs4_stateid *stp, int flag) 1203release_state_owner(struct nfs4_stateid *stp, int flag)
1201{ 1204{
1202 struct nfs4_stateowner *sop = stp->st_stateowner; 1205 struct nfs4_stateowner *sop = stp->st_stateowner;
@@ -1250,7 +1253,7 @@ find_file(struct inode *ino)
1250#define TEST_ACCESS(x) ((x > 0 || x < 4)?1:0) 1253#define TEST_ACCESS(x) ((x > 0 || x < 4)?1:0)
1251#define TEST_DENY(x) ((x >= 0 || x < 5)?1:0) 1254#define TEST_DENY(x) ((x >= 0 || x < 5)?1:0)
1252 1255
1253void 1256static void
1254set_access(unsigned int *access, unsigned long bmap) { 1257set_access(unsigned int *access, unsigned long bmap) {
1255 int i; 1258 int i;
1256 1259
@@ -1261,7 +1264,7 @@ set_access(unsigned int *access, unsigned long bmap) {
1261 } 1264 }
1262} 1265}
1263 1266
1264void 1267static void
1265set_deny(unsigned int *deny, unsigned long bmap) { 1268set_deny(unsigned int *deny, unsigned long bmap) {
1266 int i; 1269 int i;
1267 1270
@@ -1287,7 +1290,7 @@ test_share(struct nfs4_stateid *stp, struct nfsd4_open *open) {
1287 * Called to check deny when READ with all zero stateid or 1290 * Called to check deny when READ with all zero stateid or
1288 * WRITE with all zero or all one stateid 1291 * WRITE with all zero or all one stateid
1289 */ 1292 */
1290int 1293static int
1291nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type) 1294nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type)
1292{ 1295{
1293 struct inode *ino = current_fh->fh_dentry->d_inode; 1296 struct inode *ino = current_fh->fh_dentry->d_inode;
@@ -1442,7 +1445,7 @@ int nfsd_change_deleg_cb(struct file_lock **onlist, int arg)
1442 return -EAGAIN; 1445 return -EAGAIN;
1443} 1446}
1444 1447
1445struct lock_manager_operations nfsd_lease_mng_ops = { 1448static struct lock_manager_operations nfsd_lease_mng_ops = {
1446 .fl_break = nfsd_break_deleg_cb, 1449 .fl_break = nfsd_break_deleg_cb,
1447 .fl_release_private = nfsd_release_deleg_cb, 1450 .fl_release_private = nfsd_release_deleg_cb,
1448 .fl_copy_lock = nfsd_copy_lock_deleg_cb, 1451 .fl_copy_lock = nfsd_copy_lock_deleg_cb,
@@ -1915,7 +1918,7 @@ end_grace(void)
1915 in_grace = 0; 1918 in_grace = 0;
1916} 1919}
1917 1920
1918time_t 1921static time_t
1919nfs4_laundromat(void) 1922nfs4_laundromat(void)
1920{ 1923{
1921 struct nfs4_client *clp; 1924 struct nfs4_client *clp;
@@ -1996,7 +1999,7 @@ laundromat_main(void *not_used)
1996/* search ownerid_hashtbl[] and close_lru for stateid owner 1999/* search ownerid_hashtbl[] and close_lru for stateid owner
1997 * (stateid->si_stateownerid) 2000 * (stateid->si_stateownerid)
1998 */ 2001 */
1999struct nfs4_stateowner * 2002static struct nfs4_stateowner *
2000find_openstateowner_id(u32 st_id, int flags) { 2003find_openstateowner_id(u32 st_id, int flags) {
2001 struct nfs4_stateowner *local = NULL; 2004 struct nfs4_stateowner *local = NULL;
2002 2005
@@ -2170,7 +2173,7 @@ out:
2170/* 2173/*
2171 * Checks for sequence id mutating operations. 2174 * Checks for sequence id mutating operations.
2172 */ 2175 */
2173int 2176static int
2174nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *stateid, int flags, struct nfs4_stateowner **sopp, struct nfs4_stateid **stpp, clientid_t *lockclid) 2177nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *stateid, int flags, struct nfs4_stateowner **sopp, struct nfs4_stateid **stpp, clientid_t *lockclid)
2175{ 2178{
2176 int status; 2179 int status;
@@ -2486,7 +2489,7 @@ static struct list_head lock_ownerid_hashtbl[LOCK_HASH_SIZE];
2486static struct list_head lock_ownerstr_hashtbl[LOCK_HASH_SIZE]; 2489static struct list_head lock_ownerstr_hashtbl[LOCK_HASH_SIZE];
2487static struct list_head lockstateid_hashtbl[STATEID_HASH_SIZE]; 2490static struct list_head lockstateid_hashtbl[STATEID_HASH_SIZE];
2488 2491
2489struct nfs4_stateid * 2492static struct nfs4_stateid *
2490find_stateid(stateid_t *stid, int flags) 2493find_stateid(stateid_t *stid, int flags)
2491{ 2494{
2492 struct nfs4_stateid *local = NULL; 2495 struct nfs4_stateid *local = NULL;
@@ -2550,7 +2553,7 @@ nfs4_transform_lock_offset(struct file_lock *lock)
2550 lock->fl_end = OFFSET_MAX; 2553 lock->fl_end = OFFSET_MAX;
2551} 2554}
2552 2555
2553int 2556static int
2554nfs4_verify_lock_stateowner(struct nfs4_stateowner *sop, unsigned int hashval) 2557nfs4_verify_lock_stateowner(struct nfs4_stateowner *sop, unsigned int hashval)
2555{ 2558{
2556 struct nfs4_stateowner *local = NULL; 2559 struct nfs4_stateowner *local = NULL;
@@ -2660,7 +2663,7 @@ alloc_init_lock_stateowner(unsigned int strhashval, struct nfs4_client *clp, str
2660 return sop; 2663 return sop;
2661} 2664}
2662 2665
2663struct nfs4_stateid * 2666static struct nfs4_stateid *
2664alloc_init_lock_stateid(struct nfs4_stateowner *sop, struct nfs4_file *fp, struct nfs4_stateid *open_stp) 2667alloc_init_lock_stateid(struct nfs4_stateowner *sop, struct nfs4_file *fp, struct nfs4_stateid *open_stp)
2665{ 2668{
2666 struct nfs4_stateid *stp; 2669 struct nfs4_stateid *stp;
@@ -2691,7 +2694,7 @@ out:
2691 return stp; 2694 return stp;
2692} 2695}
2693 2696
2694int 2697static int
2695check_lock_length(u64 offset, u64 length) 2698check_lock_length(u64 offset, u64 length)
2696{ 2699{
2697 return ((length == 0) || ((length != ~(u64)0) && 2700 return ((length == 0) || ((length != ~(u64)0) &&
@@ -3149,7 +3152,7 @@ nfs4_release_reclaim(void)
3149 3152
3150/* 3153/*
3151 * called from OPEN, CLAIM_PREVIOUS with a new clientid. */ 3154 * called from OPEN, CLAIM_PREVIOUS with a new clientid. */
3152struct nfs4_client_reclaim * 3155static struct nfs4_client_reclaim *
3153nfs4_find_reclaim_client(clientid_t *clid) 3156nfs4_find_reclaim_client(clientid_t *clid)
3154{ 3157{
3155 unsigned int strhashval; 3158 unsigned int strhashval;
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index cfe978a72ce..91fb171d2ac 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -136,7 +136,7 @@ xdr_error: \
136 } \ 136 } \
137} while (0) 137} while (0)
138 138
139u32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes) 139static u32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes)
140{ 140{
141 /* We want more bytes than seem to be available. 141 /* We want more bytes than seem to be available.
142 * Maybe we need a new page, maybe we have just run out 142 * Maybe we need a new page, maybe we have just run out
@@ -190,7 +190,7 @@ defer_free(struct nfsd4_compoundargs *argp,
190 return 0; 190 return 0;
191} 191}
192 192
193char *savemem(struct nfsd4_compoundargs *argp, u32 *p, int nbytes) 193static char *savemem(struct nfsd4_compoundargs *argp, u32 *p, int nbytes)
194{ 194{
195 void *new = NULL; 195 void *new = NULL;
196 if (p == argp->tmp) { 196 if (p == argp->tmp) {