From eb43fde1df88b7261e26139788095de0232c4365 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Fri, 11 Jan 2013 13:10:49 +0900 Subject: [PATCH] --- yaml --- r: 348969 b: refs/heads/master c: 7d82db83165dbac8c3f6d47b73c84f38e3996e30 h: refs/heads/master i: 348967: db9715f57fd82027a51ec0a1672840a8f38449d4 v: v3 --- [refs] | 2 +- trunk/fs/f2fs/file.c | 3 +++ trunk/fs/f2fs/inode.c | 3 +++ trunk/fs/f2fs/super.c | 2 ++ trunk/fs/f2fs/xattr.c | 2 ++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 06ebb9e18e88..b667f68b8134 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 408e9375610cca6d54e9c654cbe05a647687e12e +refs/heads/master: 7d82db83165dbac8c3f6d47b73c84f38e3996e30 diff --git a/trunk/fs/f2fs/file.c b/trunk/fs/f2fs/file.c index 88593c5e743c..7354c2df1087 100644 --- a/trunk/fs/f2fs/file.c +++ b/trunk/fs/f2fs/file.c @@ -137,6 +137,9 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) if (ret) return ret; + /* guarantee free sections for fsync */ + f2fs_balance_fs(sbi); + mutex_lock(&inode->i_mutex); if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) diff --git a/trunk/fs/f2fs/inode.c b/trunk/fs/f2fs/inode.c index bf20b4d03214..794241777322 100644 --- a/trunk/fs/f2fs/inode.c +++ b/trunk/fs/f2fs/inode.c @@ -217,6 +217,9 @@ int f2fs_write_inode(struct inode *inode, struct writeback_control *wbc) inode->i_ino == F2FS_META_INO(sbi)) return 0; + if (wbc) + f2fs_balance_fs(sbi); + node_page = get_node_page(sbi, inode->i_ino); if (IS_ERR(node_page)) return PTR_ERR(node_page); diff --git a/trunk/fs/f2fs/super.c b/trunk/fs/f2fs/super.c index afa7ef0c4ba7..0f2b2eb86a05 100644 --- a/trunk/fs/f2fs/super.c +++ b/trunk/fs/f2fs/super.c @@ -137,6 +137,8 @@ int f2fs_sync_fs(struct super_block *sb, int sync) if (sync) write_checkpoint(sbi, false, false); + else + f2fs_balance_fs(sbi); return 0; } diff --git a/trunk/fs/f2fs/xattr.c b/trunk/fs/f2fs/xattr.c index 940136a3d3a6..8038c0496504 100644 --- a/trunk/fs/f2fs/xattr.c +++ b/trunk/fs/f2fs/xattr.c @@ -318,6 +318,8 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name, if (name_len > 255 || value_len > MAX_VALUE_LEN) return -ERANGE; + f2fs_balance_fs(sbi); + mutex_lock_op(sbi, NODE_NEW); if (!fi->i_xattr_nid) { /* Allocate new attribute block */