Function report |
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 activity | Download SCCT | Chinese |
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:
| Type | Parameter | Name |
|---|---|---|
| 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) |
| 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) |
| 1993 | If Not transfer_to[cnt] Then Continue |
| 1996 | If Not sb_has_quota_active(i_sb, cnt) Then Continue |
| 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 |
| 2007 | spin_lock( & Lock protecting dq_dqb changes ) |
| 2008 | dquot_decr_inodes(transfer_to[cnt], inode_usage) |
| 2009 | spin_unlock( & Lock protecting dq_dqb changes ) |
| 2010 | Go to over_quota |
| 2019 | If transfer_from[cnt] Then |
| 2022 | spin_lock( & Lock protecting dq_dqb changes ) |
| 2023 | wtype = info_idq_free(transfer_from[cnt], inode_usage) |
| 2024 | If wtype != Definitions for quota netlink interface Then prepare_warning( & warn_from_inodes[cnt], transfer_from[cnt], wtype) |
| 2027 | wtype = info_bdq_free(transfer_from[cnt], cur_space + rsv_space) |
| 2029 | If wtype != Definitions for quota netlink interface Then prepare_warning( & warn_from_space[cnt], transfer_from[cnt], wtype) |
| 2032 | dquot_decr_inodes(transfer_from[cnt], inode_usage) |
| 2033 | dquot_decr_space(transfer_from[cnt], cur_space) |
| 2036 | spin_unlock( & Lock protecting dq_dqb changes ) |
| 2038 | i_dquot(inode)[cnt] = transfer_to[cnt] |
| 2040 | spin_unlock( & _blocks, i_bytes, maybe i_size ) |
| 2041 | spin_unlock( & dq_data_lock) |
| 2051 | transfer_to[cnt] = transfer_from[cnt] |
| 2052 | Return 0 |
| 2053 | over_quota : |
| 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) |
| 2062 | spin_unlock( & Lock protecting dq_dqb changes ) |
| 2064 | spin_unlock( & _blocks, i_bytes, maybe i_size ) |
| 2065 | spin_unlock( & dq_data_lock) |
| 2067 | Return ret |
| Name | Describe |
|---|---|
| dquot_transfer | Wrapper for transferring ownership of an inode for uid/gid only* Called from FSXXX_setattr() |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |