Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29668
b: refs/heads/master
c: 2061df0
h: refs/heads/master
v: v3
  • Loading branch information
Evgeniy Dushistov authored and Linus Torvalds committed Jun 25, 2006
1 parent 6eeca34 commit 0cdc508
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 48 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: a9adb8dbcd7a337620862106f8c17aeb5e7278c7
refs/heads/master: 2061df0f89201c0abeb4c17d343309c9fae5b861
55 changes: 21 additions & 34 deletions trunk/fs/ufs/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,13 @@ static int ufs_trunc_indirect (struct inode * inode, unsigned offset, __fs32 *p)
if (*ubh_get_addr32(ind_ubh,i))
break;
if (i >= uspi->s_apb) {
if (ubh_max_bcount(ind_ubh) != 1) {
retry = 1;
}
else {
tmp = fs32_to_cpu(sb, *p);
*p = 0;
inode->i_blocks -= uspi->s_nspb;
mark_inode_dirty(inode);
ufs_free_blocks (inode, tmp, uspi->s_fpb);
ubh_bforget(ind_ubh);
ind_ubh = NULL;
}
tmp = fs32_to_cpu(sb, *p);
*p = 0;
inode->i_blocks -= uspi->s_nspb;
mark_inode_dirty(inode);
ufs_free_blocks (inode, tmp, uspi->s_fpb);
ubh_bforget(ind_ubh);
ind_ubh = NULL;
}
if (IS_SYNC(inode) && ind_ubh && ubh_buffer_dirty(ind_ubh)) {
ubh_ll_rw_block (SWRITE, 1, &ind_ubh);
Expand Down Expand Up @@ -306,17 +301,13 @@ static int ufs_trunc_dindirect (struct inode *inode, unsigned offset, __fs32 *p)
if (*ubh_get_addr32 (dind_bh, i))
break;
if (i >= uspi->s_apb) {
if (ubh_max_bcount(dind_bh) != 1)
retry = 1;
else {
tmp = fs32_to_cpu(sb, *p);
*p = 0;
inode->i_blocks -= uspi->s_nspb;
mark_inode_dirty(inode);
ufs_free_blocks (inode, tmp, uspi->s_fpb);
ubh_bforget(dind_bh);
dind_bh = NULL;
}
tmp = fs32_to_cpu(sb, *p);
*p = 0;
inode->i_blocks -= uspi->s_nspb;
mark_inode_dirty(inode);
ufs_free_blocks (inode, tmp, uspi->s_fpb);
ubh_bforget(dind_bh);
dind_bh = NULL;
}
if (IS_SYNC(inode) && dind_bh && ubh_buffer_dirty(dind_bh)) {
ubh_ll_rw_block (SWRITE, 1, &dind_bh);
Expand Down Expand Up @@ -370,17 +361,13 @@ static int ufs_trunc_tindirect (struct inode * inode)
if (*ubh_get_addr32 (tind_bh, i))
break;
if (i >= uspi->s_apb) {
if (ubh_max_bcount(tind_bh) != 1)
retry = 1;
else {
tmp = fs32_to_cpu(sb, *p);
*p = 0;
inode->i_blocks -= uspi->s_nspb;
mark_inode_dirty(inode);
ufs_free_blocks (inode, tmp, uspi->s_fpb);
ubh_bforget(tind_bh);
tind_bh = NULL;
}
tmp = fs32_to_cpu(sb, *p);
*p = 0;
inode->i_blocks -= uspi->s_nspb;
mark_inode_dirty(inode);
ufs_free_blocks (inode, tmp, uspi->s_fpb);
ubh_bforget(tind_bh);
tind_bh = NULL;
}
if (IS_SYNC(inode) && tind_bh && ubh_buffer_dirty(tind_bh)) {
ubh_ll_rw_block (SWRITE, 1, &tind_bh);
Expand Down
12 changes: 0 additions & 12 deletions trunk/fs/ufs/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,6 @@ void ubh_wait_on_buffer (struct ufs_buffer_head * ubh)
wait_on_buffer (ubh->bh[i]);
}

unsigned ubh_max_bcount (struct ufs_buffer_head * ubh)
{
unsigned i;
unsigned max = 0;
if (!ubh)
return 0;
for ( i = 0; i < ubh->count; i++ )
if ( atomic_read(&ubh->bh[i]->b_count) > max )
max = atomic_read(&ubh->bh[i]->b_count);
return max;
}

void ubh_bforget (struct ufs_buffer_head * ubh)
{
unsigned i;
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/ufs/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ extern void ubh_mark_buffer_dirty (struct ufs_buffer_head *);
extern void ubh_mark_buffer_uptodate (struct ufs_buffer_head *, int);
extern void ubh_ll_rw_block (int, unsigned, struct ufs_buffer_head **);
extern void ubh_wait_on_buffer (struct ufs_buffer_head *);
extern unsigned ubh_max_bcount (struct ufs_buffer_head *);
extern void ubh_bforget (struct ufs_buffer_head *);
extern int ubh_buffer_dirty (struct ufs_buffer_head *);
#define ubh_ubhcpymem(mem,ubh,size) _ubh_ubhcpymem_(uspi,mem,ubh,size)
Expand Down

0 comments on commit 0cdc508

Please sign in to comment.