diff options
Diffstat (limited to 'fs/hostfs')
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 2638c834ed2..0d22afdd461 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -362,9 +362,20 @@ retry: | |||
362 | return 0; | 362 | return 0; |
363 | } | 363 | } |
364 | 364 | ||
365 | int hostfs_fsync(struct file *file, int datasync) | 365 | int hostfs_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
366 | { | 366 | { |
367 | return fsync_file(HOSTFS_I(file->f_mapping->host)->fd, datasync); | 367 | struct inode *inode = file->f_mapping->host; |
368 | int ret; | ||
369 | |||
370 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); | ||
371 | if (ret) | ||
372 | return ret; | ||
373 | |||
374 | mutex_lock(&inode->i_mutex); | ||
375 | ret = fsync_file(HOSTFS_I(inode)->fd, datasync); | ||
376 | mutex_unlock(&inode->i_mutex); | ||
377 | |||
378 | return ret; | ||
368 | } | 379 | } |
369 | 380 | ||
370 | static const struct file_operations hostfs_file_fops = { | 381 | static const struct file_operations hostfs_file_fops = { |
@@ -748,12 +759,12 @@ int hostfs_rename(struct inode *from_ino, struct dentry *from, | |||
748 | return err; | 759 | return err; |
749 | } | 760 | } |
750 | 761 | ||
751 | int hostfs_permission(struct inode *ino, int desired, unsigned int flags) | 762 | int hostfs_permission(struct inode *ino, int desired) |
752 | { | 763 | { |
753 | char *name; | 764 | char *name; |
754 | int r = 0, w = 0, x = 0, err; | 765 | int r = 0, w = 0, x = 0, err; |
755 | 766 | ||
756 | if (flags & IPERM_FLAG_RCU) | 767 | if (desired & MAY_NOT_BLOCK) |
757 | return -ECHILD; | 768 | return -ECHILD; |
758 | 769 | ||
759 | if (desired & MAY_READ) r = 1; | 770 | if (desired & MAY_READ) r = 1; |
@@ -770,7 +781,7 @@ int hostfs_permission(struct inode *ino, int desired, unsigned int flags) | |||
770 | err = access_file(name, r, w, x); | 781 | err = access_file(name, r, w, x); |
771 | __putname(name); | 782 | __putname(name); |
772 | if (!err) | 783 | if (!err) |
773 | err = generic_permission(ino, desired, flags, NULL); | 784 | err = generic_permission(ino, desired); |
774 | return err; | 785 | return err; |
775 | } | 786 | } |
776 | 787 | ||