@@ -190,7 +190,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f
190
190
dp -> dl_vfs_file = stp -> st_vfs_file ;
191
191
dp -> dl_type = type ;
192
192
dp -> dl_ident = cb -> cb_ident ;
193
- dp -> dl_stateid .si_boot = get_seconds () ;
193
+ dp -> dl_stateid .si_boot = boot_time ;
194
194
dp -> dl_stateid .si_stateownerid = current_delegid ++ ;
195
195
dp -> dl_stateid .si_fileid = 0 ;
196
196
dp -> dl_stateid .si_generation = 0 ;
@@ -1884,7 +1884,7 @@ init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *
1884
1884
stp -> st_stateowner = sop ;
1885
1885
get_nfs4_file (fp );
1886
1886
stp -> st_file = fp ;
1887
- stp -> st_stateid .si_boot = get_seconds () ;
1887
+ stp -> st_stateid .si_boot = boot_time ;
1888
1888
stp -> st_stateid .si_stateownerid = sop -> so_id ;
1889
1889
stp -> st_stateid .si_fileid = fp -> fi_id ;
1890
1890
stp -> st_stateid .si_generation = 0 ;
@@ -2733,39 +2733,11 @@ nfs4_check_fh(struct svc_fh *fhp, struct nfs4_stateid *stp)
2733
2733
static int
2734
2734
STALE_STATEID (stateid_t * stateid )
2735
2735
{
2736
- if (time_after ((unsigned long )boot_time ,
2737
- (unsigned long )stateid -> si_boot )) {
2738
- dprintk ("NFSD: stale stateid " STATEID_FMT "!\n" ,
2739
- STATEID_VAL (stateid ));
2740
- return 1 ;
2741
- }
2742
- return 0 ;
2743
- }
2744
-
2745
- static int
2746
- EXPIRED_STATEID (stateid_t * stateid )
2747
- {
2748
- if (time_before ((unsigned long )boot_time ,
2749
- ((unsigned long )stateid -> si_boot )) &&
2750
- time_before ((unsigned long )(stateid -> si_boot + nfsd4_lease ), get_seconds ())) {
2751
- dprintk ("NFSD: expired stateid " STATEID_FMT "!\n" ,
2752
- STATEID_VAL (stateid ));
2753
- return 1 ;
2754
- }
2755
- return 0 ;
2756
- }
2757
-
2758
- static __be32
2759
- stateid_error_map (stateid_t * stateid )
2760
- {
2761
- if (STALE_STATEID (stateid ))
2762
- return nfserr_stale_stateid ;
2763
- if (EXPIRED_STATEID (stateid ))
2764
- return nfserr_expired ;
2765
-
2766
- dprintk ("NFSD: bad stateid " STATEID_FMT "!\n" ,
2736
+ if (stateid -> si_boot == boot_time )
2737
+ return 0 ;
2738
+ dprintk ("NFSD: stale stateid " STATEID_FMT "!\n" ,
2767
2739
STATEID_VAL (stateid ));
2768
- return nfserr_bad_stateid ;
2740
+ return 1 ;
2769
2741
}
2770
2742
2771
2743
static inline int
@@ -2889,10 +2861,8 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
2889
2861
status = nfserr_bad_stateid ;
2890
2862
if (is_delegation_stateid (stateid )) {
2891
2863
dp = find_delegation_stateid (ino , stateid );
2892
- if (!dp ) {
2893
- status = stateid_error_map (stateid );
2864
+ if (!dp )
2894
2865
goto out ;
2895
- }
2896
2866
status = check_stateid_generation (stateid , & dp -> dl_stateid ,
2897
2867
flags );
2898
2868
if (status )
@@ -2905,10 +2875,8 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
2905
2875
* filpp = dp -> dl_vfs_file ;
2906
2876
} else { /* open or lock stateid */
2907
2877
stp = find_stateid (stateid , flags );
2908
- if (!stp ) {
2909
- status = stateid_error_map (stateid );
2878
+ if (!stp )
2910
2879
goto out ;
2911
- }
2912
2880
if (nfs4_check_fh (current_fh , stp ))
2913
2881
goto out ;
2914
2882
if (!stp -> st_stateowner -> so_confirmed )
@@ -2980,7 +2948,7 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
2980
2948
*/
2981
2949
sop = search_close_lru (stateid -> si_stateownerid , flags );
2982
2950
if (sop == NULL )
2983
- return stateid_error_map ( stateid ) ;
2951
+ return nfserr_bad_stateid ;
2984
2952
* sopp = sop ;
2985
2953
goto check_replay ;
2986
2954
}
@@ -3247,10 +3215,8 @@ nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
3247
3215
if (!is_delegation_stateid (stateid ))
3248
3216
goto out ;
3249
3217
dp = find_delegation_stateid (inode , stateid );
3250
- if (!dp ) {
3251
- status = stateid_error_map (stateid );
3218
+ if (!dp )
3252
3219
goto out ;
3253
- }
3254
3220
status = check_stateid_generation (stateid , & dp -> dl_stateid , flags );
3255
3221
if (status )
3256
3222
goto out ;
@@ -3476,7 +3442,7 @@ alloc_init_lock_stateid(struct nfs4_stateowner *sop, struct nfs4_file *fp, struc
3476
3442
stp -> st_stateowner = sop ;
3477
3443
get_nfs4_file (fp );
3478
3444
stp -> st_file = fp ;
3479
- stp -> st_stateid .si_boot = get_seconds () ;
3445
+ stp -> st_stateid .si_boot = boot_time ;
3480
3446
stp -> st_stateid .si_stateownerid = sop -> so_id ;
3481
3447
stp -> st_stateid .si_fileid = fp -> fi_id ;
3482
3448
stp -> st_stateid .si_generation = 0 ;
0 commit comments