From: tappro Date: Fri, 16 Sep 2005 16:12:08 +0000 (+0000) Subject: add command null_audit in lctl X-Git-Tag: v1_7_100~671 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f4f1def3da230a372f01226b19d46adb37c914e6 add command null_audit in lctl --- diff --git a/lustre/utils/lctl.c b/lustre/utils/lctl.c index 042b41e..452a490 100644 --- a/lustre/utils/lctl.c +++ b/lustre/utils/lctl.c @@ -224,6 +224,30 @@ static int jt_flush_audit(int argc, char **argv) return rc; } +static int jt_null_audit(int argc, char **argv) +{ + __u64 mask = 0; + int rc, fd; + + if (argc != 2) + return CMD_HELP; + + //open file/dir + fd = open(argv[1], O_RDONLY); + if (fd < 0) { + fprintf(stderr, "can't open: %s: %s\n", argv[1], + strerror(rc = errno)); + return -1; + } + + SET_AUDIT_OP(mask, AUDIT_NULL); + + rc = ioctl(fd, LL_IOC_AUDIT, mask); + close(fd); + return rc; +} + + /* * XXX Should not belong to here */ @@ -512,6 +536,8 @@ command_t cmdlist[] = { "usage: fs_audit type operations mountpoint\n"}, {"flush_audit", jt_flush_audit, 0, "usage: flush_audit mountpoin\n"}, + {"null_audit", jt_null_audit, 0, + "usage: null_audit mountpoin\n"}, {"lsync", jt_obd_reint_sync, 0, "usage: lsync\n"}, {"cache_on", jt_obd_cache_on, 0,