Skip to content

Commit 8c10cbd

Browse files
Benny HalevyJ. Bruce Fields
authored andcommitted
nfsd: use STATEID_FMT and STATEID_VAL for printing stateids
Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
1 parent 1b7e040 commit 8c10cbd

2 files changed

Lines changed: 23 additions & 30 deletions

File tree

‎fs/nfsd/nfs4state.c‎

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,11 +2416,8 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta
24162416

24172417
memcpy(&open->op_delegate_stateid, &dp->dl_stateid, sizeof(dp->dl_stateid));
24182418

2419-
dprintk("NFSD: delegation stateid=(%08x/%08x/%08x/%08x)\n\n",
2420-
dp->dl_stateid.si_boot,
2421-
dp->dl_stateid.si_stateownerid,
2422-
dp->dl_stateid.si_fileid,
2423-
dp->dl_stateid.si_generation);
2419+
dprintk("NFSD: delegation stateid=" STATEID_FMT "\n",
2420+
STATEID_VAL(&dp->dl_stateid));
24242421
out:
24252422
if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS
24262423
&& flag == NFS4_OPEN_DELEGATE_NONE
@@ -2510,9 +2507,8 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
25102507

25112508
status = nfs_ok;
25122509

2513-
dprintk("nfs4_process_open2: stateid=(%08x/%08x/%08x/%08x)\n",
2514-
stp->st_stateid.si_boot, stp->st_stateid.si_stateownerid,
2515-
stp->st_stateid.si_fileid, stp->st_stateid.si_generation);
2510+
dprintk("%s: stateid=" STATEID_FMT "\n", __func__,
2511+
STATEID_VAL(&stp->st_stateid));
25162512
out:
25172513
if (fp)
25182514
put_nfs4_file(fp);
@@ -2678,9 +2674,8 @@ STALE_STATEID(stateid_t *stateid)
26782674
{
26792675
if (time_after((unsigned long)boot_time,
26802676
(unsigned long)stateid->si_boot)) {
2681-
dprintk("NFSD: stale stateid (%08x/%08x/%08x/%08x)!\n",
2682-
stateid->si_boot, stateid->si_stateownerid,
2683-
stateid->si_fileid, stateid->si_generation);
2677+
dprintk("NFSD: stale stateid " STATEID_FMT "!\n",
2678+
STATEID_VAL(stateid));
26842679
return 1;
26852680
}
26862681
return 0;
@@ -2692,9 +2687,8 @@ EXPIRED_STATEID(stateid_t *stateid)
26922687
if (time_before((unsigned long)boot_time,
26932688
((unsigned long)stateid->si_boot)) &&
26942689
time_before((unsigned long)(stateid->si_boot + lease_time), get_seconds())) {
2695-
dprintk("NFSD: expired stateid (%08x/%08x/%08x/%08x)!\n",
2696-
stateid->si_boot, stateid->si_stateownerid,
2697-
stateid->si_fileid, stateid->si_generation);
2690+
dprintk("NFSD: expired stateid " STATEID_FMT "!\n",
2691+
STATEID_VAL(stateid));
26982692
return 1;
26992693
}
27002694
return 0;
@@ -2708,9 +2702,8 @@ stateid_error_map(stateid_t *stateid)
27082702
if (EXPIRED_STATEID(stateid))
27092703
return nfserr_expired;
27102704

2711-
dprintk("NFSD: bad stateid (%08x/%08x/%08x/%08x)!\n",
2712-
stateid->si_boot, stateid->si_stateownerid,
2713-
stateid->si_fileid, stateid->si_generation);
2705+
dprintk("NFSD: bad stateid " STATEID_FMT "!\n",
2706+
STATEID_VAL(stateid));
27142707
return nfserr_bad_stateid;
27152708
}
27162709

@@ -2896,10 +2889,8 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
28962889
struct svc_fh *current_fh = &cstate->current_fh;
28972890
__be32 status;
28982891

2899-
dprintk("NFSD: preprocess_seqid_op: seqid=%d "
2900-
"stateid = (%08x/%08x/%08x/%08x)\n", seqid,
2901-
stateid->si_boot, stateid->si_stateownerid, stateid->si_fileid,
2902-
stateid->si_generation);
2892+
dprintk("NFSD: %s: seqid=%d stateid = " STATEID_FMT "\n", __func__,
2893+
seqid, STATEID_VAL(stateid));
29032894

29042895
*stpp = NULL;
29052896
*sopp = NULL;
@@ -3031,12 +3022,8 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
30313022
sop->so_confirmed = 1;
30323023
update_stateid(&stp->st_stateid);
30333024
memcpy(&oc->oc_resp_stateid, &stp->st_stateid, sizeof(stateid_t));
3034-
dprintk("NFSD: nfsd4_open_confirm: success, seqid=%d "
3035-
"stateid=(%08x/%08x/%08x/%08x)\n", oc->oc_seqid,
3036-
stp->st_stateid.si_boot,
3037-
stp->st_stateid.si_stateownerid,
3038-
stp->st_stateid.si_fileid,
3039-
stp->st_stateid.si_generation);
3025+
dprintk("NFSD: %s: success, seqid=%d stateid=" STATEID_FMT "\n",
3026+
__func__, oc->oc_seqid, STATEID_VAL(&stp->st_stateid));
30403027

30413028
nfsd4_create_clid_dir(sop->so_client);
30423029
out:
@@ -3295,9 +3282,8 @@ find_delegation_stateid(struct inode *ino, stateid_t *stid)
32953282
struct nfs4_file *fp;
32963283
struct nfs4_delegation *dl;
32973284

3298-
dprintk("NFSD:find_delegation_stateid stateid=(%08x/%08x/%08x/%08x)\n",
3299-
stid->si_boot, stid->si_stateownerid,
3300-
stid->si_fileid, stid->si_generation);
3285+
dprintk("NFSD: %s: stateid=" STATEID_FMT "\n", __func__,
3286+
STATEID_VAL(stid));
33013287

33023288
fp = find_file(ino);
33033289
if (!fp)

‎include/linux/nfsd/state.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ typedef struct {
6060
#define si_stateownerid si_opaque.so_stateownerid
6161
#define si_fileid si_opaque.so_fileid
6262

63+
#define STATEID_FMT "(%08x/%08x/%08x/%08x)"
64+
#define STATEID_VAL(s) \
65+
(s)->si_boot, \
66+
(s)->si_stateownerid, \
67+
(s)->si_fileid, \
68+
(s)->si_generation
69+
6370
struct nfsd4_cb_sequence {
6471
/* args/res */
6572
u32 cbs_minorversion;

0 commit comments

Comments
 (0)