Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\quota\quota.c Create Date:2022-07-28 20:33:42
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Copy parameters and call proper function

Proto:static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, void __user *addr, const struct path *path)

Type:int

Parameter:

TypeParameterName
struct super_block *sb
inttype
intcmd
qid_tid
void __user *addr
const struct path *path
687  type = array_index_nospec - sanitize an array index after a bounds check* For a code sequence like:* if (index < size) {* index = array_index_nospec(index, size);* val = array[index];* }* (type, MAXQUOTAS)
692  If Not s_qcop Then Return -ENOSYS
694  If Not (s_quota_types & 1 << type ) Then Return -EINVAL
697  ret = check_quotactl_permission(sb, type, cmd, id)
698  If ret < 0 Then Return ret
702  Case cmd == urn quotas on
703  Return quota_quotaon(sb, type, id, path)
704  Case cmd == urn quotas off
705  Return quota_quotaoff(sb, type)
706  Case cmd == get quota format used on given filesystem
707  Return quota_getfmt(sb, type, addr)
708  Case cmd == get information about quota files
709  Return quota_getinfo(sb, type, addr)
710  Case cmd == set information about quota files
711  Return quota_setinfo(sb, type, addr)
712  Case cmd == get user quota structure
713  Return quota_getquota(sb, type, id, addr)
714  Case cmd == get disk limits and usage >= ID
715  Return Return quota for next active quota >= this id, if any exists,* otherwise return -ENOENT via ->get_nextdqblk
716  Case cmd == set user quota structure
717  Return quota_setquota(sb, type, id, addr)
718  Case cmd == sync disk copy of a filesystems quotas
719  If Not quota_sync Then Return -ENOSYS
721  Return quota_sync(sb, type)
722  Case cmd == able accounting/enforcement
723  Return quota_enable(sb, addr)
724  Case cmd == disable accounting/enforcement
725  Return quota_disable(sb, addr)
726  Case cmd == disk space used by dquots
727  Return quota_rmxquota(sb, addr)
728  Case cmd == get quota subsystem status
729  Return quota_getxstate(sb, type, addr)
730  Case cmd == wer version of get quota
731  Return quota_getxstatev(sb, type, addr)
732  Case cmd == set disk limits
733  Return quota_setxquota(sb, type, id, addr)
734  Case cmd == get disk limits and usage
735  Return quota_getxquota(sb, type, id, addr)
736  Case cmd == get disk limits and usage >= ID
737  Return Return quota for next active quota >= this id, if any exists,* otherwise return -ENOENT via ->get_nextdqblk.
738  Case cmd == delalloc flush, updates dquots
739  If sb_rdonly(sb) Then Return -EROFS
742  Return 0
743  Default
744  Return -EINVAL
Caller
NameDescribe
kernel_quotactlThis is the system call interface. This communicates with* the user-level programs. Currently this only supports diskquota* calls. Maybe we need to add the process quotas etc. in the future,* but we probably should use rlimits for that.