diff options
author | Uri Simchoni <uri@samba.org> | 2016-01-10 14:10:10 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2016-01-26 15:58:12 +0100 |
commit | 22d757c8d8e5bc666ab3a1db3ad8fbfdf5997380 (patch) | |
tree | 69ee8678b63b6daaa0982ce01a1beedfc7e06781 /source3/modules/vfs_cap.c | |
parent | c464b9e46069a741014333135728a9342ffa45cb (diff) | |
download | samba-22d757c8d8e5bc666ab3a1db3ad8fbfdf5997380.tar.gz |
vfs_cap: add get_quota function
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>
Diffstat (limited to 'source3/modules/vfs_cap.c')
-rw-r--r-- | source3/modules/vfs_cap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index ab17376c07f..65b0b2597a3 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -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, |