提交 9bbb5726 编写于 作者: A Artem Bityutskiy

UBIFS: introduce LEB overhead

This is a preparational patch for the following statfs()
report fix.
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
上级 131130b9
...@@ -530,6 +530,12 @@ static int init_constants_early(struct ubifs_info *c) ...@@ -530,6 +530,12 @@ static int init_constants_early(struct ubifs_info *c)
c->dead_wm = ALIGN(MIN_WRITE_SZ, c->min_io_size); c->dead_wm = ALIGN(MIN_WRITE_SZ, c->min_io_size);
c->dark_wm = ALIGN(UBIFS_MAX_NODE_SZ, c->min_io_size); c->dark_wm = ALIGN(UBIFS_MAX_NODE_SZ, c->min_io_size);
/*
* Calculate how many bytes would be wasted at the end of LEB if it was
* fully filled with data nodes of maximum size. This is used in
* calculations when reporting free space.
*/
c->leb_overhead = c->leb_size % UBIFS_MAX_DATA_NODE_SZ;
return 0; return 0;
} }
......
...@@ -995,6 +995,9 @@ struct ubifs_mount_opts { ...@@ -995,6 +995,9 @@ struct ubifs_mount_opts {
* @max_idx_node_sz: maximum indexing node aligned on 8-bytes boundary * @max_idx_node_sz: maximum indexing node aligned on 8-bytes boundary
* @max_inode_sz: maximum possible inode size in bytes * @max_inode_sz: maximum possible inode size in bytes
* @max_znode_sz: size of znode in bytes * @max_znode_sz: size of znode in bytes
*
* @leb_overhead: how many bytes are wasted in an LEB when it is filled with
* data nodes of maximum size - used in free space reporting
* @dead_wm: LEB dead space watermark * @dead_wm: LEB dead space watermark
* @dark_wm: LEB dark space watermark * @dark_wm: LEB dark space watermark
* @block_cnt: count of 4KiB blocks on the FS * @block_cnt: count of 4KiB blocks on the FS
...@@ -1226,6 +1229,8 @@ struct ubifs_info { ...@@ -1226,6 +1229,8 @@ struct ubifs_info {
int max_idx_node_sz; int max_idx_node_sz;
long long max_inode_sz; long long max_inode_sz;
int max_znode_sz; int max_znode_sz;
int leb_overhead;
int dead_wm; int dead_wm;
int dark_wm; int dark_wm;
int block_cnt; int block_cnt;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册