From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 16:07:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D82E5106566C; Sat, 14 Apr 2012 16:07:02 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id A17048FC08; Sat, 14 Apr 2012 16:07:01 +0000 (UTC) Received: by wern13 with SMTP id n13so3369703wer.13 for ; Sat, 14 Apr 2012 09:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=BJSWmXE6iAashe3X2mIHQSsyX5zcgLPQrdu120YDY8o=; b=ZoV7WZGa7hyInXT8q1pJId/NVUB5PAPTnw9Vc/qerlSesBop2Yrbk1P2s+Vg+VA/R5 zHF0uiUHSD09dJfUkIotatCzG9XTdvS1gbgTbWuGv753wG+GSTzlNDXUlKJrMiaP841+ t18SHie7vI5wX11OpXdl66u4RXaIEoYwmJ2nCGdDUeu8vkTC0JURUyECMB+zclwxji8n NWffMfOH/1V+sTDrm6UNl6bdSR3N9QSDuGYBz75vidtQyCJjCvSaGa4wB7ND/YktqZh3 yszmNsVwmlIjgGCvz4TQ8Hex25GrTj08m5Gez9xrg1/T9wVbx3YZeZHiS6Stj2dbHIsz lc1g== Received: by 10.180.91.165 with SMTP id cf5mr5078119wib.2.1334419620679; Sat, 14 Apr 2012 09:07:00 -0700 (PDT) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id b3sm5400014wib.4.2012.04.14.09.06.57 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Apr 2012 09:06:58 -0700 (PDT) From: Mikolaj Golub To: Jaakko Heinonen References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> <86lioztzh5.fsf@kopusha.home.net> <20120123153457.GA2246@a91-153-116-96.elisa-laajakaista.fi> <86vco2yvrt.fsf@kopusha.home.net> <20120413061139.GA2370@a91-153-116-96.elisa-laajakaista.fi> X-Comment-To: Jaakko Heinonen Sender: Mikolaj Golub Date: Sat, 14 Apr 2012 19:06:56 +0300 In-Reply-To: <20120413061139.GA2370@a91-153-116-96.elisa-laajakaista.fi> (Jaakko Heinonen's message of "Fri, 13 Apr 2012 09:11:39 +0300") Message-ID: <86pqbawb4v.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 16:07:03 -0000 On Fri, 13 Apr 2012 09:11:39 +0300 Jaakko Heinonen wrote: JH> On 2012-01-23, Mikolaj Golub wrote: >> I see two issues with this patch: JH> What do you think about this patch? I think it is much better than we have currently :-). JH> %%% JH> Index: sys/fs/tmpfs/tmpfs.h JH> =================================================================== JH> --- sys/fs/tmpfs/tmpfs.h (revision 234201) JH> +++ sys/fs/tmpfs/tmpfs.h (working copy) JH> @@ -387,6 +387,9 @@ struct tmpfs_mount { JH> * tmpfs_pool.c. */ JH> uma_zone_t tm_dirent_pool; JH> uma_zone_t tm_node_pool; JH> + JH> + /* Read-only status. */ JH> + int tm_ronly; JH> }; JH> #define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock) JH> #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock) JH> Index: sys/fs/tmpfs/tmpfs_vfsops.c JH> =================================================================== JH> --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 234201) JH> +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) JH> @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { JH> NULL JH> }; JH> JH> +static const char *tmpfs_updateopts[] = { JH> + "from", "export", NULL JH> +}; JH> + JH> /* --------------------------------------------------------------------- */ JH> JH> static int JH> @@ -150,12 +154,13 @@ tmpfs_mount(struct mount *mp) JH> return (EINVAL); JH> JH> if (mp->mnt_flag & MNT_UPDATE) { JH> - /* JH> - * Only support update mounts for NFS export. JH> - */ JH> - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) JH> - return (0); JH> - return (EOPNOTSUPP); JH> + /* Only support update mounts for certain options. */ JH> + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) JH> + return (EOPNOTSUPP); JH> + if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) != JH> + ((struct tmpfs_mount *)mp->mnt_data)->tm_ronly) JH> + return (EOPNOTSUPP); JH> + return (0); JH> } JH> JH> vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); JH> @@ -228,6 +233,7 @@ tmpfs_mount(struct mount *mp) JH> tmpfs_node_ctor, tmpfs_node_dtor, JH> tmpfs_node_init, tmpfs_node_fini, JH> UMA_ALIGN_PTR, 0); JH> + tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; JH> JH> /* Allocate the root node. */ JH> error = tmpfs_alloc_node(tmp, VDIR, root_uid, JH> %%% JH> -- JH> Jaakko -- Mikolaj Golub