File tree Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,14 @@ EXPORT_SYMBOL_GPL(nfs_pgheader_init);
63
63
64
64
void nfs_set_pgio_error (struct nfs_pgio_header * hdr , int error , loff_t pos )
65
65
{
66
- spin_lock (& hdr -> lock );
67
- if (!test_and_set_bit (NFS_IOHDR_ERROR , & hdr -> flags )
68
- || pos < hdr -> io_start + hdr -> good_bytes ) {
66
+ unsigned int new = pos - hdr -> io_start ;
67
+
68
+ if (hdr -> good_bytes > new ) {
69
+ hdr -> good_bytes = new ;
69
70
clear_bit (NFS_IOHDR_EOF , & hdr -> flags );
70
- hdr -> good_bytes = pos - hdr -> io_start ;
71
- hdr -> error = error ;
71
+ if (! test_and_set_bit ( NFS_IOHDR_ERROR , & hdr -> flags ))
72
+ hdr -> error = error ;
72
73
}
73
- spin_unlock (& hdr -> lock );
74
74
}
75
75
76
76
static inline struct nfs_page *
@@ -494,7 +494,6 @@ struct nfs_pgio_header *nfs_pgio_header_alloc(const struct nfs_rw_ops *ops)
494
494
495
495
if (hdr ) {
496
496
INIT_LIST_HEAD (& hdr -> pages );
497
- spin_lock_init (& hdr -> lock );
498
497
hdr -> rw_ops = ops ;
499
498
}
500
499
return hdr ;
Original file line number Diff line number Diff line change @@ -276,16 +276,14 @@ static void nfs_readpage_result(struct rpc_task *task,
276
276
struct nfs_pgio_header * hdr )
277
277
{
278
278
if (hdr -> res .eof ) {
279
- loff_t bound ;
279
+ loff_t pos = hdr -> args .offset + hdr -> res .count ;
280
+ unsigned int new = pos - hdr -> io_start ;
280
281
281
- bound = hdr -> args .offset + hdr -> res .count ;
282
- spin_lock (& hdr -> lock );
283
- if (bound < hdr -> io_start + hdr -> good_bytes ) {
282
+ if (hdr -> good_bytes > new ) {
283
+ hdr -> good_bytes = new ;
284
284
set_bit (NFS_IOHDR_EOF , & hdr -> flags );
285
285
clear_bit (NFS_IOHDR_ERROR , & hdr -> flags );
286
- hdr -> good_bytes = bound - hdr -> io_start ;
287
286
}
288
- spin_unlock (& hdr -> lock );
289
287
} else if (hdr -> res .count < hdr -> args .count )
290
288
nfs_readpage_retry (task , hdr );
291
289
}
Original file line number Diff line number Diff line change @@ -1482,11 +1482,10 @@ struct nfs_pgio_header {
1482
1482
const struct nfs_rw_ops * rw_ops ;
1483
1483
struct nfs_io_completion * io_completion ;
1484
1484
struct nfs_direct_req * dreq ;
1485
- spinlock_t lock ;
1486
- /* fields protected by lock */
1485
+
1487
1486
int pnfs_error ;
1488
1487
int error ; /* merge with pnfs_error */
1489
- unsigned long good_bytes ; /* boundary of good data */
1488
+ unsigned int good_bytes ; /* boundary of good data */
1490
1489
unsigned long flags ;
1491
1490
1492
1491
/*
You can’t perform that action at this time.
0 commit comments