diff options
author | Christian Ambach <ambi@samba.org> | 2012-07-13 17:24:02 +0200 |
---|---|---|
committer | Christian Ambach <ambi@samba.org> | 2012-07-18 15:49:52 +0200 |
commit | a01a93a1f1dd88d733d30a78f502b72f2ac4ce5b (patch) | |
tree | b096f8192c0e6b0d4cc0721892124718114fe60a /source3/utils | |
parent | 07412b56bd3b93cf0d242f5692ee31ee5f0901b5 (diff) | |
download | samba-a01a93a1f1dd88d733d30a78f502b72f2ac4ce5b.tar.gz |
s3:smbstatus add --fast option
this option skips all checks if the process for the record is still there
using it gives a huge performance benefit on busy systems and clusters while
it might display stale data if a smbd crashed
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/status.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/utils/status.c b/source3/utils/status.c index b87f64c1593..0cb46a5f536 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -56,6 +56,7 @@ static bool locks_only; /* Added by RJS */ static bool processes_only; static bool show_brl; static bool numeric_only; +static bool do_checks = true; const char *username = NULL; @@ -120,7 +121,7 @@ static void print_share_mode(const struct share_mode_entry *e, { static int count; - if (!is_valid_share_mode_entry(e)) { + if (do_checks && !is_valid_share_mode_entry(e)) { return; } @@ -250,7 +251,8 @@ static int traverse_connections(const struct connections_key *key, if (crec->cnum == TID_FIELD_INVALID) return 0; - if (!process_exists(crec->pid) || !Ucrit_checkUid(crec->uid)) { + if (do_checks && + (!process_exists(crec->pid) || !Ucrit_checkUid(crec->uid))) { return 0; } @@ -267,8 +269,9 @@ static int traverse_sessionid(const char *key, struct sessionid *session, { fstring uid_str, gid_str; - if (!process_exists(session->pid) - || !Ucrit_checkUid(session->uid)) { + if (do_checks && + (!process_exists(session->pid) || + !Ucrit_checkUid(session->uid))) { return 0; } @@ -331,6 +334,7 @@ static void print_notify_recs(const char *path, {"profile-rates", 'R', POPT_ARG_NONE, NULL, 'R', "Show call rates" }, {"byterange", 'B', POPT_ARG_NONE, NULL, 'B', "Include byte range locks"}, {"numeric", 'n', POPT_ARG_NONE, NULL, 'n', "Numeric uid/gid"}, + {"fast", 'f', POPT_ARG_NONE, NULL, 'f', "Skip checks if processes still exist"}, POPT_COMMON_SAMBA POPT_TABLEEND }; @@ -385,6 +389,9 @@ static void print_notify_recs(const char *path, case 'n': numeric_only = true; break; + case 'f': + do_checks = false; + break; } } |