Date: Wed, 31 May 2006 17:26:44 -0400 From: Craig Rodrigues <rodrigc@crodrigues.org> To: Maxim Konovalov <maxim@macomnet.ru> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/ufs/ffs ffs_vfsops.c Message-ID: <20060531212644.GA7541@crodrigues.org> In-Reply-To: <20060531114119.T70660@mp2.macomnet.net> References: <200605261244.k4QCiCsl057619@repoman.freebsd.org> <20060529193947.M63890@mp2.macomnet.net> <20060529215827.D78736@mp2.macomnet.net> <20060530034531.GA36462@crodrigues.org> <20060530110750.A96470@mp2.macomnet.net> <20060530224448.GA42556@crodrigues.org> <20060531114119.T70660@mp2.macomnet.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 31, 2006 at 11:44:14AM +0400, Maxim Konovalov wrote: > This one works, thanks! But I worry about mountd/NFS interaction to > mount I described in my first email. Any ideas? Not sure about the mountd/NFS interaction yet. This patch is a bit better for mount(8): Index: mount.c =================================================================== RCS file: /home/ncvs/src/sbin/mount/mount.c,v retrieving revision 1.84 diff -u -u -r1.84 mount.c --- mount.c 10 May 2006 14:40:40 -0000 1.84 +++ mount.c 31 May 2006 21:23:35 -0000 @@ -184,6 +184,26 @@ return (0); } +static +int specified_ro(const char *arg) +{ + char *optbuf, *opt; + int ret = 0; + + optbuf = strdup(arg); + if (optbuf == NULL) + err(1, NULL); + + for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) { + if (strcmp(opt, "ro") == 0) { + ret = 1; + break; + } + } + free(optbuf); + return (ret); +} + int main(int argc, char *argv[]) { @@ -215,8 +236,11 @@ init_flags |= MNT_FORCE; break; case 'o': - if (*optarg) + if (*optarg) { options = catopt(options, optarg); + if (specified_ro(optarg)) + ro = 1; + } break; case 'p': fstab_style = 1; -- Craig Rodrigues rodrigc@crodrigues.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060531212644.GA7541>