On May 4, 2018, at 1:09 AM, c17828 <artem.blagodarenko@xxxxxxxxx> wrote: > > From: Andreas Dilger <andreas.dilger@xxxxxxxxx> > > Add support for the INCOMPAT_DIRDATA feature, which allows > storing extra data in the directory entry beyond the name. > This allows the Lustre File IDentifier to be accessed in > an efficient manner, and would be useful for expanding a > filesystem to allow more than 2^32 inodes in the future. > > Lustre-bug: https://jira.hpdd.intel.com/browse/LU-4677 > Signed-off-by: Pravin Shelar <pravin@xxxxxxxxxxxxx> > Signed-off-by: Andreas Dilger <andreas.dilger@xxxxxxxxx> > Signed-off-by: Artem Blagodarenko <artem.blagodarenko@xxxxxxxxx> > --- > > +/* > + * check for dirent data in ext3 dirent. > + * return 0 if dirent data is ok. > + * return 1 if dirent data does not exist. > + * return 2 if dirent was modified due to error. > + */ > +int e2fsck_check_dirent_data(e2fsck_t ctx, struct ext2_dir_entry *de, > + unsigned int offset, struct problem_context *pctx) > +{ > + if (!(ctx->fs->super->s_feature_incompat & > + EXT4_FEATURE_INCOMPAT_DIRDATA)) { This should use: if (ext2fs_has_feature_incompat_dirdata(ctx->fs->super)) { but it wasn't in the original patch since those macros didn't exist back then. However, it looks like the EXT4_FEATURE_INCOMPAT_FUNCS(dirdata, 4, DIRDATA) macro already exists in both e2fsprogs and the kernel, so it doesn't need to be added. > #endif /* _LINUX_EXT2_FS_H */ > diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h > index 6774e32c..fbe4398f 100644 > --- a/lib/ext2fs/ext2fs.h > +++ b/lib/ext2fs/ext2fs.h > > +_INLINE_ struct ext2_dx_root_info *get_ext2_dx_root_info(ext2_filsys fs, > + char *buf) > +{ > + struct ext2_dir_entry *de = (struct ext2_dir_entry *)buf; > + > + if (!(fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_DIRDATA)) Similarly, this should use the proper macro: if (!ext2fs_has_feature_incompat_dirdata(fs->super)) Cheers, Andreas
Attachment:
signature.asc
Description: Message signed with OpenPGP