From: Volker Lendecke Date: Wed, 28 Jan 2026 14:26:47 +0000 (+0100) Subject: smbd: Make disk_quotas() take a fsp X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e0e0f5c7579c9e9b348617b2dc08a5d79f5cce6;p=thirdparty%2Fsamba.git smbd: Make disk_quotas() take a fsp Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/smbd/dfree.c b/source3/smbd/dfree.c index 15db88adbd6..7d89acc3d29 100644 --- a/source3/smbd/dfree.c +++ b/source3/smbd/dfree.c @@ -155,7 +155,7 @@ static uint64_t sys_disk_free(struct files_struct *fsp, return (uint64_t)-1; } - if (disk_quotas(conn, fname, &bsize_q, &dfree_q, &dsize_q)) { + if (disk_quotas(conn, fsp, &bsize_q, &dfree_q, &dsize_q)) { uint64_t min_bsize = MIN(*bsize, bsize_q); (*dfree) = (*dfree) * (*bsize) / min_bsize; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index b30e4c858c4..2216445767f 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -877,8 +877,11 @@ bool init_smb1_request(struct smb_request *req, /* The following definitions come from smbd/quotas.c */ -bool disk_quotas(connection_struct *conn, struct smb_filename *fname, - uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); +bool disk_quotas(connection_struct *conn, + struct files_struct *fsp, + uint64_t *bsize, + uint64_t *dfree, + uint64_t *dsize); /* The following definitions come from smbd/smb2_reply.c */ diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c index 40fb3ee3c07..e73e2982c1c 100644 --- a/source3/smbd/quotas.c +++ b/source3/smbd/quotas.c @@ -216,9 +216,13 @@ try to get the disk space from disk quotas (SunOS & Solaris2 version) Quota code by Peter Urbanec (amiga@cse.unsw.edu.au). ****************************************************************************/ -bool disk_quotas(connection_struct *conn, struct smb_filename *fname, - uint64_t *bsize, uint64_t *dfree, uint64_t *dsize) +bool disk_quotas(connection_struct *conn, + struct files_struct *fsp, + uint64_t *bsize, + uint64_t *dfree, + uint64_t *dsize) { + struct smb_filename *fname = fsp->fsp_name; uid_t euser_id; int ret; struct dqblk D; @@ -339,8 +343,11 @@ bool disk_quotas(connection_struct *conn, struct smb_filename *fname, #else /* WITH_QUOTAS */ -bool disk_quotas(connection_struct *conn, struct smb_filename *fname, - uint64_t *bsize, uint64_t *dfree, uint64_t *dsize) +bool disk_quotas(connection_struct *conn, + struct files_struct *fsp, + uint64_t *bsize, + uint64_t *dfree, + uint64_t *dsize) { (*bsize) = 512; /* This value should be ignored */ @@ -358,9 +365,13 @@ bool disk_quotas(connection_struct *conn, struct smb_filename *fname, /* wrapper to the new sys_quota interface this file should be removed later */ -bool disk_quotas(connection_struct *conn, struct smb_filename *fname, - uint64_t *bsize, uint64_t *dfree, uint64_t *dsize) +bool disk_quotas(connection_struct *conn, + struct files_struct *fsp, + uint64_t *bsize, + uint64_t *dfree, + uint64_t *dsize) { + struct smb_filename *fname = fsp->fsp_name; int r; SMB_DISK_QUOTA D; unid_t id;