#include <linux/security.h>
#include <linux/crc32.h>
#include <linux/nfs_page.h>
+#include <linux/sdt.h>
#define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS)
return 0;
}
#endif
+
+#define DTRACE_IO_NFS(name, rw, size, inode) \
+ if (DTRACE_IO_ENABLED(name)) { \
+ struct bio bio = { \
+ .bi_rw = rw, \
+ .bi_flags = (1 << BIO_USER_MAPPED), \
+ .bi_iter.bi_size = size, \
+ .bi_iter.bi_sector = NFS_FILEID(inode), \
+ }; \
+ DTRACE_IO(name, struct bio * : (bufinfo_t *, \
+ devinfo_t *), &bio, \
+ struct file * : fileinfo_t *, NULL); \
+}
struct inode *inode = hdr->inode;
int swap_flags = IS_SWAPFILE(inode) ? NFS_RPC_SWAPFLAGS : 0;
+ DTRACE_IO_NFS(start, 0, hdr->args.count, hdr->inode);
+
task_setup_data->flags |= swap_flags;
rpc_ops->read_setup(hdr, msg);
}
struct inode *inode)
{
int status = NFS_PROTO(inode)->read_done(task, hdr);
+ DTRACE_IO_NFS(done, 0, hdr->res.count, hdr->inode);
if (status != 0)
return status;
task_setup_data->priority = priority;
rpc_ops->write_setup(hdr, msg);
+ DTRACE_IO_NFS(start, REQ_WRITE, hdr->args.count, hdr->inode);
+
nfs4_state_protect_write(NFS_SERVER(hdr->inode)->nfs_client,
&task_setup_data->rpc_client, msg, hdr);
}
* depend on tighter cache coherency when writing.
*/
status = NFS_PROTO(inode)->write_done(task, hdr);
+ DTRACE_IO_NFS(done, REQ_WRITE, hdr->res.count, hdr->inode);
if (status != 0)
return status;
nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, hdr->res.count);