Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfs/localio: make trace_nfs_local_open_fh more useful

Always trigger trace event when LOCALIO opens a file.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

authored by

Mike Snitzer and committed by
Anna Schumaker
fd6d93c2 d11f6cd1

+6 -5
+3 -2
fs/nfs/localio.c
··· 231 231 struct nfsd_file __rcu **pnf, 232 232 const fmode_t mode) 233 233 { 234 + int status = 0; 234 235 struct nfsd_file *localio; 235 236 236 237 localio = nfs_open_local_fh(&clp->cl_uuid, clp->cl_rpcclient, 237 238 cred, fh, nfl, pnf, mode); 238 239 if (IS_ERR(localio)) { 239 - int status = PTR_ERR(localio); 240 - trace_nfs_local_open_fh(fh, mode, status); 240 + status = PTR_ERR(localio); 241 241 switch (status) { 242 242 case -ENOMEM: 243 243 case -ENXIO: ··· 247 247 nfs_local_probe(clp); 248 248 } 249 249 } 250 + trace_nfs_local_open_fh(fh, mode, status); 250 251 return localio; 251 252 } 252 253
+3 -3
fs/nfs/nfstrace.h
··· 1846 1846 ), 1847 1847 1848 1848 TP_printk( 1849 - "error=%d fhandle=0x%08x mode=%s", 1850 - __entry->error, 1849 + "fhandle=0x%08x mode=%s result=%d", 1851 1850 __entry->fhandle, 1852 - show_fs_fmode_flags(__entry->fmode) 1851 + show_fs_fmode_flags(__entry->fmode), 1852 + __entry->error 1853 1853 ) 1854 1854 ); 1855 1855