-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsfs.h
62 lines (46 loc) · 1.15 KB
/
sfs.h
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
/*
* sfs.h
*
* Copyright 2020 Lee JeYeon., Dankook Univ.
*
*/
#ifndef _SFS_H
#define _SFS_H
#include <linux/fs.h>
#include <linux/blockgroup_lock.h>
#include <linux/percpu_counter.h>
#include <linux/rbtree.h>
#include "sfs_fs.h"
#include <linux/dcache.h>
/*
* sfs super-block data in memory
*/
struct sfs_sb_info {
struct super_block *sb; /* pointer to VFS super block */
struct sfs_super_block *raw_super; /* raw super block pointer */
spinlock_t s_lock;
};
#define SFS_ROOT_INO 2 /* Root inode */
/*
* Macro-instructions used to manage several block sizes
*/
#define SFS_BLOCK_SIZE(s) ((s)->blocksize)
#define SFS_BLOCK_SIZE_BITS(s) ((s)->blocksize_bits)
#define SFS_INODE_SIZE(s) (SFS_SB(s)->inode_size)
struct sfs_inode_info {
__le32 i_data[15];
__u32 i_flags;
__u32 i_dir_start_lookup;
struct inode vfs_inode;
};
static inline struct sfs_inode_info *SFS_I(struct inode *inode)
{
return container_of(inode, struct sfs_inode_info, vfs_inode);
}
static inline struct sfs_sb_info *SFS_SB(struct super_block *sb)
{
return sb->s_fs_info;
}
#define SFS_GET_SB(s, i) (SFS_SB(s)->raw_super->i)
#endif /* _SFS_H */