Commit 6469ed7f authored by root's avatar root
Browse files

make group desc list

parent 77177720
/home/user/Team_Safdar/extractmd/extractmd.ko
/home/user/Team_Safdar/extractmd/extractmd.o
......@@ -22,7 +22,7 @@ ext4_fsblk_t extractmd_inode_table(struct super_block *, struct ext4_group_desc
ext4_fsblk_t extractmd_inode_bitmap(struct super_block *, struct ext4_group_desc *);
__u32 extractmd_itable_unused_count(struct super_block *, struct ext4_group_desc *);
static struct ext4_inode *extractmd_get_ext4_inode(struct super_block *, unsigned long);
static struct extractmd_group_desc_list *make_group_desc_list(struct super_block);
static struct extractmd_group_desc_list *make_group_desc_list(struct super_block *);
static int copy_group_desc_list(struct extractmd_group_desc_list *, struct extractmd_group_desc_list *, ext4_group_t);
#define DEVICE_NAME "extractmd" /* Dev name as it appears in /proc/devices */
......@@ -63,7 +63,7 @@ static int extractmd_ioctl(struct inode *inode, struct file *f, struct extractmd
unsigned int i = 0;
unsigned int k = 0;
struct file *fp = filp_open(md_user->md_path, O_RDONLY, 0);
struct file *fp = filp_open("/mnt", O_RDONLY, 0);
/*
* Super block part.
......@@ -94,6 +94,23 @@ static int extractmd_ioctl(struct inode *inode, struct file *f, struct extractmd
struct extractmd_meta_data md;
md.gd_list = make_group_desc_list(sb);
struct extractmd_group_desc_list *p = md.gd_list;
printk("%lu\n",(unsigned long)p->group);
p = p->next;
if(p == NULL)
return 0;
printk("%lu\n",(unsigned long)p->group);
p = p->next;
if(p == NULL)
return 0;
printk("%lu\n",(unsigned long)p->group);
//md.md_super_block = *(struct extractmd_super_block *)sbt;
//md.md_inode = *(struct extractmd_inode *)extractmd_get_ext4_inode(sb, md_user->md_ino);
......@@ -318,19 +335,18 @@ static struct extractmd_group_desc_list *make_group_desc_list(struct super_block
struct ext4_sb_info *sbi = EXT4_SB(sb);
ext4_group_t nr_group = sbi->s_groups_count;
struct extractmd_group_desc_list *ret = (struct extractmd_group_desc_list *)kmalloc(sizeof(struct extractmd_group_desc_list), GFP_KERNEL);
ret->group_desc = *(struct extractmd_group_desc *)extractmd_get_group_desc(sb,0);
ret->group = 0;
struct extractmd_group_desc_list *p = ret;
for(i = 1; i < nr_group; i++)
struct extractmd_group_desc_list *head = NULL;
for(i = 0; i < nr_group; i++)
{
p = p->next;
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 = i;
p->next = head;
head = p;
}
return ret;
return head;
}
static int copy_group_desc_list(struct extractmd_group_desc_list *dst, struct extractmd_group_desc_list *src, ext4_group_t nr_group)
......
No preview for this file type
Supports Markdown
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