summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_fake_dfq.c
diff options
context:
space:
mode:
authorUri Simchoni <uri@samba.org>2016-01-10 13:29:25 +0200
committerMichael Adam <obnox@samba.org>2016-01-26 15:58:12 +0100
commitc464b9e46069a741014333135728a9342ffa45cb (patch)
treec8ab696528bf6629d24eadda0fd91dcffd885f6c /source3/modules/vfs_fake_dfq.c
parentf71761c47a4c3b160b60c25a56e01a7a887992ab (diff)
downloadsamba-c464b9e46069a741014333135728a9342ffa45cb.tar.gz
vfs: add path parameter to get_quota
Adding a path parameter would allow the VFS get_quota function to be used for determining the quota/usage when calculating size and free spacei. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/modules/vfs_fake_dfq.c')
-rw-r--r--source3/modules/vfs_fake_dfq.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/source3/modules/vfs_fake_dfq.c b/source3/modules/vfs_fake_dfq.c
index b375a95b2a2..c7a4f06dfd8 100644
--- a/source3/modules/vfs_fake_dfq.c
+++ b/source3/modules/vfs_fake_dfq.c
@@ -27,9 +27,9 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
-static int dfq_get_quota_do(struct vfs_handle_struct *handle, const char *path,
- enum SMB_QUOTA_TYPE qtype, unid_t id,
- SMB_DISK_QUOTA *qt);
+static int dfq_get_quota(struct vfs_handle_struct *handle, const char *path,
+ enum SMB_QUOTA_TYPE qtype, unid_t id,
+ SMB_DISK_QUOTA *qt);
static uint64_t dfq_load_param(int snum, const char *path, const char *section,
const char *param, uint64_t def_val)
@@ -60,7 +60,7 @@ static bool dfq_disk_quotas(vfs_handle_struct *handle, const char *path,
id.uid = geteuid();
ZERO_STRUCT(D);
- r = dfq_get_quota_do(handle, path, SMB_USER_QUOTA_TYPE, id, &D);
+ r = dfq_get_quota(handle, path, SMB_USER_QUOTA_TYPE, id, &D);
/* Use softlimit to determine disk space, except when it has been
* exceeded */
@@ -99,7 +99,7 @@ try_group_quota:
id.gid = getegid();
ZERO_STRUCT(D);
- r = dfq_get_quota_do(handle, path, SMB_GROUP_QUOTA_TYPE, id, &D);
+ r = dfq_get_quota(handle, path, SMB_GROUP_QUOTA_TYPE, id, &D);
/* Use softlimit to determine disk space, except when it has been
* exceeded */
@@ -181,9 +181,9 @@ static uint64_t dfq_disk_free(vfs_handle_struct *handle, const char *path,
return free_1k;
}
-static int dfq_get_quota_do(struct vfs_handle_struct *handle, const char *path,
- enum SMB_QUOTA_TYPE qtype, unid_t id,
- SMB_DISK_QUOTA *qt)
+static int dfq_get_quota(struct vfs_handle_struct *handle, const char *path,
+ enum SMB_QUOTA_TYPE qtype, unid_t id,
+ SMB_DISK_QUOTA *qt)
{
int rc = 0;
int save_errno;
@@ -245,7 +245,7 @@ static int dfq_get_quota_do(struct vfs_handle_struct *handle, const char *path,
goto out;
dflt:
- rc = SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt);
+ rc = SMB_VFS_NEXT_GET_QUOTA(handle, path, qtype, id, qt);
out:
save_errno = errno;
@@ -255,14 +255,6 @@ out:
return rc;
}
-static int dfq_get_quota(struct vfs_handle_struct *handle,
- enum SMB_QUOTA_TYPE qtype, unid_t id,
- SMB_DISK_QUOTA *qt)
-{
- return dfq_get_quota_do(handle, handle->conn->connectpath, qtype, id,
- qt);
-}
-
struct vfs_fn_pointers vfs_fake_dfq_fns = {
/* Disk operations */