aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-04-25 17:58:50 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-05-31 20:29:37 -0400
commit57b7b43b403136dc18d067909050e8677f97aeed (patch)
treee2c740acdb88c39292aab0ac13b65f76e728e923 /fs/nfsd
parentbc1b542be9aba019ea89ef04da1f3592018a2a60 (diff)
nfsd4: int/__be32 fixes
In each of these cases there's a simple unambiguous correct choice, and no actual bug. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c22
-rw-r--r--fs/nfsd/nfs4xdr.c12
-rw-r--r--fs/nfsd/xdr4.h6
3 files changed, 20 insertions, 20 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 3ccebdc4812c..064f61acfe00 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -886,7 +886,7 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n
886 struct nfsd4_session *new; 886 struct nfsd4_session *new;
887 struct nfsd4_channel_attrs *fchan = &cses->fore_channel; 887 struct nfsd4_channel_attrs *fchan = &cses->fore_channel;
888 int numslots, slotsize; 888 int numslots, slotsize;
889 int status; 889 __be32 status;
890 int idx; 890 int idx;
891 891
892 /* 892 /*
@@ -1477,7 +1477,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
1477 struct nfsd4_exchange_id *exid) 1477 struct nfsd4_exchange_id *exid)
1478{ 1478{
1479 struct nfs4_client *unconf, *conf, *new; 1479 struct nfs4_client *unconf, *conf, *new;
1480 int status; 1480 __be32 status;
1481 unsigned int strhashval; 1481 unsigned int strhashval;
1482 char dname[HEXDIR_LEN]; 1482 char dname[HEXDIR_LEN];
1483 char addr_str[INET6_ADDRSTRLEN]; 1483 char addr_str[INET6_ADDRSTRLEN];
@@ -1599,7 +1599,7 @@ error:
1599 return status; 1599 return status;
1600} 1600}
1601 1601
1602static int 1602static __be32
1603check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse) 1603check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
1604{ 1604{
1605 dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid, 1605 dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid,
@@ -1627,7 +1627,7 @@ check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
1627 */ 1627 */
1628static void 1628static void
1629nfsd4_cache_create_session(struct nfsd4_create_session *cr_ses, 1629nfsd4_cache_create_session(struct nfsd4_create_session *cr_ses,
1630 struct nfsd4_clid_slot *slot, int nfserr) 1630 struct nfsd4_clid_slot *slot, __be32 nfserr)
1631{ 1631{
1632 slot->sl_status = nfserr; 1632 slot->sl_status = nfserr;
1633 memcpy(&slot->sl_cr_ses, cr_ses, sizeof(*cr_ses)); 1633 memcpy(&slot->sl_cr_ses, cr_ses, sizeof(*cr_ses));
@@ -1658,7 +1658,7 @@ nfsd4_replay_create_session(struct nfsd4_create_session *cr_ses,
1658 /* seqid, slotID, slotID, slotID, status */ \ 1658 /* seqid, slotID, slotID, slotID, status */ \
1659 5 ) * sizeof(__be32)) 1659 5 ) * sizeof(__be32))
1660 1660
1661static __be32 check_forechannel_attrs(struct nfsd4_channel_attrs fchannel) 1661static bool check_forechannel_attrs(struct nfsd4_channel_attrs fchannel)
1662{ 1662{
1663 return fchannel.maxreq_sz < NFSD_MIN_REQ_HDR_SEQ_SZ 1663 return fchannel.maxreq_sz < NFSD_MIN_REQ_HDR_SEQ_SZ
1664 || fchannel.maxresp_sz < NFSD_MIN_RESP_HDR_SEQ_SZ; 1664 || fchannel.maxresp_sz < NFSD_MIN_RESP_HDR_SEQ_SZ;
@@ -1674,7 +1674,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
1674 struct nfsd4_session *new; 1674 struct nfsd4_session *new;
1675 struct nfsd4_clid_slot *cs_slot = NULL; 1675 struct nfsd4_clid_slot *cs_slot = NULL;
1676 bool confirm_me = false; 1676 bool confirm_me = false;
1677 int status = 0; 1677 __be32 status = 0;
1678 1678
1679 if (cr_ses->flags & ~SESSION4_FLAG_MASK_A) 1679 if (cr_ses->flags & ~SESSION4_FLAG_MASK_A)
1680 return nfserr_inval; 1680 return nfserr_inval;
@@ -1819,7 +1819,7 @@ nfsd4_destroy_session(struct svc_rqst *r,
1819 struct nfsd4_destroy_session *sessionid) 1819 struct nfsd4_destroy_session *sessionid)
1820{ 1820{
1821 struct nfsd4_session *ses; 1821 struct nfsd4_session *ses;
1822 u32 status = nfserr_badsession; 1822 __be32 status = nfserr_badsession;
1823 1823
1824 /* Notes: 1824 /* Notes:
1825 * - The confirmed nfs4_client->cl_sessionid holds destroyed sessinid 1825 * - The confirmed nfs4_client->cl_sessionid holds destroyed sessinid
@@ -1915,7 +1915,7 @@ nfsd4_sequence(struct svc_rqst *rqstp,
1915 struct nfsd4_session *session; 1915 struct nfsd4_session *session;
1916 struct nfsd4_slot *slot; 1916 struct nfsd4_slot *slot;
1917 struct nfsd4_conn *conn; 1917 struct nfsd4_conn *conn;
1918 int status; 1918 __be32 status;
1919 1919
1920 if (resp->opcnt != 1) 1920 if (resp->opcnt != 1)
1921 return nfserr_sequence_pos; 1921 return nfserr_sequence_pos;
@@ -2020,7 +2020,7 @@ __be32
2020nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc) 2020nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc)
2021{ 2021{
2022 struct nfs4_client *conf, *unconf, *clp; 2022 struct nfs4_client *conf, *unconf, *clp;
2023 int status = 0; 2023 __be32 status = 0;
2024 2024
2025 nfs4_lock_state(); 2025 nfs4_lock_state();
2026 unconf = find_unconfirmed_client(&dc->clientid); 2026 unconf = find_unconfirmed_client(&dc->clientid);
@@ -2056,7 +2056,7 @@ out:
2056__be32 2056__be32
2057nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc) 2057nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc)
2058{ 2058{
2059 int status = 0; 2059 __be32 status = 0;
2060 2060
2061 if (rc->rca_one_fs) { 2061 if (rc->rca_one_fs) {
2062 if (!cstate->current_fh.fh_dentry) 2062 if (!cstate->current_fh.fh_dentry)
@@ -3347,7 +3347,7 @@ static bool stateid_generation_after(stateid_t *a, stateid_t *b)
3347 return (s32)a->si_generation - (s32)b->si_generation > 0; 3347 return (s32)a->si_generation - (s32)b->si_generation > 0;
3348} 3348}
3349 3349
3350static int check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_session) 3350static __be32 check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_session)
3351{ 3351{
3352 /* 3352 /*
3353 * When sessions are used the stateid generation number is ignored 3353 * When sessions are used the stateid generation number is ignored
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 59c5184e6f0d..f7cc41144dc1 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3251,7 +3251,7 @@ nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_w
3251} 3251}
3252 3252
3253static __be32 3253static __be32
3254nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, int nfserr, 3254nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,
3255 struct nfsd4_exchange_id *exid) 3255 struct nfsd4_exchange_id *exid)
3256{ 3256{
3257 __be32 *p; 3257 __be32 *p;
@@ -3306,7 +3306,7 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, int nfserr,
3306} 3306}
3307 3307
3308static __be32 3308static __be32
3309nfsd4_encode_create_session(struct nfsd4_compoundres *resp, int nfserr, 3309nfsd4_encode_create_session(struct nfsd4_compoundres *resp, __be32 nfserr,
3310 struct nfsd4_create_session *sess) 3310 struct nfsd4_create_session *sess)
3311{ 3311{
3312 __be32 *p; 3312 __be32 *p;
@@ -3355,7 +3355,7 @@ nfsd4_encode_create_session(struct nfsd4_compoundres *resp, int nfserr,
3355} 3355}
3356 3356
3357static __be32 3357static __be32
3358nfsd4_encode_destroy_session(struct nfsd4_compoundres *resp, int nfserr, 3358nfsd4_encode_destroy_session(struct nfsd4_compoundres *resp, __be32 nfserr,
3359 struct nfsd4_destroy_session *destroy_session) 3359 struct nfsd4_destroy_session *destroy_session)
3360{ 3360{
3361 return nfserr; 3361 return nfserr;
@@ -3377,7 +3377,7 @@ nfsd4_encode_free_stateid(struct nfsd4_compoundres *resp, int nfserr,
3377} 3377}
3378 3378
3379static __be32 3379static __be32
3380nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr, 3380nfsd4_encode_sequence(struct nfsd4_compoundres *resp, __be32 nfserr,
3381 struct nfsd4_sequence *seq) 3381 struct nfsd4_sequence *seq)
3382{ 3382{
3383 __be32 *p; 3383 __be32 *p;
@@ -3400,7 +3400,7 @@ nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr,
3400} 3400}
3401 3401
3402static __be32 3402static __be32
3403nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, int nfserr, 3403nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, __be32 nfserr,
3404 struct nfsd4_test_stateid *test_stateid) 3404 struct nfsd4_test_stateid *test_stateid)
3405{ 3405{
3406 struct nfsd4_test_stateid_id *stateid, *next; 3406 struct nfsd4_test_stateid_id *stateid, *next;
@@ -3503,7 +3503,7 @@ static nfsd4_enc nfsd4_enc_ops[] = {
3503 * Our se_fmaxresp_cached will always be a multiple of PAGE_SIZE, and so 3503 * Our se_fmaxresp_cached will always be a multiple of PAGE_SIZE, and so
3504 * will be at least a page and will therefore hold the xdr_buf head. 3504 * will be at least a page and will therefore hold the xdr_buf head.
3505 */ 3505 */
3506int nfsd4_check_resp_size(struct nfsd4_compoundres *resp, u32 pad) 3506__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *resp, u32 pad)
3507{ 3507{
3508 struct xdr_buf *xb = &resp->rqstp->rq_res; 3508 struct xdr_buf *xb = &resp->rqstp->rq_res;
3509 struct nfsd4_session *session = NULL; 3509 struct nfsd4_session *session = NULL;
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index 1b3501598ab5..acd127d4ee82 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -60,7 +60,7 @@ struct nfsd4_compound_state {
60 __be32 *datap; 60 __be32 *datap;
61 size_t iovlen; 61 size_t iovlen;
62 u32 minorversion; 62 u32 minorversion;
63 u32 status; 63 __be32 status;
64 stateid_t current_stateid; 64 stateid_t current_stateid;
65 stateid_t save_stateid; 65 stateid_t save_stateid;
66 /* to indicate current and saved state id presents */ 66 /* to indicate current and saved state id presents */
@@ -364,7 +364,7 @@ struct nfsd4_test_stateid_id {
364}; 364};
365 365
366struct nfsd4_test_stateid { 366struct nfsd4_test_stateid {
367 __be32 ts_num_ids; 367 u32 ts_num_ids;
368 struct list_head ts_stateid_list; 368 struct list_head ts_stateid_list;
369}; 369};
370 370
@@ -549,7 +549,7 @@ int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
549 struct nfsd4_compoundargs *); 549 struct nfsd4_compoundargs *);
550int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *, 550int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
551 struct nfsd4_compoundres *); 551 struct nfsd4_compoundres *);
552int nfsd4_check_resp_size(struct nfsd4_compoundres *, u32); 552__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32);
553void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); 553void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
554void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op); 554void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);
555__be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, 555__be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,