My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 9 attachment: ohsm_meta_module.h (2.0 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#define EXT2_MOUNT_POINT_LENGTH 256
#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include <linux/ext2_fs_sb.h>
#include <linux/buffer_head.h>

#ifdef DEBUG
#define dbg_printk(x) printk(x)
#else
#define dbg_printk(x) /* */
#endif

struct ohsm_input_to_meta_device
{
char mountpoint[EXT2_MOUNT_POINT_LENGTH];
unsigned int error;
};

extern void ohsm_copy_ext2_sb_info (struct ext2_sb_info *src,
struct ext2_sb_info *dest);

extern struct ext2_group_desc *ext2_get_group_desc (struct super_block *sb,
unsigned int block_group,
struct buffer_head **bh);

extern void ohsm_print_ext2_sb_info (const struct ext2_sb_info sb);
struct ext2_group_desc *ext2_get_group_desc (struct super_block *sb,
unsigned int block_group,
struct buffer_head **bh);

void ohsm_print_block_groups (struct super_block *, unsigned long);
void ohsm_print_ext2_sb_info_fun (struct ext2_sb_info *);

struct ext2_group_desc *
ext2_get_group_desc (struct super_block *sb,
unsigned int block_group, struct buffer_head **bh)
{
unsigned long group_desc;
unsigned long offset;
struct ext2_group_desc *desc;
struct ext2_sb_info *sbi = EXT2_SB (sb);
dbg_printk ("\n\n<6> BALLOC EXT2_GET_GROUP_DESC");
if (block_group >= sbi->s_groups_count)
{
/*ext2_error (sb, "ext2_get_group_desc",
"block_group >= groups_count - "
"block_group = %d, groups_count = %lu",
block_group, sbi->s_groups_count);

*/ return NULL;
}

group_desc = block_group >> EXT2_DESC_PER_BLOCK_BITS (sb);
offset = block_group & (EXT2_DESC_PER_BLOCK (sb) - 1);
if (!sbi->s_group_desc[group_desc])
{
/* ext2_error (sb, "ext2_get_group_desc",
"Group descriptor not loaded - "
"block_group = %d, group_desc = %lu, desc = %lu",
block_group, group_desc, offset);
*/ return NULL;
}

desc = (struct ext2_group_desc *) sbi->s_group_desc[group_desc]->b_data;
if (bh)
*bh = sbi->s_group_desc[group_desc];
return desc + offset;
}
Powered by Google Project Hosting