Commit 57b7b43b403136dc18d067909050e8677f97aeed

Authored by J. Bruce Fields
1 parent bc1b542be9

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>

Showing 3 changed files with 20 additions and 20 deletions Side-by-side Diff

... ... @@ -886,7 +886,7 @@
886 886 struct nfsd4_session *new;
887 887 struct nfsd4_channel_attrs *fchan = &cses->fore_channel;
888 888 int numslots, slotsize;
889   - int status;
  889 + __be32 status;
890 890 int idx;
891 891  
892 892 /*
... ... @@ -1477,7 +1477,7 @@
1477 1477 struct nfsd4_exchange_id *exid)
1478 1478 {
1479 1479 struct nfs4_client *unconf, *conf, *new;
1480   - int status;
  1480 + __be32 status;
1481 1481 unsigned int strhashval;
1482 1482 char dname[HEXDIR_LEN];
1483 1483 char addr_str[INET6_ADDRSTRLEN];
... ... @@ -1599,7 +1599,7 @@
1599 1599 return status;
1600 1600 }
1601 1601  
1602   -static int
  1602 +static __be32
1603 1603 check_slot_seqid(u32 seqid, u32 slot_seqid, int slot_inuse)
1604 1604 {
1605 1605 dprintk("%s enter. seqid %d slot_seqid %d\n", __func__, seqid,
... ... @@ -1627,7 +1627,7 @@
1627 1627 */
1628 1628 static void
1629 1629 nfsd4_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 1632 slot->sl_status = nfserr;
1633 1633 memcpy(&slot->sl_cr_ses, cr_ses, sizeof(*cr_ses));
... ... @@ -1658,7 +1658,7 @@
1658 1658 /* seqid, slotID, slotID, slotID, status */ \
1659 1659 5 ) * sizeof(__be32))
1660 1660  
1661   -static __be32 check_forechannel_attrs(struct nfsd4_channel_attrs fchannel)
  1661 +static bool check_forechannel_attrs(struct nfsd4_channel_attrs fchannel)
1662 1662 {
1663 1663 return fchannel.maxreq_sz < NFSD_MIN_REQ_HDR_SEQ_SZ
1664 1664 || fchannel.maxresp_sz < NFSD_MIN_RESP_HDR_SEQ_SZ;
... ... @@ -1674,7 +1674,7 @@
1674 1674 struct nfsd4_session *new;
1675 1675 struct nfsd4_clid_slot *cs_slot = NULL;
1676 1676 bool confirm_me = false;
1677   - int status = 0;
  1677 + __be32 status = 0;
1678 1678  
1679 1679 if (cr_ses->flags & ~SESSION4_FLAG_MASK_A)
1680 1680 return nfserr_inval;
... ... @@ -1819,7 +1819,7 @@
1819 1819 struct nfsd4_destroy_session *sessionid)
1820 1820 {
1821 1821 struct nfsd4_session *ses;
1822   - u32 status = nfserr_badsession;
  1822 + __be32 status = nfserr_badsession;
1823 1823  
1824 1824 /* Notes:
1825 1825 * - The confirmed nfs4_client->cl_sessionid holds destroyed sessinid
... ... @@ -1915,7 +1915,7 @@
1915 1915 struct nfsd4_session *session;
1916 1916 struct nfsd4_slot *slot;
1917 1917 struct nfsd4_conn *conn;
1918   - int status;
  1918 + __be32 status;
1919 1919  
1920 1920 if (resp->opcnt != 1)
1921 1921 return nfserr_sequence_pos;
... ... @@ -2020,7 +2020,7 @@
2020 2020 nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc)
2021 2021 {
2022 2022 struct nfs4_client *conf, *unconf, *clp;
2023   - int status = 0;
  2023 + __be32 status = 0;
2024 2024  
2025 2025 nfs4_lock_state();
2026 2026 unconf = find_unconfirmed_client(&dc->clientid);
... ... @@ -2056,7 +2056,7 @@
2056 2056 __be32
2057 2057 nfsd4_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 2061 if (rc->rca_one_fs) {
2062 2062 if (!cstate->current_fh.fh_dentry)
... ... @@ -3347,7 +3347,7 @@
3347 3347 return (s32)a->si_generation - (s32)b->si_generation > 0;
3348 3348 }
3349 3349  
3350   -static int check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_session)
  3350 +static __be32 check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_session)
3351 3351 {
3352 3352 /*
3353 3353 * When sessions are used the stateid generation number is ignored
... ... @@ -3251,7 +3251,7 @@
3251 3251 }
3252 3252  
3253 3253 static __be32
3254   -nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, int nfserr,
  3254 +nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,
3255 3255 struct nfsd4_exchange_id *exid)
3256 3256 {
3257 3257 __be32 *p;
... ... @@ -3306,7 +3306,7 @@
3306 3306 }
3307 3307  
3308 3308 static __be32
3309   -nfsd4_encode_create_session(struct nfsd4_compoundres *resp, int nfserr,
  3309 +nfsd4_encode_create_session(struct nfsd4_compoundres *resp, __be32 nfserr,
3310 3310 struct nfsd4_create_session *sess)
3311 3311 {
3312 3312 __be32 *p;
... ... @@ -3355,7 +3355,7 @@
3355 3355 }
3356 3356  
3357 3357 static __be32
3358   -nfsd4_encode_destroy_session(struct nfsd4_compoundres *resp, int nfserr,
  3358 +nfsd4_encode_destroy_session(struct nfsd4_compoundres *resp, __be32 nfserr,
3359 3359 struct nfsd4_destroy_session *destroy_session)
3360 3360 {
3361 3361 return nfserr;
... ... @@ -3377,7 +3377,7 @@
3377 3377 }
3378 3378  
3379 3379 static __be32
3380   -nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr,
  3380 +nfsd4_encode_sequence(struct nfsd4_compoundres *resp, __be32 nfserr,
3381 3381 struct nfsd4_sequence *seq)
3382 3382 {
3383 3383 __be32 *p;
... ... @@ -3400,7 +3400,7 @@
3400 3400 }
3401 3401  
3402 3402 static __be32
3403   -nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, int nfserr,
  3403 +nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, __be32 nfserr,
3404 3404 struct nfsd4_test_stateid *test_stateid)
3405 3405 {
3406 3406 struct nfsd4_test_stateid_id *stateid, *next;
... ... @@ -3503,7 +3503,7 @@
3503 3503 * Our se_fmaxresp_cached will always be a multiple of PAGE_SIZE, and so
3504 3504 * will be at least a page and will therefore hold the xdr_buf head.
3505 3505 */
3506   -int 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 3508 struct xdr_buf *xb = &resp->rqstp->rq_res;
3509 3509 struct nfsd4_session *session = NULL;
... ... @@ -60,7 +60,7 @@
60 60 __be32 *datap;
61 61 size_t iovlen;
62 62 u32 minorversion;
63   - u32 status;
  63 + __be32 status;
64 64 stateid_t current_stateid;
65 65 stateid_t save_stateid;
66 66 /* to indicate current and saved state id presents */
... ... @@ -364,7 +364,7 @@
364 364 };
365 365  
366 366 struct nfsd4_test_stateid {
367   - __be32 ts_num_ids;
  367 + u32 ts_num_ids;
368 368 struct list_head ts_stateid_list;
369 369 };
370 370  
... ... @@ -549,7 +549,7 @@
549 549 struct nfsd4_compoundargs *);
550 550 int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
551 551 struct nfsd4_compoundres *);
552   -int nfsd4_check_resp_size(struct nfsd4_compoundres *, u32);
  552 +__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32);
553 553 void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
554 554 void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);
555 555 __be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,