Commit 73a3059b authored by root's avatar root
Browse files

debug make_group_desc_list

parent 6469ed7f
...@@ -96,18 +96,18 @@ static int extractmd_ioctl(struct inode *inode, struct file *f, struct extractmd ...@@ -96,18 +96,18 @@ static int extractmd_ioctl(struct inode *inode, struct file *f, struct extractmd
md.gd_list = make_group_desc_list(sb); md.gd_list = make_group_desc_list(sb);
struct extractmd_group_desc_list *p = md.gd_list; struct extractmd_group_desc_list *p = md.gd_list;
printk("%lu\n",(unsigned long)p->group); // printk("%lu\n",(unsigned long)p->group_desc.bg_inode_table_lo);
p = p->next; // p = p->next;
if(p == NULL) // if(p == NULL)
return 0; // return 0;
printk("%lu\n",(unsigned long)p->group); // printk("%lu\n",(unsigned long)p->group_desc.bg_inode_table_lo);
p = p->next; // p = p->next;
if(p == NULL) // if(p == NULL)
return 0; // return 0;
printk("%lu\n",(unsigned long)p->group); // printk("%lu\n",(unsigned long)p->group_desc.bg_inode_table_lo);
...@@ -331,21 +331,25 @@ static struct ext4_inode *extractmd_get_ext4_inode(struct super_block *sb, unsig ...@@ -331,21 +331,25 @@ static struct ext4_inode *extractmd_get_ext4_inode(struct super_block *sb, unsig
static struct extractmd_group_desc_list *make_group_desc_list(struct super_block *sb) static struct extractmd_group_desc_list *make_group_desc_list(struct super_block *sb)
{ {
unsigned int i = 0; unsigned int i;
struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_sb_info *sbi = EXT4_SB(sb);
ext4_group_t nr_group = sbi->s_groups_count; ext4_group_t nr_group = sbi->s_groups_count;
struct extractmd_group_desc_list *head = NULL; struct extractmd_group_desc_list *head = NULL;
for(i = 0; i < nr_group; i++) for(i = nr_group-1; ; i--)
{ {
struct extractmd_group_desc_list *p = (struct extractmd_group_desc_list *)kmalloc(sizeof(struct extractmd_group_desc_list), GFP_KERNEL); struct extractmd_group_desc_list *p = (struct extractmd_group_desc_list *)kmalloc(sizeof(struct extractmd_group_desc_list), GFP_KERNEL);
p->group_desc = *(struct extractmd_group_desc *)extractmd_get_group_desc(sb, i); p->group_desc = *(struct extractmd_group_desc *)extractmd_get_group_desc(sb, i);
p->group = i; p->group = i;
p->next = head; p->next = head;
head = p; head = p;
if (i == 0)
break;
} }
return head; return head;
} }
......
No preview for this file type
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment