aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/internal.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2022-07-22 14:12:18 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2022-07-23 15:28:59 -0400
commit8efc4bbe84a8bdd26e848ed93a8900fad1b44ca2 (patch)
treec18beba49e2b9c0333423954766fd08001d0e549 /fs/nfs/internal.h
parentSUNRPC: Shrink size of struct rpc_task (diff)
downloadlinux-dev-8efc4bbe84a8bdd26e848ed93a8900fad1b44ca2.tar.xz
linux-dev-8efc4bbe84a8bdd26e848ed93a8900fad1b44ca2.zip
nfs: add new nfs_direct_req tracepoint events
Add some new tracepoints to the DIO write code. Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r--fs/nfs/internal.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index af6d261241ff..0cabc7f07d9a 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -877,3 +877,36 @@ static inline void nfs_set_port(struct sockaddr *sap, int *port,
rpc_set_port(sap, *port);
}
+
+struct nfs_direct_req {
+ struct kref kref; /* release manager */
+
+ /* I/O parameters */
+ struct nfs_open_context *ctx; /* file open context info */
+ struct nfs_lock_context *l_ctx; /* Lock context info */
+ struct kiocb * iocb; /* controlling i/o request */
+ struct inode * inode; /* target file of i/o */
+
+ /* completion state */
+ atomic_t io_count; /* i/os we're waiting for */
+ spinlock_t lock; /* protect completion state */
+
+ loff_t io_start; /* Start offset for I/O */
+ ssize_t count, /* bytes actually processed */
+ max_count, /* max expected count */
+ bytes_left, /* bytes left to be sent */
+ error; /* any reported error */
+ struct completion completion; /* wait for i/o completion */
+
+ /* commit state */
+ struct nfs_mds_commit_info mds_cinfo; /* Storage for cinfo */
+ struct pnfs_ds_commit_info ds_cinfo; /* Storage for cinfo */
+ struct work_struct work;
+ int flags;
+ /* for write */
+#define NFS_ODIRECT_DO_COMMIT (1) /* an unstable reply was received */
+#define NFS_ODIRECT_RESCHED_WRITES (2) /* write verification failed */
+ /* for read */
+#define NFS_ODIRECT_SHOULD_DIRTY (3) /* dirty user-space page after read */
+#define NFS_ODIRECT_DONE INT_MAX /* write verification failed */
+};