diff options
-rw-r--r-- | examples/VFS/skel_opaque.c | 5 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 7 | ||||
-rw-r--r-- | source3/include/vfs.h | 6 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 8 | ||||
-rw-r--r-- | source3/modules/vfs_ceph.c | 4 | ||||
-rw-r--r-- | source3/modules/vfs_default.c | 6 | ||||
-rw-r--r-- | source3/modules/vfs_default_quota.c | 13 | ||||
-rw-r--r-- | source3/modules/vfs_fake_dfq.c | 26 | ||||
-rw-r--r-- | source3/modules/vfs_full_audit.c | 8 | ||||
-rw-r--r-- | source3/modules/vfs_time_audit.c | 6 | ||||
-rw-r--r-- | source3/smbd/ntquotas.c | 2 | ||||
-rw-r--r-- | source3/smbd/vfs.c | 4 |
12 files changed, 50 insertions, 45 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 29fe6f44c21..a4309d4de69 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -54,8 +54,9 @@ static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path, return 0; } -static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, - unid_t id, SMB_DISK_QUOTA *dq) +static int skel_get_quota(vfs_handle_struct *handle, const char *path, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *dq) { errno = ENOSYS; return -1; diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index c5a36a65a11..2d1ed790cbb 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -55,10 +55,11 @@ static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path, return SMB_VFS_NEXT_DISK_FREE(handle, path, bsize, dfree, dsize); } -static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, - unid_t id, SMB_DISK_QUOTA *dq) +static int skel_get_quota(vfs_handle_struct *handle, const char *path, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *dq) { - return SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq); + return SMB_VFS_NEXT_GET_QUOTA(handle, path, qtype, id, dq); } static int skel_set_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 66e4fc6be68..c18ea5947ac 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -526,7 +526,9 @@ struct vfs_fn_pointers { void (*disconnect_fn)(struct vfs_handle_struct *handle); uint64_t (*disk_free_fn)(struct vfs_handle_struct *handle, const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); - int (*get_quota_fn)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); + int (*get_quota_fn)(struct vfs_handle_struct *handle, const char *path, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *qt); int (*set_quota_fn)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); int (*get_shadow_copy_data_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels); int (*statvfs_fn)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); @@ -931,7 +933,7 @@ void smb_vfs_call_disconnect(struct vfs_handle_struct *handle); uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct *handle, const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); -int smb_vfs_call_get_quota(struct vfs_handle_struct *handle, +int smb_vfs_call_get_quota(struct vfs_handle_struct *handle, const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); int smb_vfs_call_set_quota(struct vfs_handle_struct *handle, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index eaf0c19371d..16d5bfdb270 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -44,10 +44,10 @@ #define SMB_VFS_NEXT_DISK_FREE(handle, path, bsize, dfree ,dsize)\ smb_vfs_call_disk_free((handle)->next, (path), (bsize), (dfree), (dsize)) -#define SMB_VFS_GET_QUOTA(conn, qtype, id, qt) \ - smb_vfs_call_get_quota((conn)->vfs_handles, (qtype), (id), (qt)) -#define SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt) \ - smb_vfs_call_get_quota((handle)->next, (qtype), (id), (qt)) +#define SMB_VFS_GET_QUOTA(conn, path, qtype, id, qt) \ + smb_vfs_call_get_quota((conn)->vfs_handles, (path), (qtype), (id), (qt)) +#define SMB_VFS_NEXT_GET_QUOTA(handle, path, qtype, id, qt) \ + smb_vfs_call_get_quota((handle)->next, (path), (qtype), (id), (qt)) #define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) \ smb_vfs_call_set_quota((conn)->vfs_handles, (qtype), (id), (qt)) diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 0113faa1247..2bc387af794 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -185,7 +185,9 @@ static uint64_t cephwrap_disk_free(struct vfs_handle_struct *handle, } } -static int cephwrap_get_quota(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt) +static int cephwrap_get_quota(struct vfs_handle_struct *handle, + const char *path, enum SMB_QUOTA_TYPE qtype, + unid_t id, SMB_DISK_QUOTA *qt) { /* libceph: Ceph does not implement this */ #if 0 diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 819a1a1ca6f..0f8e067363f 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -64,13 +64,15 @@ static uint64_t vfswrap_disk_free(vfs_handle_struct *handle, const char *path, return result; } -static int vfswrap_get_quota(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt) +static int vfswrap_get_quota(struct vfs_handle_struct *handle, const char *path, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *qt) { #ifdef HAVE_SYS_QUOTAS int result; START_PROFILE(syscall_get_quota); - result = sys_get_quota(handle->conn->connectpath, qtype, id, qt); + result = sys_get_quota(path, qtype, id, qt); END_PROFILE(syscall_get_quota); return result; #else diff --git a/source3/modules/vfs_default_quota.c b/source3/modules/vfs_default_quota.c index a71d3c297a1..c8d718cb5b9 100644 --- a/source3/modules/vfs_default_quota.c +++ b/source3/modules/vfs_default_quota.c @@ -92,11 +92,13 @@ #define DEFAULT_QUOTA_GID_NOLIMIT(handle) \ lp_parm_bool(SNUM((handle)->conn),DEFAULT_QUOTA_NAME,"gid nolimit",DEFAULT_QUOTA_GID_NOLIMIT_DEFAULT) -static int default_quota_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dq) +static int default_quota_get_quota(vfs_handle_struct *handle, const char *path, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *dq) { int ret = -1; - if ((ret=SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, dq))!=0) { + if ((ret = SMB_VFS_NEXT_GET_QUOTA(handle, path, qtype, id, dq)) != 0) { return ret; } @@ -122,7 +124,8 @@ static int default_quota_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYP unid_t qid; uint32_t qflags = dq->qflags; qid.uid = DEFAULT_QUOTA_UID(handle); - SMB_VFS_NEXT_GET_QUOTA(handle, SMB_USER_QUOTA_TYPE, qid, dq); + SMB_VFS_NEXT_GET_QUOTA( + handle, path, SMB_USER_QUOTA_TYPE, qid, dq); dq->qflags = qflags; } break; @@ -132,7 +135,9 @@ static int default_quota_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYP unid_t qid; uint32_t qflags = dq->qflags; qid.gid = DEFAULT_QUOTA_GID(handle); - SMB_VFS_NEXT_GET_QUOTA(handle, SMB_GROUP_QUOTA_TYPE, qid, dq); + SMB_VFS_NEXT_GET_QUOTA(handle, path, + SMB_GROUP_QUOTA_TYPE, + qid, dq); dq->qflags = qflags; } break; 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 */ diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 11f5d822a60..904b56905ee 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -666,14 +666,14 @@ static uint64_t smb_full_audit_disk_free(vfs_handle_struct *handle, } static int smb_full_audit_get_quota(struct vfs_handle_struct *handle, - enum SMB_QUOTA_TYPE qtype, unid_t id, - SMB_DISK_QUOTA *qt) + const char *path, enum SMB_QUOTA_TYPE qtype, + unid_t id, SMB_DISK_QUOTA *qt) { int result; - result = SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt); + result = SMB_VFS_NEXT_GET_QUOTA(handle, path, qtype, id, qt); - do_log(SMB_VFS_OP_GET_QUOTA, (result >= 0), handle, ""); + do_log(SMB_VFS_OP_GET_QUOTA, (result >= 0), handle, "%s", path); return result; } diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 7efad1efa5d..2fc6afdfef6 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -178,15 +178,15 @@ static uint64_t smb_time_audit_disk_free(vfs_handle_struct *handle, } static int smb_time_audit_get_quota(struct vfs_handle_struct *handle, - enum SMB_QUOTA_TYPE qtype, unid_t id, - SMB_DISK_QUOTA *qt) + const char *path, enum SMB_QUOTA_TYPE qtype, + unid_t id, SMB_DISK_QUOTA *qt) { int result; struct timespec ts1,ts2; double timediff; clock_gettime_mono(&ts1); - result = SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt); + result = SMB_VFS_NEXT_GET_QUOTA(handle, path, qtype, id, qt); clock_gettime_mono(&ts2); timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c index 15fd35b92e4..aa2ec3b76a5 100644 --- a/source3/smbd/ntquotas.c +++ b/source3/smbd/ntquotas.c @@ -96,7 +96,7 @@ int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid sid_string_dbg(psid))); } - ret = SMB_VFS_GET_QUOTA(fsp->conn, qtype, id, &D); + ret = SMB_VFS_GET_QUOTA(fsp->conn, ".", qtype, id, &D); if (psid) qt->sid = *psid; diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 1a2ee3dc222..89f0ae194f0 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1404,12 +1404,12 @@ uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct *handle, return handle->fns->disk_free_fn(handle, path, bsize, dfree, dsize); } -int smb_vfs_call_get_quota(struct vfs_handle_struct *handle, +int smb_vfs_call_get_quota(struct vfs_handle_struct *handle, const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt) { VFS_FIND(get_quota); - return handle->fns->get_quota_fn(handle, qtype, id, qt); + return handle->fns->get_quota_fn(handle, path, qtype, id, qt); } int smb_vfs_call_set_quota(struct vfs_handle_struct *handle, |