Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Transfer the number of inode and blocks from one diskquota to an other

Proto:int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)

Type:int

Parameter:

TypeParameterName
struct inode *inode
struct dquot **transfer_to
1951  rsv_space = 0
1952  inode_usage = 1
1953  struct dquot * transfer_from[3] = {}
1954  ret = 0
1955  char is_valid[3] = {}
1960  If IS_NOQUOTA(inode) Then Return 0
1963  If get_inode_usage Then
1964  ret = get_inode_usage(inode, & inode_usage)
1965  If ret Then Return ret
1970  When cnt < MAXQUOTAS cycle
1971  w_type = Definitions for quota netlink interface
1972  w_type = Definitions for quota netlink interface
1973  w_type = Definitions for quota netlink interface
1976  spin_lock( & dq_data_lock)
1977  spin_lock( & _blocks, i_bytes, maybe i_size )
1978  If IS_NOQUOTA(inode) Then
1979  spin_unlock( & _blocks, i_bytes, maybe i_size )
1980  spin_unlock( & dq_data_lock)
1981  Return 0
1983  cur_space = __inode_get_bytes(inode)
1984  rsv_space = __inode_get_rsv_space(inode)
1989  When cnt < MAXQUOTAS cycle
1993  If Not transfer_to[cnt] Then Continue
1996  If Not sb_has_quota_active(i_sb, cnt) Then Continue
1998  is_valid[cnt] = 1
1999  transfer_from[cnt] = i_dquot(inode)[cnt]
2000  ret = dquot_add_inodes(transfer_to[cnt], inode_usage, & warn_to[cnt])
2002  If ret Then Go to over_quota
2004  ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space, DQUOT_SPACE_WARN, & warn_to[cnt])
2006  If ret Then
2010  Go to over_quota
2015  When cnt < MAXQUOTAS cycle
2016  If Not is_valid[cnt] Then Continue
2019  If transfer_from[cnt] Then
2038  i_dquot(inode)[cnt] = transfer_to[cnt]
2040  spin_unlock( & _blocks, i_bytes, maybe i_size )
2041  spin_unlock( & dq_data_lock)
2043  Dirtify all the dquots - this can block when journalling
2044  Dirtify all the dquots - this can block when journalling
2045  Write warnings to the console and send warning messages over netlink.* Note that this function can call into tty and networking code.
2046  Write warnings to the console and send warning messages over netlink.* Note that this function can call into tty and networking code.
2047  Write warnings to the console and send warning messages over netlink.* Note that this function can call into tty and networking code.
2049  When cnt < MAXQUOTAS cycle If is_valid[cnt] Then
2051  transfer_to[cnt] = transfer_from[cnt]
2052  Return 0
2053  over_quota :
2055  When cnt >= 0 cycle
2056  If Not is_valid[cnt] Then Continue
2058  spin_lock( & Lock protecting dq_dqb changes )
2059  dquot_decr_inodes(transfer_to[cnt], inode_usage)
2060  dquot_decr_space(transfer_to[cnt], cur_space)
2061  dquot_free_reserved_space(transfer_to[cnt], rsv_space)
2062  spin_unlock( & Lock protecting dq_dqb changes )
2064  spin_unlock( & _blocks, i_bytes, maybe i_size )
2065  spin_unlock( & dq_data_lock)
2066  Write warnings to the console and send warning messages over netlink.* Note that this function can call into tty and networking code.
2067  Return ret
Caller
NameDescribe
dquot_transferWrapper for transferring ownership of an inode for uid/gid only* Called from FSXXX_setattr()