Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:COMPAT_SYSCALL_DEFINE4

Proto:COMPAT_SYSCALL_DEFINE4(quotactl32, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr)

Type:

Parameter:Nothing

49  __user * dqblk
50  __user * compat_dqblk
51  __user * fsqstat
52  __user * compat_fsqstat
57  cmds = cmd >> SUBCMDSHIFT
60  Case cmds == get user quota structure
61  dqblk = Allocate user-space memory for the duration of a single system call,* in order to marshall parameters inside a compat thunk.
62  compat_dqblk = addr
63  ret = This 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.
64  If ret Then Break
66  If copy_in_user(compat_dqblk, dqblk, size of compat_dqblk ) || Get a simple variable from user space(data, & dqb_valid) || Write a simple value into user space(data, & dqb_valid) Then ret = -EFAULT
70  Break
71  Case cmds == set user quota structure
72  dqblk = Allocate user-space memory for the duration of a single system call,* in order to marshall parameters inside a compat thunk.
73  compat_dqblk = addr
74  ret = -EFAULT
75  If copy_in_user(dqblk, compat_dqblk, size of compat_dqblk ) || Get a simple variable from user space(data, & dqb_valid) || Write a simple value into user space(data, & dqb_valid) Then Break
79  ret = This 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.
80  Break
81  Case cmds == get quota subsystem status
82  fsqstat = Allocate user-space memory for the duration of a single system call,* in order to marshall parameters inside a compat thunk.
83  compat_fsqstat = addr
84  ret = This 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.
85  If ret Then Break
87  ret = -EFAULT
89  If copy_in_user(compat_fsqstat, fsqstat, offsetof(structcompat_fs_quota_stat, qs_uquota)) Then Break
93  If copy_in_user( & qs_uquota, & user quota storage information , size of qs_uquota ) || Get a simple variable from user space(data, & umber of extents ) || Write a simple value into user space(data, & qfs_nextents) Then Break
100  If copy_in_user( & qs_gquota, & group quota storage information , size of qs_gquota ) || Get a simple variable from user space(data, & umber of extents ) || Write a simple value into user space(data, & qfs_nextents) Then Break
107  If copy_in_user( & qs_incoredqs, & number of dquots incore , sizeof(structcompat_fs_quota_stat) - offsetof(structcompat_fs_quota_stat, qs_incoredqs)) || Get a simple variable from user space(xdata, & limit for num warnings ) || Write a simple value into user space(xdata, & qs_iwarnlimit) Then Break
114  ret = 0
115  Break
116  Default
117  ret = This 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.
119  Return ret