mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Use inode_set_flags when available
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user