Rename some directory index constants.

Directory index was introduced in ext3. We don't always use the
prefix to denote the ext2 variant they belong to but when we
do we should try to be accurate.
This commit is contained in:
Pedro F. Giffuni 2016-01-24 02:41:49 +00:00
parent e08ad8f068
commit 9b58c8019f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294653
4 changed files with 7 additions and 7 deletions

View File

@ -51,7 +51,7 @@
/*
* Inode flags
* The system supports EXT2_IMMUTABLE, EXT2_APPEND and EXT2_NODUMP flags.
* The current implementation also uses EXT4_INDEX, EXT4_EXTENTS and
* The current implementation also uses EXT3_INDEX, EXT4_EXTENTS and
* EXT4_HUGE_FILE with some restrictions, imposed the lack of write
* support.
*/
@ -63,7 +63,7 @@
#define EXT2_APPEND 0x00000020 /* Writes to file may only append */
#define EXT2_NODUMP 0x00000040 /* Do not dump file */
#define EXT2_NOATIME 0x00000080 /* Do not update atime */
#define EXT4_INDEX 0x00001000 /* Hash-indexed directory */
#define EXT3_INDEX 0x00001000 /* Hash-indexed directory */
#define EXT4_IMAGIC 0x00002000 /* AFS directory */
#define EXT4_JOURNAL_DATA 0x00004000 /* File data should be journaled */
#define EXT4_NOTAIL 0x00008000 /* File tail should not be merged */

View File

@ -90,7 +90,7 @@ int
ext2_htree_has_idx(struct inode *ip)
{
if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) &&
ip->i_flag & IN_E4INDEX)
ip->i_flag & IN_E3INDEX)
return (1);
else
return (0);
@ -653,7 +653,7 @@ ext2_htree_create_index(struct vnode *vp, struct componentname *cnp,
((char *)ep + ep->e2d_reclen);
ep->e2d_reclen = buf1 + blksize - (char *)ep;
dp->i_flag |= IN_E4INDEX;
dp->i_flag |= IN_E3INDEX;
/*
* Initialize index root.

View File

@ -110,7 +110,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip)
ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0;
ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0;
ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0;
ip->i_flag |= (ei->e2di_flags & EXT4_INDEX) ? IN_E4INDEX : 0;
ip->i_flag |= (ei->e2di_flags & EXT3_INDEX) ? IN_E3INDEX : 0;
ip->i_flag |= (ei->e2di_flags & EXT4_EXTENTS) ? IN_E4EXTENTS : 0;
ip->i_blocks = ei->e2di_nblock;
if (E2DI_HAS_HUGE_FILE(ip)) {
@ -160,7 +160,7 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei)
ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0;
ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0;
ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0;
ei->e2di_flags |= (ip->i_flag & IN_E4INDEX) ? EXT4_INDEX: 0;
ei->e2di_flags |= (ip->i_flag & IN_E3INDEX) ? EXT3_INDEX: 0;
ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS: 0;
ei->e2di_nblock = ip->i_blocks & 0xffffffff;
ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff;

View File

@ -888,7 +888,7 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp)
if (ext2_htree_has_idx(dp)) {
error = ext2_htree_add_entry(dvp, &newdir, cnp);
if (error) {
dp->i_flag &= ~IN_E4INDEX;
dp->i_flag &= ~IN_E3INDEX;
dp->i_flag |= IN_CHANGE | IN_UPDATE;
}
return (error);