Linux内核中unsigned three = 1
发布时间:2020-05-23 09:49:30 所属栏目:Linux 来源:互联网
导读:见 this link(懒惰的相关功能粘贴在下面). /* * Check that all of the backup GDT blocks are held in the primary GDT block. * It is assumed that they are stored in group order. Returns the number of * groups in cu
|
见 this link(懒惰的相关功能粘贴在下面). /*
* Check that all of the backup GDT blocks are held in the primary GDT block.
* It is assumed that they are stored in group order. Returns the number of
* groups in current filesystem that have BACKUPS,or -ve error code.
*/
static int verify_reserved_gdb(struct super_block *sb,ext4_group_t end,struct buffer_head *primary)
{
const ext4_fsblk_t blk = primary->b_blocknr;
unsigned three = 1;
unsigned five = 5;
unsigned seven = 7;
unsigned grp;
__le32 *p = (__le32 *)primary->b_data;
int gdbackups = 0;
while ((grp = ext4_list_backups(sb,&three,&five,&seven)) < end) {
if (le32_to_cpu(*p++) !=
grp * EXT4_BLOCKS_PER_GROUP(sb) + blk){
ext4_warning(sb,"reserved GDT %llu"
" missing grp %d (%llu)",blk,grp,grp *
(ext4_fsblk_t)EXT4_BLOCKS_PER_GROUP(sb) +
blk);
return -EINVAL;
}
if (++gdbackups > EXT4_ADDR_PER_BLOCK(sb))
return -EFBIG;
}
return gdbackups;
}
有人可以向我解释为什么这个变量是这样初始化的,这个函数在做什么? 解决方法见00296 here行.评论说:00295 /* 00296 * Iterate through the groups which hold BACKUP superblock/GDT copies in an 00297 * ext4 filesystem. The counters should be initialized to 1,5,and 7 before 00298 * calling this for the first time. In a sparse filesystem it will be the 00299 * sequence of powers of 3,and 7: 1,3,7,9,25,27,49,81,... 00300 * For a non-sparse filesystem it will be every group: 1,2,4,... 00301 */ 总之,在我看来应该将三个初始化为1来启用函数ext4_list_backups返回1. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux – 如何在软件包debuild中包含一个目录
- 如何解决linux子目录的数量限制?
- linux – 如何将物理分区系统更改为LVM?
- linux – 在Bash脚本中循环?
- macos – 无法在Zsh中完成MacPorts的选项卡
- linux – 版本控制软件,将保留POSIX FS(ext3 / ext4)中的所
- 需要将命令行(Linux)CURL转换为带有请求数据有效负载(“-d”
- linux – 在git中查找uncommited或untracked文件的总大小
- linux – 启动/停止或重启后,AMI启动的EC2实例无法访问(ssh
- 终端/ zsh / terminfo中的应用模式是什么?
