if (ret)
return ret;
+ inode_lock(inode);
+
if (f2fs_is_atomic_file(inode))
goto out;
if (ret)
clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE);
out:
+ inode_unlock(inode);
mnt_drop_write_file(filp);
return ret;
}
if (ret)
return ret;
+ inode_lock(inode);
+
if (f2fs_is_volatile_file(inode))
goto err_out;
ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true);
err_out:
+ inode_unlock(inode);
mnt_drop_write_file(filp);
return ret;
}
if (ret)
return ret;
+ inode_lock(inode);
+
if (f2fs_is_volatile_file(inode))
goto out;
set_inode_flag(F2FS_I(inode), FI_VOLATILE_FILE);
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
out:
+ inode_unlock(inode);
mnt_drop_write_file(filp);
return ret;
}
if (ret)
return ret;
+ inode_lock(inode);
+
if (!f2fs_is_volatile_file(inode))
goto out;
ret = punch_hole(inode, 0, F2FS_BLKSIZE);
out:
+ inode_unlock(inode);
mnt_drop_write_file(filp);
return ret;
}
if (ret)
return ret;
+ inode_lock(inode);
+
if (f2fs_is_atomic_file(inode))
drop_inmem_pages(inode);
if (f2fs_is_volatile_file(inode)) {
ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true);
}
+ inode_unlock(inode);
+
mnt_drop_write_file(filp);
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
return ret;