From owner-freebsd-current@FreeBSD.ORG Tue Feb 26 18:35:53 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 52B7BE02 for ; Tue, 26 Feb 2013 18:35:53 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 3755E1714 for ; Tue, 26 Feb 2013 18:35:53 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id E16D41A3C19 for ; Tue, 26 Feb 2013 10:35:44 -0800 (PST) Message-ID: <512D0080.9050208@mu.org> Date: Tue, 26 Feb 2013 10:35:44 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: [patch] Proposal: move getmntopts(3) into libutil References: <20130226122039.GN2454@kib.kiev.ua> In-Reply-To: <20130226122039.GN2454@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 18:35:53 -0000 On 2/26/13 4:20 AM, Konstantin Belousov wrote: > On Tue, Feb 26, 2013 at 02:39:26PM +0300, Sergey Kandaurov wrote: >> Hi. >> >> The functions from sbin/mount/getmntopts.c are used in a bunch of other >> stuff like mount_* utilities which have to suck them in as their own >> functions in quite a hackish way. getmntopts.c copies are compiled in to >> an every utility-consumer instead of being present in one place. Looks >> like getmntopts.c was brought together with mount_ufs.c in 4.4BSD-Lite. >> After that other mount_* were converted to use getmntopts(). > Yes, this is ugly. On the other hand, compiling the functions into > mount binaries makes them not to depend on the yet another library. > It cannot be an argument for rejecting your patch, only a point to > consider. > >> The utilities consuming getmntopts.c as currently present in HEAD: >> mount_smbfs >> fsck_ffs >> growfs >> mksnap_ffs >> mount >> mount_cd9660 >> mount_ext2fs >> mount_fusefs >> mount_hpfs >> mount_msdosfs >> mount_nfs >> mount_nullfs >> mount_reiserfs >> mount_std >> mount_udf >> mount_unionfs >> mount_nwfs >> mount_portalfs >> mount_smbfs >> mountd >> >> External mount-like utilities may also have difficulties with building >> to get getmntopts.c source as this requires /usr/src presence which is >> in sync with installed world. Look how mount_fusefs from ports compiles: >> # mount_fusefs needs mntopts.h and getmntopts.c from src/sbin/mount/ >> >> The attached patch moves them to the IMHO architecturally more correct >> place: a separate library -lutil. >> sbin/mount/mntopts.h -> include/mntopts.h > I think the mntopts.h should be moved to lib/libutil then, and installed > by libutil Makefile. > >> sbin/mount/getmntopts.[3c] -> lib/libutil/getmntopts.[3c] > I assume that the move is done by 'svn mv' to preserve the history. Agree with all of Konstantin's review. Looks very good. -Alfred