VxFS quotas (Was: Where to submit patches?)

David Lee T.D.Lee at durham.ac.uk
Wed Aug 25 16:33:42 GMT 1999


On Wed, 25 Aug 1999, Dirk De Wachter wrote:

> just to remind you all that HP-UX 10.20 seems to work perfectly with 
> quotas on a VxFS file system and may not need any patches. Yet, 
> depending on the OS installation a file 
> /usr/include/sys/fs/vx_ioctl.h may exist (as does a file 
> /usr/include/sys/fs/vx_bsdquota.h).
> 
> The patch submitted by David Lee, assumes that the VxFS should be 
> handled different if this file exists, but I believe it may only do 
> this based on both OS and the presence of this file. (I refer to the 
> patched lines 673-678 of include/includes.h). Or perhaps, it should 
> check the vx_quota.h file instead of vx_ioctl.h.

For "configure.in" and its dependent "include/includes.h", I picked
"vx_ioctl.h" almost at random from the list of vx_*.h files that Veritas
adds into a Solaris2 machine.  These files are:
   
   /usr/include/sys/fs/vx_aioctl.h     /usr/include/sys/fs/vx_machdep.h
   /usr/include/sys/fs/vx_const.h      /usr/include/sys/fs/vx_mlink.h
   /usr/include/sys/fs/vx_disklog.h    /usr/include/sys/fs/vx_param.h
   /usr/include/sys/fs/vx_ext.h        /usr/include/sys/fs/vx_quota.h
   /usr/include/sys/fs/vx_inode.h      /usr/include/sys/fs/vx_solaris.h
   /usr/include/sys/fs/vx_ioctl.h      /usr/include/sys/fs/vx_sysmacros.h
   /usr/include/sys/fs/vx_layout.h     /usr/include/sys/fs/vxio.h

Let's try to summarise:

1. Solaris 2:  VXFS is an add-on product.  The C code Veritas and native
   filesystems is different.

   At compile-time, the existence of a file in the list above (currently
  "vx_ioctl.h", but any would do) is used to include a Veritas-specific
   subroutine, and some code to call it.

   At run-time, the mount table is examined:  a type of "ufs" invokes the
   code for native filesystem, a type of "vxfs" invokes my new subroutine.

2. HPUX 10:  Apparently requires no change at all, if I correctly
   understand Dirk.

My patch was simply a first attempt.  The only Veritas system I have
available is Solaris 2.

I tried to keep the Veritas/quota code in "quotas.c" separate, guessing
that, for those OSs like Solaris above, it would probably be common.
I had assumed, perhaps erroneously, that most OSs would require something,
not nothing.

Perhaps the "include/includes.h" variable VXFS (or VXFS_QUOTA as below) 
should be dependent on "vx_solaris.h" and similar variables for analogous
OSs.  For HPUX 10, it would carefully *not* be defined.  Indeed, it would
only ever be defined on systems for which a port had been done and tested.

> I would suggest that not VXFS should be defined (as yet) in 
> include/includes.h but VXFS_QUOTA to reflect that only quotas may be 
> handled differently on VxFS and not other aspects of SAMBA. That is, 
> VXFS may defined also, but should be used in a more general way, e.g. 
> if also locking or syncing would be handled in a special way by 
> SAMBA.

I agree that VXFS_QUOTA might be a better thing to define than VXFS.

> Several of the includes mentioned in the patch for smbd/quotas.c 
> (lines 725 and up) are not present on HPUX systems and the patch may 
> therefore break quotas on this OS.

Hmmm... So my first approximation was not as portable as I hoped.
(But wait a minute... for HPUX, you require no change to previous
quotas, therefore this is irrelevant.)

So the entire list of includes needs to be in system-specific ifdefs?

Summary:
1. Change the "#define" from "VXFS" to "VXFS_QUOTA"
2. Make the "include/includes.h" stuff dependent on ths OS-specific file
   (e.g. "vx_solaris.h") for those systems that need it (e.g Solaris 2
   and NOT HPUX 10.)
3. "#includes ..." (quotas.c line 725) need checking on other OSs
   (how relevant is HPUX here?)

Does that seem reasonable?

Shall I produce a revised patch, in accordance with the above summary?

-- 


:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:  Phone:    +44 191 374 2882 (ddi)         South Road            :
:  Fax:      +44 191 374 7759               Durham                :
:  Internet: T.D.Lee at durham.ac.uk           U.K.                  :



More information about the samba-technical mailing list