mirror of
https://github.com/nilfs-dev/nilfs-utils.git
synced 2026-01-26 13:43:15 +00:00
mkfs.nilfs2: remove unnecessary local variables in prepare_dat()
Fix the following gcc warnings that appear on recent distros:
mkfs.c: In function 'prepare_dat':
mkfs.c:1534:16: warning: variable 'vblocknr' set but not used
[-Wunused-but-set-variable=]
1534 | int i, vblocknr = 0;
| ^~~~~~~~
mkfs.c:1530:33: warning: variable 'entry' set but not used
[-Wunused-but-set-variable=]
1530 | struct nilfs_dat_entry *entry;
| ^~~~~
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
This commit is contained in:
parent
3fb2a8306a
commit
b7cd2813ed
19
sbin/mkfs.c
19
sbin/mkfs.c
@ -1527,25 +1527,20 @@ static void commit_sufile(void)
|
|||||||
static void prepare_dat(void)
|
static void prepare_dat(void)
|
||||||
{
|
{
|
||||||
struct nilfs_file_info *fi = nilfs.files[NILFS_DAT_INO];
|
struct nilfs_file_info *fi = nilfs.files[NILFS_DAT_INO];
|
||||||
struct nilfs_dat_entry *entry;
|
|
||||||
const unsigned entries_per_block =
|
|
||||||
blocksize / sizeof(struct nilfs_dat_entry);
|
|
||||||
uint64_t entry_block;
|
uint64_t entry_block;
|
||||||
int i, vblocknr = 0;
|
|
||||||
uint64_t blocknr = fi->start_blocknr;
|
uint64_t blocknr = fi->start_blocknr;
|
||||||
|
|
||||||
prepare_blockgrouped_file(blocknr);
|
prepare_blockgrouped_file(blocknr);
|
||||||
for (entry_block = blocknr + group_desc_blocks_per_group +
|
for (entry_block = blocknr + group_desc_blocks_per_group +
|
||||||
bitmap_blocks_per_group;
|
bitmap_blocks_per_group;
|
||||||
entry_block < blocknr + fi->nblocks; entry_block++) {
|
entry_block < blocknr + fi->nblocks; entry_block++) {
|
||||||
entry = map_disk_buffer(entry_block, 1);
|
/*
|
||||||
for (i = 0; i < entries_per_block; i++, entry++, vblocknr++) {
|
* The entry blocks of the DAT file (i.e., the blocks that
|
||||||
#if 0 /* dat are cleared when mapped first */
|
* contain records corresponding to virtual block addresses)
|
||||||
nilfs_dat_entry_set_blocknr(dat, entry, 0);
|
* only need to be filled with zeros, and no additional
|
||||||
nilfs_dat_entry_set_start(dat, entry, 0);
|
* formatting work is required.
|
||||||
nilfs_dat_entry_set_end(dat, entry, 0);
|
*/
|
||||||
#endif
|
map_disk_buffer(entry_block, 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* reserve the dat entry of vblocknr=0 */
|
/* reserve the dat entry of vblocknr=0 */
|
||||||
alloc_blockgrouped_file_entry(blocknr, 0);
|
alloc_blockgrouped_file_entry(blocknr, 0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user