[PATCH] VFS KPI/API versioning

Attilio Rao attilio at freebsd.org
Sat Aug 29 02:37:24 UTC 2009


Often I found as it would have been useful to verify, mostly at
run-time, of a feature of the VFS was supported and I quickly thought
that having a run-time check for VFS versioning would not be a bad
idea.
In order to do that, I made the following patch:
http://www.freebsd.org/~attilio/vfs_modload.diff

which basically builds the vfs layer as a module adding a version
number that can be checked for filesystems/modules willing to load in
order to see if a specific feature is supported. Obviously I didn't
add an entry in the modules/ neither possibility to unload/shutdown
the module because we would not be willing to have such operations (or
a run-time load of the vfs).

Something that concerned me is also the mis-usage of the VFS_VERSION
macro, which can be easilly used at compile time in order to determine
if a feature is present or not. Basically, I have no idea by when it
doesn't get updated and if it has ever been checked in our codes. It
seems to use a random number as the start count, while it could have
been handled differently. Maybe it would be the case to start taking
care of that too, which can be an interesting tool.

Can you comment on the patch?
If you think it is a good idea I will commit right away on -CURRENT
and STABLE_8.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the freebsd-arch mailing list