diff options
author | Jan Kara <jack@suse.cz> | 2009-08-17 11:00:02 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-09-14 11:08:17 -0400 |
commit | 2f3d675bcd4a84251d6e8eea8096ec8fc795e5d6 (patch) | |
tree | 3b186e4960d4553fac577be5f1def6d17196beca /fs/fat | |
parent | aa3caafe53cab7ef60605e481cd5d7943e1c3022 (diff) |
fat: Opencode sync_page_range_nolock()
fat_cont_expand() is the only user of sync_page_range_nolock(). It's also the
only user of generic_osync_inode() which does not have a file open. So
opencode needed actions for FAT so that we can convert generic_osync_inode() to
a standard syncing path.
Update a comment about generic_osync_inode().
CC: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/fat')
-rw-r--r-- | fs/fat/file.c | 22 | ||||
-rw-r--r-- | fs/fat/misc.c | 4 |
2 files changed, 22 insertions, 4 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c index f042b965c95c..e8c159de236b 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -176,8 +176,26 @@ static int fat_cont_expand(struct inode *inode, loff_t size) | |||
176 | 176 | ||
177 | inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; | 177 | inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; |
178 | mark_inode_dirty(inode); | 178 | mark_inode_dirty(inode); |
179 | if (IS_SYNC(inode)) | 179 | if (IS_SYNC(inode)) { |
180 | err = sync_page_range_nolock(inode, mapping, start, count); | 180 | int err2; |
181 | |||
182 | /* | ||
183 | * Opencode syncing since we don't have a file open to use | ||
184 | * standard fsync path. | ||
185 | */ | ||
186 | err = filemap_fdatawrite_range(mapping, start, | ||
187 | start + count - 1); | ||
188 | err2 = sync_mapping_buffers(mapping); | ||
189 | if (!err) | ||
190 | err = err2; | ||
191 | err2 = write_inode_now(inode, 1); | ||
192 | if (!err) | ||
193 | err = err2; | ||
194 | if (!err) { | ||
195 | err = filemap_fdatawait_range(mapping, start, | ||
196 | start + count - 1); | ||
197 | } | ||
198 | } | ||
181 | out: | 199 | out: |
182 | return err; | 200 | return err; |
183 | } | 201 | } |
diff --git a/fs/fat/misc.c b/fs/fat/misc.c index a6c20473dfd7..4e35be873e09 100644 --- a/fs/fat/misc.c +++ b/fs/fat/misc.c | |||
@@ -119,8 +119,8 @@ int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster) | |||
119 | MSDOS_I(inode)->i_start = new_dclus; | 119 | MSDOS_I(inode)->i_start = new_dclus; |
120 | MSDOS_I(inode)->i_logstart = new_dclus; | 120 | MSDOS_I(inode)->i_logstart = new_dclus; |
121 | /* | 121 | /* |
122 | * Since generic_osync_inode() synchronize later if | 122 | * Since generic_write_sync() synchronizes regular files later, |
123 | * this is not directory, we don't here. | 123 | * we sync here only directories. |
124 | */ | 124 | */ |
125 | if (S_ISDIR(inode->i_mode) && IS_DIRSYNC(inode)) { | 125 | if (S_ISDIR(inode->i_mode) && IS_DIRSYNC(inode)) { |
126 | ret = fat_sync_inode(inode); | 126 | ret = fat_sync_inode(inode); |