mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-10 05:37:25 +00:00
Add fsync file operation method
Add a scoutfs_file_fsync() which synchronously commits the current transaction and call it to fsync files and directories. This fixes a number of generic xfstests in the quick group which were failing because fsync wasn't supported. Signed-off-by: Zach Brown <zab@versity.com> Reviewed-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
@@ -1013,6 +1013,7 @@ out:
|
||||
|
||||
const struct file_operations scoutfs_dir_fops = {
|
||||
.readdir = scoutfs_readdir,
|
||||
.fsync = scoutfs_file_fsync,
|
||||
};
|
||||
|
||||
const struct inode_operations scoutfs_dir_iops = {
|
||||
|
||||
@@ -671,4 +671,5 @@ const struct file_operations scoutfs_file_fops = {
|
||||
.aio_read = generic_file_aio_read,
|
||||
.aio_write = generic_file_aio_write,
|
||||
.unlocked_ioctl = scoutfs_ioctl,
|
||||
.fsync = scoutfs_file_fsync,
|
||||
};
|
||||
|
||||
@@ -177,6 +177,12 @@ int scoutfs_sync_fs(struct super_block *sb, int wait)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int scoutfs_file_fsync(struct file *file, loff_t start, loff_t end,
|
||||
int datasync)
|
||||
{
|
||||
return scoutfs_sync_fs(file->f_inode->i_sb, 1);
|
||||
}
|
||||
|
||||
int scoutfs_hold_trans(struct super_block *sb)
|
||||
{
|
||||
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
void scoutfs_trans_write_func(struct work_struct *work);
|
||||
int scoutfs_sync_fs(struct super_block *sb, int wait);
|
||||
int scoutfs_file_fsync(struct file *file, loff_t start, loff_t end,
|
||||
int datasync);
|
||||
|
||||
int scoutfs_hold_trans(struct super_block *sb);
|
||||
void scoutfs_release_trans(struct super_block *sb);
|
||||
|
||||
Reference in New Issue
Block a user