Quota-Backend-Cleanup/Logging BuildFix
All checks were successful
Source release / source-package (push) Successful in 35s

This commit is contained in:
Mario Fetka
2026-05-25 23:23:38 +02:00
parent 1dc2c0a175
commit b2c2ea96c6

View File

@@ -935,20 +935,13 @@ const char *find_device_file(const char *path)
# include <sys/quota.h>
# endif
# if defined(__alpha__)
# include <errno.h>
# include <syscall.h>
# include <asm/unistd.h>
int quotactl(int cmd, const char * special, int id, caddr_t addr)
{
return syscall(__NR_quotactl, cmd, special, id, addr);
}
# else /* not __alpha__ */
# define __LIBRARY__
# include <linux/unistd.h>
_syscall4(int, quotactl, int, cmd, const char *, special,
int, id, caddr_t, addr);
# endif /* __alpha__ */
/* Modern glibc declares quotactl() in <sys/quota.h>. The old _syscall4()
* wrapper no longer builds on current systems, so do not provide a private
* syscall stub here.
*/
# if !defined(Q_SETQLIM) && defined(Q_SETQUOTA)
# define Q_SETQLIM Q_SETQUOTA
# endif
#endif /* LINUX */
static int su_quotactl(int cmd, const char * special, int id, caddr_t addr)
@@ -1000,12 +993,19 @@ int nw_set_vol_restrictions(uint8 volnr, int uid, uint32 quota)
}
dqblk.dqb_bhardlimit = quota;
dqblk.dqb_bsoftlimit = quota;
if (quota == 0)
#ifdef QIF_BLIMITS
dqblk.dqb_valid |= QIF_BLIMITS;
#endif
if (quota == 0) {
dqblk.dqb_ihardlimit = dqblk.dqb_isoftlimit = 0;
#ifdef QIF_ILIMITS
dqblk.dqb_valid |= QIF_ILIMITS;
#endif
}
XDPRINTF((2,0, "Set quota device=%s uid=%d %d(%d)K %d(%d) files",
device, uid,
dqblk.dqb_bhardlimit,
dqblk.dqb_curblocks,
(uint32)(dqblk.dqb_curspace / 1024),
dqblk.dqb_ihardlimit,
dqblk.dqb_curinodes));
@@ -1051,7 +1051,7 @@ int nw_get_vol_restrictions(uint8 volnr, int uid, uint32 *quota, uint32 *inuse)
*inuse = 0;
} else {
*quota = dqblk.dqb_bhardlimit / 4; /* Convert from K to blocks */
*inuse = dqblk.dqb_curblocks / 4;
*inuse = (uint32)(dqblk.dqb_curspace / 4096);
}
return(0);
}