This source file includes following definitions.
- qtree_depth
1
2
3
4
5
6 #ifndef _LINUX_DQBLK_QTREE_H
7 #define _LINUX_DQBLK_QTREE_H
8
9 #include <linux/types.h>
10
11
12
13 #define QTREE_INIT_ALLOC 4
14 #define QTREE_INIT_REWRITE 2
15 #define QTREE_DEL_ALLOC 0
16 #define QTREE_DEL_REWRITE 6
17
18 struct dquot;
19 struct kqid;
20
21
22 struct qtree_fmt_operations {
23 void (*mem2disk_dqblk)(void *disk, struct dquot *dquot);
24 void (*disk2mem_dqblk)(struct dquot *dquot, void *disk);
25 int (*is_id)(void *disk, struct dquot *dquot);
26 };
27
28
29 struct qtree_mem_dqinfo {
30 struct super_block *dqi_sb;
31 int dqi_type;
32 unsigned int dqi_blocks;
33 unsigned int dqi_free_blk;
34 unsigned int dqi_free_entry;
35 unsigned int dqi_blocksize_bits;
36 unsigned int dqi_entry_size;
37 unsigned int dqi_usable_bs;
38 unsigned int dqi_qtree_depth;
39 const struct qtree_fmt_operations *dqi_ops;
40 };
41
42 int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
43 int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
44 int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
45 int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot);
46 int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk);
47 static inline int qtree_depth(struct qtree_mem_dqinfo *info)
48 {
49 unsigned int epb = info->dqi_usable_bs >> 2;
50 unsigned long long entries = epb;
51 int i;
52
53 for (i = 1; entries < (1ULL << 32); i++)
54 entries *= epb;
55 return i;
56 }
57 int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid);
58
59 #endif