Loading fs/nfs/pagelist.c +6 −7 Original line number Diff line number Diff line Loading @@ -63,14 +63,14 @@ EXPORT_SYMBOL_GPL(nfs_pgheader_init); void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos) { spin_lock(&hdr->lock); if (!test_and_set_bit(NFS_IOHDR_ERROR, &hdr->flags) || pos < hdr->io_start + hdr->good_bytes) { unsigned int new = pos - hdr->io_start; if (hdr->good_bytes > new) { hdr->good_bytes = new; clear_bit(NFS_IOHDR_EOF, &hdr->flags); hdr->good_bytes = pos - hdr->io_start; if (!test_and_set_bit(NFS_IOHDR_ERROR, &hdr->flags)) hdr->error = error; } spin_unlock(&hdr->lock); } static inline struct nfs_page * Loading Loading @@ -494,7 +494,6 @@ struct nfs_pgio_header *nfs_pgio_header_alloc(const struct nfs_rw_ops *ops) if (hdr) { INIT_LIST_HEAD(&hdr->pages); spin_lock_init(&hdr->lock); hdr->rw_ops = ops; } return hdr; Loading fs/nfs/read.c +4 −6 Original line number Diff line number Diff line Loading @@ -276,16 +276,14 @@ static void nfs_readpage_result(struct rpc_task *task, struct nfs_pgio_header *hdr) { if (hdr->res.eof) { loff_t bound; loff_t pos = hdr->args.offset + hdr->res.count; unsigned int new = pos - hdr->io_start; bound = hdr->args.offset + hdr->res.count; spin_lock(&hdr->lock); if (bound < hdr->io_start + hdr->good_bytes) { if (hdr->good_bytes > new) { hdr->good_bytes = new; set_bit(NFS_IOHDR_EOF, &hdr->flags); clear_bit(NFS_IOHDR_ERROR, &hdr->flags); hdr->good_bytes = bound - hdr->io_start; } spin_unlock(&hdr->lock); } else if (hdr->res.count < hdr->args.count) nfs_readpage_retry(task, hdr); } Loading include/linux/nfs_xdr.h +2 −3 Original line number Diff line number Diff line Loading @@ -1482,11 +1482,10 @@ struct nfs_pgio_header { const struct nfs_rw_ops *rw_ops; struct nfs_io_completion *io_completion; struct nfs_direct_req *dreq; spinlock_t lock; /* fields protected by lock */ int pnfs_error; int error; /* merge with pnfs_error */ unsigned long good_bytes; /* boundary of good data */ unsigned int good_bytes; /* boundary of good data */ unsigned long flags; /* Loading Loading
fs/nfs/pagelist.c +6 −7 Original line number Diff line number Diff line Loading @@ -63,14 +63,14 @@ EXPORT_SYMBOL_GPL(nfs_pgheader_init); void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos) { spin_lock(&hdr->lock); if (!test_and_set_bit(NFS_IOHDR_ERROR, &hdr->flags) || pos < hdr->io_start + hdr->good_bytes) { unsigned int new = pos - hdr->io_start; if (hdr->good_bytes > new) { hdr->good_bytes = new; clear_bit(NFS_IOHDR_EOF, &hdr->flags); hdr->good_bytes = pos - hdr->io_start; if (!test_and_set_bit(NFS_IOHDR_ERROR, &hdr->flags)) hdr->error = error; } spin_unlock(&hdr->lock); } static inline struct nfs_page * Loading Loading @@ -494,7 +494,6 @@ struct nfs_pgio_header *nfs_pgio_header_alloc(const struct nfs_rw_ops *ops) if (hdr) { INIT_LIST_HEAD(&hdr->pages); spin_lock_init(&hdr->lock); hdr->rw_ops = ops; } return hdr; Loading
fs/nfs/read.c +4 −6 Original line number Diff line number Diff line Loading @@ -276,16 +276,14 @@ static void nfs_readpage_result(struct rpc_task *task, struct nfs_pgio_header *hdr) { if (hdr->res.eof) { loff_t bound; loff_t pos = hdr->args.offset + hdr->res.count; unsigned int new = pos - hdr->io_start; bound = hdr->args.offset + hdr->res.count; spin_lock(&hdr->lock); if (bound < hdr->io_start + hdr->good_bytes) { if (hdr->good_bytes > new) { hdr->good_bytes = new; set_bit(NFS_IOHDR_EOF, &hdr->flags); clear_bit(NFS_IOHDR_ERROR, &hdr->flags); hdr->good_bytes = bound - hdr->io_start; } spin_unlock(&hdr->lock); } else if (hdr->res.count < hdr->args.count) nfs_readpage_retry(task, hdr); } Loading
include/linux/nfs_xdr.h +2 −3 Original line number Diff line number Diff line Loading @@ -1482,11 +1482,10 @@ struct nfs_pgio_header { const struct nfs_rw_ops *rw_ops; struct nfs_io_completion *io_completion; struct nfs_direct_req *dreq; spinlock_t lock; /* fields protected by lock */ int pnfs_error; int error; /* merge with pnfs_error */ unsigned long good_bytes; /* boundary of good data */ unsigned int good_bytes; /* boundary of good data */ unsigned long flags; /* Loading