summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Tao2014-12-01 01:22:21 +0100
committerTom Haynes2015-02-03 20:06:51 +0100
commit012fa16dca0da6c487dd066829ff0b0954925fe6 (patch)
tree60bb1af7a0bd7c684738432dd8fadc77a93b9472
parentnfs41: add NFS_LAYOUT_RETRY_LAYOUTGET to layout header flags (diff)
downloadkernel-qcow2-linux-012fa16dca0da6c487dd066829ff0b0954925fe6.tar.gz
kernel-qcow2-linux-012fa16dca0da6c487dd066829ff0b0954925fe6.tar.xz
kernel-qcow2-linux-012fa16dca0da6c487dd066829ff0b0954925fe6.zip
nfs: add a helper to set NFS_ODIRECT_RESCHED_WRITES to direct writes
To allow pnfs LD to ask direct writes to be resend. Signed-off-by: Peng Tao <tao.peng@primarydata.com>
-rw-r--r--fs/nfs/direct.c6
-rw-r--r--fs/nfs/internal.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index eb814789f700..4fad6b727eb4 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -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)
{
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index ffe4b7ac9e6b..44e84960a26f 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -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 *);