Skip to content

Commit b76278a

Browse files
committed
NFSD: Clean up the show_nf_may macro
Display all currently possible NFSD_MAY permission flags. Move and rename show_nf_may with a more generic name because the NFSD_MAY permission flags are used in other places besides the file cache. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 156708a commit b76278a

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

fs/nfsd/trace.h

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@
1212
#include "export.h"
1313
#include "nfsfh.h"
1414

15+
#define show_nfsd_may_flags(x) \
16+
__print_flags(x, "|", \
17+
{ NFSD_MAY_EXEC, "EXEC" }, \
18+
{ NFSD_MAY_WRITE, "WRITE" }, \
19+
{ NFSD_MAY_READ, "READ" }, \
20+
{ NFSD_MAY_SATTR, "SATTR" }, \
21+
{ NFSD_MAY_TRUNC, "TRUNC" }, \
22+
{ NFSD_MAY_LOCK, "LOCK" }, \
23+
{ NFSD_MAY_OWNER_OVERRIDE, "OWNER_OVERRIDE" }, \
24+
{ NFSD_MAY_LOCAL_ACCESS, "LOCAL_ACCESS" }, \
25+
{ NFSD_MAY_BYPASS_GSS_ON_ROOT, "BYPASS_GSS_ON_ROOT" }, \
26+
{ NFSD_MAY_NOT_BREAK_LEASE, "NOT_BREAK_LEASE" }, \
27+
{ NFSD_MAY_BYPASS_GSS, "BYPASS_GSS" }, \
28+
{ NFSD_MAY_READ_IF_EXEC, "READ_IF_EXEC" }, \
29+
{ NFSD_MAY_64BIT_COOKIE, "64BIT_COOKIE" })
30+
1531
TRACE_EVENT(nfsd_compound,
1632
TP_PROTO(const struct svc_rqst *rqst,
1733
u32 args_opcnt),
@@ -421,6 +437,9 @@ TRACE_EVENT(nfsd_clid_inuse_err,
421437
__entry->cl_boot, __entry->cl_id)
422438
)
423439

440+
/*
441+
* from fs/nfsd/filecache.h
442+
*/
424443
TRACE_DEFINE_ENUM(NFSD_FILE_HASHED);
425444
TRACE_DEFINE_ENUM(NFSD_FILE_PENDING);
426445
TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_READ);
@@ -435,13 +454,6 @@ TRACE_DEFINE_ENUM(NFSD_FILE_REFERENCED);
435454
{ 1 << NFSD_FILE_BREAK_WRITE, "BREAK_WRITE" }, \
436455
{ 1 << NFSD_FILE_REFERENCED, "REFERENCED"})
437456

438-
/* FIXME: This should probably be fleshed out in the future. */
439-
#define show_nf_may(val) \
440-
__print_flags(val, "|", \
441-
{ NFSD_MAY_READ, "READ" }, \
442-
{ NFSD_MAY_WRITE, "WRITE" }, \
443-
{ NFSD_MAY_NOT_BREAK_LEASE, "NOT_BREAK_LEASE" })
444-
445457
DECLARE_EVENT_CLASS(nfsd_file_class,
446458
TP_PROTO(struct nfsd_file *nf),
447459
TP_ARGS(nf),
@@ -466,7 +478,7 @@ DECLARE_EVENT_CLASS(nfsd_file_class,
466478
__entry->nf_inode,
467479
__entry->nf_ref,
468480
show_nf_flags(__entry->nf_flags),
469-
show_nf_may(__entry->nf_may),
481+
show_nfsd_may_flags(__entry->nf_may),
470482
__entry->nf_file)
471483
)
472484

@@ -492,10 +504,10 @@ TRACE_EVENT(nfsd_file_acquire,
492504
__field(u32, xid)
493505
__field(unsigned int, hash)
494506
__field(void *, inode)
495-
__field(unsigned int, may_flags)
507+
__field(unsigned long, may_flags)
496508
__field(int, nf_ref)
497509
__field(unsigned long, nf_flags)
498-
__field(unsigned char, nf_may)
510+
__field(unsigned long, nf_may)
499511
__field(struct file *, nf_file)
500512
__field(u32, status)
501513
),
@@ -514,10 +526,10 @@ TRACE_EVENT(nfsd_file_acquire,
514526

515527
TP_printk("xid=0x%x hash=0x%x inode=0x%p may_flags=%s ref=%d nf_flags=%s nf_may=%s nf_file=0x%p status=%u",
516528
__entry->xid, __entry->hash, __entry->inode,
517-
show_nf_may(__entry->may_flags), __entry->nf_ref,
518-
show_nf_flags(__entry->nf_flags),
519-
show_nf_may(__entry->nf_may), __entry->nf_file,
520-
__entry->status)
529+
show_nfsd_may_flags(__entry->may_flags),
530+
__entry->nf_ref, show_nf_flags(__entry->nf_flags),
531+
show_nfsd_may_flags(__entry->nf_may),
532+
__entry->nf_file, __entry->status)
521533
);
522534

523535
DECLARE_EVENT_CLASS(nfsd_file_search_class,

0 commit comments

Comments
 (0)