Skip to content

Commit

Permalink
fs/jfs/jfs_inode.c: atomically set inode->i_flags
Browse files Browse the repository at this point in the history
commit 24e4a0f upstream.

According to commit 5f16f32

ext4: atomically set inode->i_flags in ext4_set_inode_flags()

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
  • Loading branch information
Fabian Frederick authored and Jiri Slaby committed Dec 3, 2014
1 parent ec81c28 commit 7e3bea4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions fs/jfs/jfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@
void jfs_set_inode_flags(struct inode *inode)
{
unsigned int flags = JFS_IP(inode)->mode2;

inode->i_flags &= ~(S_IMMUTABLE | S_APPEND |
S_NOATIME | S_DIRSYNC | S_SYNC);
unsigned int new_fl = 0;

if (flags & JFS_IMMUTABLE_FL)
inode->i_flags |= S_IMMUTABLE;
new_fl |= S_IMMUTABLE;
if (flags & JFS_APPEND_FL)
inode->i_flags |= S_APPEND;
new_fl |= S_APPEND;
if (flags & JFS_NOATIME_FL)
inode->i_flags |= S_NOATIME;
new_fl |= S_NOATIME;
if (flags & JFS_DIRSYNC_FL)
inode->i_flags |= S_DIRSYNC;
new_fl |= S_DIRSYNC;
if (flags & JFS_SYNC_FL)
inode->i_flags |= S_SYNC;
new_fl |= S_SYNC;
inode_set_flags(inode, new_fl, S_IMMUTABLE | S_APPEND | S_NOATIME |
S_DIRSYNC | S_SYNC);
}

void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip)
Expand Down

0 comments on commit 7e3bea4

Please sign in to comment.