blkid code in pvfs

tridge at samba.org tridge at samba.org
Fri Jul 15 00:45:07 GMT 2005


Alexander,

I've been having a look at your BLKID code in the posix vfs
backend. Sorry its taken me so long to review this.

In case you've forgotten, see this patch:

  http://build.samba.org/build.pl?function=diff;tree=samba4;revision=6597

The main problem with your patch is it puts all the logic inline,
using #ifdef. That makes the code much less readable than it was
before. It also doesn't scale - if each info level was written like
that then the code would quickly turn into spaghetti :-)

Could I suggest that you create a separate pvfs_blkid.c module? The
qfsinfo code would then do this:

	case RAW_QFS_OBJECTID_INFORMATION:
		return pvfs_objectid_information(pvfs, &fs->objectid_information);

and in pvfs_blkid.c you would create a fake objectid based on the
device and inode of the root directory of the share if blkids are not
available, otherwise make the blkid_ call to get the information.

Next, is the blkid cache really needed? How slow is it to fetch this
information (how many microseconds)? How often do clients make this
call? A cache can be a wonderful thing when needed, but if its not
needed then it just complicates code for no reason. We should not put
in caches unless they are really needed (also, too many caches
actually makes code slower, not faster).

In testing, it seems that current w2k3 servers don't support this call
at all, or at least mine don't, so it seems unlikely that clients
would call it very often. Have you seen it a lot?

Cheers, Tridge


More information about the samba-technical mailing list