diff options
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 24a363b..775f200 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -19,6 +19,7 @@ #include <linux/compat.h> #include <linux/uaccess.h> #include <linux/mount.h> +#include <linux/dcache.h> #include "f2fs.h" #include "node.h" @@ -91,7 +92,17 @@ static int get_parent_ino(struct inode *inode, nid_t *pino) struct dentry *dentry; inode = igrab(inode); - dentry = d_find_any_alias(inode); + + /* Alex - the following is equivalent to: dentry = d_find_any_alias(inode); */ + dentry = NULL; + spin_lock(&inode->i_lock); + if (!list_empty(&inode->i_dentry)) { + dentry = list_first_entry(&inode->i_dentry, + struct dentry, d_alias); + dget(dentry); + } + spin_unlock(&inode->i_lock); + iput(inode); if (!dentry) return 0; @@ -106,7 +117,7 @@ static int get_parent_ino(struct inode *inode, nid_t *pino) return 1; } -int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) +int f2fs_sync_file(struct file *file, int datasync) { struct inode *inode = file->f_mapping->host; struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); @@ -122,17 +133,10 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) return 0; trace_f2fs_sync_file_enter(inode); - ret = filemap_write_and_wait_range(inode->i_mapping, start, end); - if (ret) { - trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret); - return ret; - } /* guarantee free sections for fsync */ f2fs_balance_fs(sbi); - mutex_lock(&inode->i_mutex); - /* * Both of fdatasync() and fsync() are able to be recovered from * sudden-power-off. @@ -178,7 +182,6 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) ret = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); } out: - mutex_unlock(&inode->i_mutex); trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret); return ret; } @@ -394,7 +397,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) const struct inode_operations f2fs_file_inode_operations = { .getattr = f2fs_getattr, .setattr = f2fs_setattr, - .get_acl = f2fs_get_acl, + .check_acl = f2fs_check_acl, #ifdef CONFIG_F2FS_FS_XATTR .setxattr = generic_setxattr, .getxattr = generic_getxattr, @@ -598,7 +601,7 @@ long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { unsigned int oldflags; - ret = mnt_want_write_file(filp); + ret = mnt_want_write(filp->f_path.mnt); if (ret) return ret; @@ -635,7 +638,7 @@ long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) inode->i_ctime = CURRENT_TIME; mark_inode_dirty(inode); out: - mnt_drop_write_file(filp); + mnt_drop_write(filp->f_path.mnt); return ret; } default: |