You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
fs/hfsplus: atomically set inode->i_flags
According to commit 5f16f3225b ("ext4: atomically set inode->i_flags in
ext4_set_inode_flags()").
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
5e61473ea9
commit
73d28d571d
+5
-7
@@ -76,7 +76,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
|
|||||||
{
|
{
|
||||||
struct inode *inode = file_inode(file);
|
struct inode *inode = file_inode(file);
|
||||||
struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
|
struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
|
||||||
unsigned int flags;
|
unsigned int flags, new_fl = 0;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
err = mnt_want_write_file(file);
|
err = mnt_want_write_file(file);
|
||||||
@@ -110,14 +110,12 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & FS_IMMUTABLE_FL)
|
if (flags & FS_IMMUTABLE_FL)
|
||||||
inode->i_flags |= S_IMMUTABLE;
|
new_fl |= S_IMMUTABLE;
|
||||||
else
|
|
||||||
inode->i_flags &= ~S_IMMUTABLE;
|
|
||||||
|
|
||||||
if (flags & FS_APPEND_FL)
|
if (flags & FS_APPEND_FL)
|
||||||
inode->i_flags |= S_APPEND;
|
new_fl |= S_APPEND;
|
||||||
else
|
|
||||||
inode->i_flags &= ~S_APPEND;
|
inode_set_flags(inode, new_fl, S_IMMUTABLE | S_APPEND);
|
||||||
|
|
||||||
if (flags & FS_NODUMP_FL)
|
if (flags & FS_NODUMP_FL)
|
||||||
hip->userflags |= HFSPLUS_FLG_NODUMP;
|
hip->userflags |= HFSPLUS_FLG_NODUMP;
|
||||||
|
|||||||
Reference in New Issue
Block a user