On Thursday 14 May 2009 11:46, Denys Vlasenko wrote:
> On Thursday 14 May 2009 08:34, Roland Arnold wrote:
>> On Thursday 14 May 2009 00:12 Denys Vlasenko wrote:
>> >> This is a patch to mount.c to allow the file-system caching 'fsc' flag
>> >> for NFS mounts. FS-Cache is new in the 2.6.30 kernel. Note that this
>> >> changes the behaviour of the mount sys-call to pass through a string
>> >> and not a struct anymore; it makes the code match what nfs-utils does
>> >> - at least for NFS3.
>> >
>> > AFAIKS this works only starting from 2.6.23. If you want to use that
>> > anyway (which is a good idea, this struct nfs_mount_data
>> > mustn't be invented in the first place), you need
>> > to read /proc/version and do it conditionally.
>> >
>> > Otherwise you'll make life of 2.4.x people miserable.
>>
>> At this stage, what would be best? I can make a new patch that
>> implements the /proc/version test you mentioned, but it will probably
>> only be over the weekend.
>
> That's a good plan.
> --
> vda
>
Hi Denys,
In looking at this I first hacked up a very quick hard-coded test to
only pass the mount string to the kernel for an NFS3 setup, and
according to bloatcheck the resulting busybox binary shrank by ~56
kilobytes, which is a nice saving indeed. Except by handling the
choice between binary or string mounts at run-time instead (the
uname() sys-call via the KERNEL_VERSION() macro looks ideal),
everything can only get bigger.
Personally, I'd prefer making this a compile setting instead -
obviously, with error checking etc., the savings won't be quite that
big in the end, but they should still be appreciable. I was thinking
of adding a Makefile flag and a #define somewhere allowing me to write
code like this:
#if CURRENT_LINUX_VERSION >= LINUX_VERSION(2,6,23):
nfs_string_mount()
#else
nfs_binary_mount()
#endif
This would enable other checks in the code to be done at compile-time,
leading to savings generally. I'd also want to break the nfs mounting
out into a separate file, which is going to be desirable when adding
NFS4 support.
Would this be acceptable, or would (as another alternative) a
menuconfig setting (Binary NFS mount call vs String NFS mount call) be
more preferable for you? Are there other examples that I should look
at?
Roland Arnold
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox