diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ubifs/super.c | 6 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 1018053519e6..be23fd3cfd84 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -530,6 +530,12 @@ static int init_constants_early(struct ubifs_info *c) | |||
530 | c->dead_wm = ALIGN(MIN_WRITE_SZ, c->min_io_size); | 530 | c->dead_wm = ALIGN(MIN_WRITE_SZ, c->min_io_size); |
531 | c->dark_wm = ALIGN(UBIFS_MAX_NODE_SZ, c->min_io_size); | 531 | c->dark_wm = ALIGN(UBIFS_MAX_NODE_SZ, c->min_io_size); |
532 | 532 | ||
533 | /* | ||
534 | * Calculate how many bytes would be wasted at the end of LEB if it was | ||
535 | * fully filled with data nodes of maximum size. This is used in | ||
536 | * calculations when reporting free space. | ||
537 | */ | ||
538 | c->leb_overhead = c->leb_size % UBIFS_MAX_DATA_NODE_SZ; | ||
533 | return 0; | 539 | return 0; |
534 | } | 540 | } |
535 | 541 | ||
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 681d46e16286..57e58541de28 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -995,6 +995,9 @@ struct ubifs_mount_opts { | |||
995 | * @max_idx_node_sz: maximum indexing node aligned on 8-bytes boundary | 995 | * @max_idx_node_sz: maximum indexing node aligned on 8-bytes boundary |
996 | * @max_inode_sz: maximum possible inode size in bytes | 996 | * @max_inode_sz: maximum possible inode size in bytes |
997 | * @max_znode_sz: size of znode in bytes | 997 | * @max_znode_sz: size of znode in bytes |
998 | * | ||
999 | * @leb_overhead: how many bytes are wasted in an LEB when it is filled with | ||
1000 | * data nodes of maximum size - used in free space reporting | ||
998 | * @dead_wm: LEB dead space watermark | 1001 | * @dead_wm: LEB dead space watermark |
999 | * @dark_wm: LEB dark space watermark | 1002 | * @dark_wm: LEB dark space watermark |
1000 | * @block_cnt: count of 4KiB blocks on the FS | 1003 | * @block_cnt: count of 4KiB blocks on the FS |
@@ -1226,6 +1229,8 @@ struct ubifs_info { | |||
1226 | int max_idx_node_sz; | 1229 | int max_idx_node_sz; |
1227 | long long max_inode_sz; | 1230 | long long max_inode_sz; |
1228 | int max_znode_sz; | 1231 | int max_znode_sz; |
1232 | |||
1233 | int leb_overhead; | ||
1229 | int dead_wm; | 1234 | int dead_wm; |
1230 | int dark_wm; | 1235 | int dark_wm; |
1231 | int block_cnt; | 1236 | int block_cnt; |