diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-22 23:05:57 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-22 23:05:57 +0000 |
commit | 51d3b7814cdccef9188240fe0cbd8d97ff2c7470 (patch) | |
tree | 5cbb01d0323d4f63ade66bdf48ba4a91aaa6df16 /fs/ufs/truncate.c | |
parent | 52273a23c9a84336b93a35e4847fc88fac7eb0e4 (diff) |
Merge with Linux 2.3.7.
WARNING: 2.3.7 is known to eat filesystems for breakfast and little
children for lunch, so if you try this on your machine make backups
first ...
Diffstat (limited to 'fs/ufs/truncate.c')
-rw-r--r-- | fs/ufs/truncate.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index 3fec735a2..4649a4253 100644 --- a/fs/ufs/truncate.c +++ b/fs/ufs/truncate.c @@ -62,6 +62,9 @@ #define DIRECT_BLOCK howmany (inode->i_size, uspi->s_bsize) #define DIRECT_FRAGMENT howmany (inode->i_size, uspi->s_fsize) +#define DATA_BUFFER_USED(bh) \ + ((bh->b_count > 1) || buffer_locked(bh)) + static int ufs_trunc_direct (struct inode * inode) { struct super_block * sb; @@ -114,7 +117,7 @@ static int ufs_trunc_direct (struct inode * inode) frag2 = ufs_fragnum (frag2); for (j = frag1; j < frag2; j++) { bh = get_hash_table (sb->s_dev, tmp + j, uspi->s_fsize); - if ((bh && bh->b_count != 1) || tmp != SWAB32(*p)) { + if ((bh && DATA_BUFFER_USED(bh)) || tmp != SWAB32(*p)) { retry = 1; brelse (bh); goto next1; @@ -137,7 +140,7 @@ next1: continue; for (j = 0; j < uspi->s_fpb; j++) { bh = get_hash_table (sb->s_dev, tmp + j, uspi->s_fsize); - if ((bh && bh->b_count != 1) || tmp != SWAB32(*p)) { + if ((bh && DATA_BUFFER_USED(bh)) || tmp != SWAB32(*p)) { retry = 1; brelse (bh); goto next2; @@ -176,7 +179,7 @@ next2: frag4 = ufs_fragnum (frag4); for (j = 0; j < frag4; j++) { bh = get_hash_table (sb->s_dev, tmp + j, uspi->s_fsize); - if ((bh && bh->b_count != 1) || tmp != SWAB32(*p)) { + if ((bh && DATA_BUFFER_USED(bh)) || tmp != SWAB32(*p)) { retry = 1; brelse (bh); goto next1; @@ -237,7 +240,7 @@ static int ufs_trunc_indirect (struct inode * inode, unsigned offset, u32 * p) continue; for (j = 0; j < uspi->s_fpb; j++) { bh = get_hash_table (sb->s_dev, tmp + j, uspi->s_fsize); - if ((bh && bh->b_count != 1) || tmp != SWAB32(*ind)) { + if ((bh && DATA_BUFFER_USED(bh)) || tmp != SWAB32(*ind)) { retry = 1; brelse (bh); goto next; |