Commit fd6d93c2 authored by Mike Snitzer's avatar Mike Snitzer Committed by Anna Schumaker
Browse files

nfs/localio: make trace_nfs_local_open_fh more useful



Always trigger trace event when LOCALIO opens a file.

Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarAnna Schumaker <anna.schumaker@oracle.com>
parent d11f6cd1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -231,13 +231,13 @@ __nfs_local_open_fh(struct nfs_client *clp, const struct cred *cred,
		    struct nfsd_file __rcu **pnf,
		    const fmode_t mode)
{
	int status = 0;
	struct nfsd_file *localio;

	localio = nfs_open_local_fh(&clp->cl_uuid, clp->cl_rpcclient,
				    cred, fh, nfl, pnf, mode);
	if (IS_ERR(localio)) {
		int status = PTR_ERR(localio);
		trace_nfs_local_open_fh(fh, mode, status);
		status = PTR_ERR(localio);
		switch (status) {
		case -ENOMEM:
		case -ENXIO:
@@ -247,6 +247,7 @@ __nfs_local_open_fh(struct nfs_client *clp, const struct cred *cred,
			nfs_local_probe(clp);
		}
	}
	trace_nfs_local_open_fh(fh, mode, status);
	return localio;
}

+3 −3
Original line number Diff line number Diff line
@@ -1846,10 +1846,10 @@ TRACE_EVENT(nfs_local_open_fh,
		),

		TP_printk(
			"error=%d fhandle=0x%08x mode=%s",
			__entry->error,
			"fhandle=0x%08x mode=%s result=%d",
			__entry->fhandle,
			show_fs_fmode_flags(__entry->fmode)
			show_fs_fmode_flags(__entry->fmode),
			__entry->error
		)
);