[patch] Proposal: move getmntopts(3) into libutil
bright at mu.org
Tue Feb 26 18:35:53 UTC 2013
On 2/26/13 4:20 AM, Konstantin Belousov wrote:
> On Tue, Feb 26, 2013 at 02:39:26PM +0300, Sergey Kandaurov wrote:
>> 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
>> The utilities consuming getmntopts.c as currently present in HEAD:
>> 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.
More information about the freebsd-current