From 81dcb4d1ba63418d798274347551e876ae5b870a Mon Sep 17 00:00:00 2001 From: braam Date: Mon, 9 Sep 2002 01:28:40 +0000 Subject: [PATCH] - add nolocks mount option osc=foo,mdc=bar,nolocks --- lustre/llite/super.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lustre/llite/super.c b/lustre/llite/super.c index 3d61b44..3a80f78 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -52,7 +52,18 @@ static char *ll_read_opt(const char *opt, char *data) RETURN(retval); } -static void ll_options(char *options, char **ost, char **mds) +static int ll_set_opt(const char *opt, char *data, int fl) +{ + ENTRY; + + CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data); + if ( strncmp(opt, data, strlen(opt)) ) + RETURN(0); + else + RETURN(fl); +} + +static void ll_options(char *options, char **ost, char **mds, int *flags) { char *this_char; ENTRY; @@ -67,7 +78,9 @@ static void ll_options(char *options, char **ost, char **mds) this_char = strtok (NULL, ",")) { CDEBUG(D_SUPER, "this_char %s\n", this_char); if ( (!*ost && (*ost = ll_read_opt("osc", this_char)))|| - (!*mds && (*mds = ll_read_opt("mdc", this_char))) ) + (!*mds && (*mds = ll_read_opt("mdc", this_char)))|| + (!(*flags & LL_SBI_NOLCK) && ((*flags) = (*flags) | + ll_set_opt("nolock", this_char, LL_SBI_NOLCK))) ) continue; } EXIT; @@ -108,7 +121,7 @@ static struct super_block * ll_read_super(struct super_block *sb, sb->u.generic_sbp = sbi; - ll_options(data, &osc, &mdc); + ll_options(data, &osc, &mdc, &sbi->ll_flags); if (!osc) { CERROR("no osc\n"); -- 1.8.3.1