{
        struct inode *inode = file_inode(file);
        struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
-       unsigned int flags;
+       unsigned int flags, new_fl = 0;
        int err = 0;
 
        err = mnt_want_write_file(file);
        }
 
        if (flags & FS_IMMUTABLE_FL)
-               inode->i_flags |= S_IMMUTABLE;
-       else
-               inode->i_flags &= ~S_IMMUTABLE;
+               new_fl |= S_IMMUTABLE;
 
        if (flags & FS_APPEND_FL)
-               inode->i_flags |= S_APPEND;
-       else
-               inode->i_flags &= ~S_APPEND;
+               new_fl |= S_APPEND;
+
+       inode_set_flags(inode, new_fl, S_IMMUTABLE | S_APPEND);
 
        if (flags & FS_NODUMP_FL)
                hip->userflags |= HFSPLUS_FLG_NODUMP;