Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-9859 libcfs: add "default" keyword for debug mask
[fs/lustre-release.git]
/
libcfs
/
libcfs
/
libcfs_string.c
diff --git
a/libcfs/libcfs/libcfs_string.c
b/libcfs/libcfs/libcfs_string.c
index
7ba00df
..
a3ff59c
100644
(file)
--- a/
libcfs/libcfs/libcfs_string.c
+++ b/
libcfs/libcfs/libcfs_string.c
@@
-41,7
+41,7
@@
/* Convert a text string to a bitmask */
int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
/* Convert a text string to a bitmask */
int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
- int *oldmask, int minmask, int allmask)
+ int *oldmask, int minmask, int allmask
, int defmask
)
{
const char *debugstr;
char op = 0;
{
const char *debugstr;
char op = 0;
@@
-98,6
+98,15
@@
int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
newmask = allmask;
found = 1;
}
newmask = allmask;
found = 1;
}
+ if (!found && strcasecmp(str, "DEFAULT") == 0) {
+ if (op == '-')
+ newmask = (newmask & ~defmask) | minmask;
+ else if (op == '+')
+ newmask |= defmask;
+ else
+ newmask = defmask;
+ found = 1;
+ }
if (!found) {
CWARN("unknown mask '%.*s'.\n"
"mask usage: [+|-]<all|type> ...\n", len, str);
if (!found) {
CWARN("unknown mask '%.*s'.\n"
"mask usage: [+|-]<all|type> ...\n", len, str);