vfs_cap: add get_quota function
authorUri Simchoni <uri@samba.org>
Sun, 10 Jan 2016 12:10:10 +0000 (14:10 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 26 Jan 2016 14:58:12 +0000 (15:58 +0100)
This is in preparation for handling the quota part
of disk_free via the VFS - each module with a
disk_free_fn should also have a get_quota_fn.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/modules/vfs_cap.c

index ab17376c07faf00d34a8c7aa6617713699349756..65b0b2597a3ccbcee735b70d3cf564d8393ce125 100644 (file)
@@ -41,6 +41,19 @@ static uint64_t cap_disk_free(vfs_handle_struct *handle, const char *path,
        return SMB_VFS_NEXT_DISK_FREE(handle, cappath, bsize, dfree, dsize);
 }
 
+static int cap_get_quota(vfs_handle_struct *handle, const char *path,
+                        enum SMB_QUOTA_TYPE qtype, unid_t id,
+                        SMB_DISK_QUOTA *dq)
+{
+       char *cappath = capencode(talloc_tos(), path);
+
+       if (!cappath) {
+               errno = ENOMEM;
+               return -1;
+       }
+       return SMB_VFS_NEXT_GET_QUOTA(handle, cappath, qtype, id, dq);
+}
+
 static DIR *cap_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32_t attr)
 {
        char *capname = capencode(talloc_tos(), fname);
@@ -516,6 +529,7 @@ static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, co
 
 static struct vfs_fn_pointers vfs_cap_fns = {
        .disk_free_fn = cap_disk_free,
+       .get_quota_fn = cap_get_quota,
        .opendir_fn = cap_opendir,
        .readdir_fn = cap_readdir,
        .mkdir_fn = cap_mkdir,