aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/inode.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2006-06-25 08:47:19 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:01 -0400
commitc9a27b5dca52bbd0955e065e49e56eb313d02c34 (patch)
tree6e5223f9ee942e8a55552138aa67ef2a37e01738 /fs/ufs/inode.c
parent2061df0f89201c0abeb4c17d343309c9fae5b861 (diff)
[PATCH] ufs: right block allocation
* After block allocation, we map it on the same "address" as 8 others blocks * We nullify block several times: once in ufs/block.c and once in block_*write_full_page, and use different "caches" for this. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ufs/inode.c')
-rw-r--r--fs/ufs/inode.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index 3c3f62ce2ad9..2b2366360e5a 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -161,6 +161,17 @@ out:
161 return ret; 161 return ret;
162} 162}
163 163
164static void ufs_clear_block(struct inode *inode, struct buffer_head *bh)
165{
166 lock_buffer(bh);
167 memset(bh->b_data, 0, inode->i_sb->s_blocksize);
168 set_buffer_uptodate(bh);
169 mark_buffer_dirty(bh);
170 unlock_buffer(bh);
171 if (IS_SYNC(inode))
172 sync_dirty_buffer(bh);
173}
174
164static struct buffer_head * ufs_inode_getfrag (struct inode *inode, 175static struct buffer_head * ufs_inode_getfrag (struct inode *inode,
165 unsigned int fragment, unsigned int new_fragment, 176 unsigned int fragment, unsigned int new_fragment,
166 unsigned int required, int *err, int metadata, long *phys, int *new) 177 unsigned int required, int *err, int metadata, long *phys, int *new)
@@ -204,7 +215,7 @@ repeat:
204 brelse (result); 215 brelse (result);
205 goto repeat; 216 goto repeat;
206 } else { 217 } else {
207 *phys = tmp; 218 *phys = tmp + blockoff;
208 return NULL; 219 return NULL;
209 } 220 }
210 } 221 }
@@ -259,14 +270,11 @@ repeat:
259 return NULL; 270 return NULL;
260 } 271 }
261 272
262 /* The nullification of framgents done in ufs/balloc.c is
263 * something I don't have the stomache to move into here right
264 * now. -DaveM
265 */
266 if (metadata) { 273 if (metadata) {
267 result = sb_getblk(inode->i_sb, tmp + blockoff); 274 result = sb_getblk(inode->i_sb, tmp + blockoff);
275 ufs_clear_block(inode, result);
268 } else { 276 } else {
269 *phys = tmp; 277 *phys = tmp + blockoff;
270 result = NULL; 278 result = NULL;
271 *err = 0; 279 *err = 0;
272 *new = 1; 280 *new = 1;
@@ -333,7 +341,7 @@ repeat:
333 brelse (result); 341 brelse (result);
334 goto repeat; 342 goto repeat;
335 } else { 343 } else {
336 *phys = tmp; 344 *phys = tmp + blockoff;
337 goto out; 345 goto out;
338 } 346 }
339 } 347 }
@@ -349,14 +357,12 @@ repeat:
349 goto out; 357 goto out;
350 } 358 }
351 359
352 /* The nullification of framgents done in ufs/balloc.c is 360
353 * something I don't have the stomache to move into here right
354 * now. -DaveM
355 */
356 if (metadata) { 361 if (metadata) {
357 result = sb_getblk(sb, tmp + blockoff); 362 result = sb_getblk(sb, tmp + blockoff);
363 ufs_clear_block(inode, result);
358 } else { 364 } else {
359 *phys = tmp; 365 *phys = tmp + blockoff;
360 *new = 1; 366 *new = 1;
361 } 367 }
362 368