summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2017-06-28 19:34:15 +0200
committerJ. Bruce Fields <bfields@redhat.com>2017-06-28 19:34:15 +0200
commit9a1d168e1bc2893120bb7c0d9932dd22f97d0b55 (patch)
treef7d419f1601419aa0aebda102a6b14bdf7653443 /fs/nfs/pnfs.h
parentnfsd4: const-ify nfsd4_ops (diff)
parentLinux 4.12-rc5 (diff)
downloadlinux-9a1d168e1bc2893120bb7c0d9932dd22f97d0b55.tar.xz
linux-9a1d168e1bc2893120bb7c0d9932dd22f97d0b55.zip
Merge tag 'v4.12-rc5' into nfsd tree
Update to get f0c3192ceee3 "virtio_net: lower limit on buffer size". That bug was interfering with my nfsd testing.
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 2d05b756a8d6..99731e3e332f 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -593,6 +593,16 @@ pnfs_lseg_range_intersecting(const struct pnfs_layout_range *l1,
return pnfs_is_range_intersecting(l1->offset, end1, l2->offset, end2);
}
+static inline bool
+pnfs_lseg_request_intersecting(struct pnfs_layout_segment *lseg, struct nfs_page *req)
+{
+ u64 seg_last = pnfs_end_offset(lseg->pls_range.offset, lseg->pls_range.length);
+ u64 req_last = req_offset(req) + req->wb_bytes;
+
+ return pnfs_is_range_intersecting(lseg->pls_range.offset, seg_last,
+ req_offset(req), req_last);
+}
+
extern unsigned int layoutstats_timer;
#ifdef NFS_DEBUG