Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29669
b: refs/heads/master
c: c9a27b5
h: refs/heads/master
i:
  29667: 6eeca34
v: v3
  • Loading branch information
Evgeniy Dushistov authored and Linus Torvalds committed Jun 25, 2006
1 parent 0cdc508 commit b4056eb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2061df0f89201c0abeb4c17d343309c9fae5b861
refs/heads/master: c9a27b5dca52bbd0955e065e49e56eb313d02c34
15 changes: 0 additions & 15 deletions trunk/fs/ufs/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,6 @@ void ufs_free_blocks (struct inode * inode, unsigned fragment, unsigned count) {
}



#define NULLIFY_FRAGMENTS \
for (i = oldcount; i < newcount; i++) { \
bh = sb_getblk(sb, result + i); \
memset (bh->b_data, 0, sb->s_blocksize); \
set_buffer_uptodate(bh); \
mark_buffer_dirty (bh); \
if (IS_SYNC(inode)) \
sync_dirty_buffer(bh); \
brelse (bh); \
}

unsigned ufs_new_fragments (struct inode * inode, __fs32 * p, unsigned fragment,
unsigned goal, unsigned count, int * err )
{
Expand Down Expand Up @@ -312,7 +300,6 @@ unsigned ufs_new_fragments (struct inode * inode, __fs32 * p, unsigned fragment,
*err = 0;
inode->i_blocks += count << uspi->s_nspfshift;
UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count);
NULLIFY_FRAGMENTS
}
unlock_super(sb);
UFSD(("EXIT, result %u\n", result))
Expand All @@ -327,7 +314,6 @@ unsigned ufs_new_fragments (struct inode * inode, __fs32 * p, unsigned fragment,
*err = 0;
inode->i_blocks += count << uspi->s_nspfshift;
UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count);
NULLIFY_FRAGMENTS
unlock_super(sb);
UFSD(("EXIT, result %u\n", result))
return result;
Expand Down Expand Up @@ -379,7 +365,6 @@ unsigned ufs_new_fragments (struct inode * inode, __fs32 * p, unsigned fragment,
*err = 0;
inode->i_blocks += count << uspi->s_nspfshift;
UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count);
NULLIFY_FRAGMENTS
unlock_super(sb);
if (newcount < request)
ufs_free_fragments (inode, result + newcount, request - newcount);
Expand Down
30 changes: 18 additions & 12 deletions trunk/fs/ufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ u64 ufs_frag_map(struct inode *inode, sector_t frag)
return ret;
}

static void ufs_clear_block(struct inode *inode, struct buffer_head *bh)
{
lock_buffer(bh);
memset(bh->b_data, 0, inode->i_sb->s_blocksize);
set_buffer_uptodate(bh);
mark_buffer_dirty(bh);
unlock_buffer(bh);
if (IS_SYNC(inode))
sync_dirty_buffer(bh);
}

static struct buffer_head * ufs_inode_getfrag (struct inode *inode,
unsigned int fragment, unsigned int new_fragment,
unsigned int required, int *err, int metadata, long *phys, int *new)
Expand Down Expand Up @@ -204,7 +215,7 @@ static struct buffer_head * ufs_inode_getfrag (struct inode *inode,
brelse (result);
goto repeat;
} else {
*phys = tmp;
*phys = tmp + blockoff;
return NULL;
}
}
Expand Down Expand Up @@ -259,14 +270,11 @@ static struct buffer_head * ufs_inode_getfrag (struct inode *inode,
return NULL;
}

/* The nullification of framgents done in ufs/balloc.c is
* something I don't have the stomache to move into here right
* now. -DaveM
*/
if (metadata) {
result = sb_getblk(inode->i_sb, tmp + blockoff);
ufs_clear_block(inode, result);
} else {
*phys = tmp;
*phys = tmp + blockoff;
result = NULL;
*err = 0;
*new = 1;
Expand Down Expand Up @@ -333,7 +341,7 @@ static struct buffer_head * ufs_block_getfrag (struct inode *inode,
brelse (result);
goto repeat;
} else {
*phys = tmp;
*phys = tmp + blockoff;
goto out;
}
}
Expand All @@ -349,14 +357,12 @@ static struct buffer_head * ufs_block_getfrag (struct inode *inode,
goto out;
}

/* The nullification of framgents done in ufs/balloc.c is
* something I don't have the stomache to move into here right
* now. -DaveM
*/

if (metadata) {
result = sb_getblk(sb, tmp + blockoff);
ufs_clear_block(inode, result);
} else {
*phys = tmp;
*phys = tmp + blockoff;
*new = 1;
}

Expand Down

0 comments on commit b4056eb

Please sign in to comment.