[Samba] Disk free space, quotas and GPFS

Jeremy Allison jra at samba.org
Wed Jun 8 10:25:07 MDT 2011

On Wed, Jun 08, 2011 at 05:15:04PM +0100, Jonathan Buzzard wrote:
> On Tue, 2011-06-07 at 10:11 -0700, Jeremy Allison wrote:
> [SNIP]
> > > I am guessing that standard quota calls don't work on GPFS file systems.
> > 
> > Probably true. If you know how GPFS reports quotas we can
> > add the code for a later release. We have quota hooks in
> > the Samba VFS, so we could add this to the gpfs vfs module.
> > 
> A couple of hours hacking around and I have a small C program for the
> dfree command option that makes various GPFS calls to provide the
> information to Samba and it works great with one caveat. That is it does
> not appear to be working for home directory shares.
> Anyway pretty simple really, as I suspected gpfs_quotactl gets the
> information required, though with fileset quotas you need to call
> gpfs_fcntl to get the fileset name for the path and then
> gpfs_getfilesetid to turn that name into a numerical ID for
> gpfs_quotactl.
> I would prefer to role this into the GPFS VFS module, but it would be
> helpful if there where some pointers somewhere on how the quota hooks in
> the Samba VFS layer work. Some example code would be sufficient.

Look at the code in source3/modules/vfs_default.c - specifically
vfswrap_get_quota(), vfswrap_set_quota() (which are for manipulating
quotas on behalf of users) and also vfswrap_disk_free().

vfswrap_disk_free() is the most important one for reporting space,
it calls into sys_disk_free() which then branches into ugly
#ifdef-ed code to get system specific quotas. You might just
be able to replace vfswrap_disk_free() for gpfs to make the
correct gpfs calls and return the normalized 

uint64_t *bsize,
uint64_t *dfree,
uint64_t *dsize



More information about the samba mailing list