nfs: add a helper to set NFS_ODIRECT_RESCHED_WRITES to direct writes
authorPeng Tao <tao.peng@primarydata.com>
Mon, 1 Dec 2014 00:22:21 +0000 (08:22 +0800)
committerTom Haynes <loghyr@primarydata.com>
Tue, 3 Feb 2015 19:06:51 +0000 (11:06 -0800)
To allow pnfs LD to ask direct writes to be resend.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
fs/nfs/direct.c
fs/nfs/internal.h

index eb814789f7002c0093da740a543e3a2393885fe2..4fad6b727eb441c69ce755bb59146576b180fcc3 100644 (file)
@@ -116,6 +116,12 @@ static inline int put_dreq(struct nfs_direct_req *dreq)
        return atomic_dec_and_test(&dreq->io_count);
 }
 
+void nfs_direct_set_resched_writes(struct nfs_direct_req *dreq)
+{
+       dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
+}
+EXPORT_SYMBOL_GPL(nfs_direct_set_resched_writes);
+
 static void
 nfs_direct_good_bytes(struct nfs_direct_req *dreq, struct nfs_pgio_header *hdr)
 {
index ffe4b7ac9e6beb6ae1b202b8c0c6d93a9d8fe4ff..44e84960a26f6b71335be43ec7db2e96a98b7d27 100644 (file)
@@ -502,6 +502,7 @@ static inline void nfs_inode_dio_wait(struct inode *inode)
        inode_dio_wait(inode);
 }
 extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq);
+extern void nfs_direct_set_resched_writes(struct nfs_direct_req *dreq);
 
 /* nfs4proc.c */
 extern void __nfs4_read_done_cb(struct nfs_pgio_header *);