aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2016-12-16 13:54:51 -0800
committerChunwei Chen <[email protected]>2016-12-16 13:54:51 -0800
commita5248129b865d9b9675a6952c40a9f68e0374b83 (patch)
treeb7b9832013d9a9aca7d402870b0fd9a7af124153 /module
parentc360af541117a0978b7fe146b59c12ad2f80d162 (diff)
Use inode_set_flags when available
Signed-off-by: Chunwei Chen <[email protected]>
Diffstat (limited to 'module')
-rw-r--r--module/zfs/zfs_znode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
index e87e6d216..92241d6a5 100644
--- a/module/zfs/zfs_znode.c
+++ b/module/zfs/zfs_znode.c
@@ -486,7 +486,15 @@ zfs_set_inode_flags(znode_t *zp, struct inode *ip)
* Linux and Solaris have different sets of file attributes, so we
* restrict this conversion to the intersection of the two.
*/
+#ifdef HAVE_INODE_SET_FLAGS
+ unsigned int flags = 0;
+ if (zp->z_pflags & ZFS_IMMUTABLE)
+ flags |= S_IMMUTABLE;
+ if (zp->z_pflags & ZFS_APPENDONLY)
+ flags |= S_APPEND;
+ inode_set_flags(ip, flags, S_IMMUTABLE|S_APPEND);
+#else
if (zp->z_pflags & ZFS_IMMUTABLE)
ip->i_flags |= S_IMMUTABLE;
else
@@ -496,6 +504,7 @@ zfs_set_inode_flags(znode_t *zp, struct inode *ip)
ip->i_flags |= S_APPEND;
else
ip->i_flags &= ~S_APPEND;
+#endif
}
/*