mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-11 03:31:17 +00:00
btrfs-progs: mkfs: simplify checks in directory_select
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
8c4e5fbe89
commit
d75ea3ca87
8
mkfs.c
8
mkfs.c
@ -494,11 +494,11 @@ static int fill_inode_item(struct btrfs_trans_handle *trans,
|
|||||||
|
|
||||||
static int directory_select(const struct direct *entry)
|
static int directory_select(const struct direct *entry)
|
||||||
{
|
{
|
||||||
if ((strncmp(entry->d_name, ".", entry->d_reclen) == 0) ||
|
if (entry->d_name[0] == '.' &&
|
||||||
(strncmp(entry->d_name, "..", entry->d_reclen) == 0))
|
(entry->d_name[1] == 0 ||
|
||||||
|
(entry->d_name[1] == '.' && entry->d_name[2] == 0)))
|
||||||
return 0;
|
return 0;
|
||||||
else
|
return 1;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_namelist(struct direct **files, int count)
|
static void free_namelist(struct direct **files, int count)
|
||||||
|
Loading…
Reference in New Issue
Block a user