void affs_free_prealloc(struct inode *inode);
extern void affs_truncate(struct inode *);
+int affs_file_fsync(struct file *, struct dentry *, int);
/* dir.c */
.read = generic_read_dir,
.llseek = generic_file_llseek,
.readdir = affs_readdir,
- .fsync = file_fsync,
+ .fsync = affs_file_fsync,
};
/*
.mmap = generic_file_mmap,
.open = affs_file_open,
.release = affs_file_release,
- .fsync = file_fsync,
+ .fsync = affs_file_fsync,
.splice_read = generic_file_splice_read,
};
}
affs_free_prealloc(inode);
}
+
+int affs_file_fsync(struct file *filp, struct dentry *dentry, int datasync)
+{
+ struct inode * inode = dentry->d_inode;
+ int ret, err;
+
+ ret = write_inode_now(inode, 0);
+ err = sync_blockdev(inode->i_sb->s_bdev);
+ if (!ret)
+ ret = err;
+ return ret;
+}