summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-01-22 19:09:41 +0000
committerpfg <pfg@FreeBSD.org>2014-01-22 19:09:41 +0000
commitcc5aa413b410def9b593403149c8a185bc8008b1 (patch)
treeabd6de47bfeb153fdf2ea8ff0f4460d58c08c687 /sys/fs
parent6ee60702e2b35d1da875b1e26565f580942a6298 (diff)
downloadFreeBSD-src-cc5aa413b410def9b593403149c8a185bc8008b1.zip
FreeBSD-src-cc5aa413b410def9b593403149c8a185bc8008b1.tar.gz
ext2fs: fix logic error in the previous change.
Use the bitwise negation instead of bogus boolean negation and move the flag manipulation with the assignment. Fix some grammatical errors introduced in the same change. Reported by: bde MFC after: 3 days
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ext2fs/ext2_lookup.c4
-rw-r--r--sys/fs/ext2fs/ext2_subr.c2
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c5
3 files changed, 5 insertions, 6 deletions
diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c
index 02e66f7..cd230dc 100644
--- a/sys/fs/ext2fs/ext2_lookup.c
+++ b/sys/fs/ext2fs/ext2_lookup.c
@@ -888,9 +888,9 @@ 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) {
- /* XXX: These seem to be set in the wrong place. */
- dp->i_flags |= IN_CHANGE | IN_UPDATE;
+ /* XXX: These are set in the wrong place. */
dp->i_flags &= ~E4_INDEX;
+ dp->i_flags |= IN_CHANGE | IN_UPDATE;
}
return (error);
}
diff --git a/sys/fs/ext2fs/ext2_subr.c b/sys/fs/ext2fs/ext2_subr.c
index 09fcee8..585a975 100644
--- a/sys/fs/ext2fs/ext2_subr.c
+++ b/sys/fs/ext2fs/ext2_subr.c
@@ -82,7 +82,7 @@ ext2_blkatoff(struct vnode *vp, off_t offset, char **res, struct buf **bpp)
*bpp = NULL;
/*
- * E4_EXTENTS requires special treatment otherwise we can fall
+ * E4_EXTENTS requires special treatment as we can otherwise fall
* back to the normal path.
*/
if (!(ip->i_flags & E4_EXTENTS))
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index 72a008b..1ab1fdd 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -343,9 +343,8 @@ ext2_getattr(struct vop_getattr_args *ap)
vap->va_birthtime.tv_sec = ip->i_birthtime;
vap->va_birthtime.tv_nsec = ip->i_birthnsec;
}
- vap->va_flags = ip->i_flags;
- /* E4_* flags are private to the driver */
- vap->va_flags &= !(E4_INDEX | E4_EXTENTS);
+ /* E4_* flags are private to the filesystem. */
+ vap->va_flags = ip->i_flags & ~(E4_INDEX | E4_EXTENTS);
vap->va_gen = ip->i_gen;
vap->va_blocksize = vp->v_mount->mnt_stat.f_iosize;
vap->va_bytes = dbtob((u_quad_t)ip->i_blocks);
OpenPOWER on IntegriCloud