From 3e41f597b1595479e4a1b2e6b17b3542120ef165 Mon Sep 17 00:00:00 2001 From: Evgeniy Dushistov Date: Sun, 25 Jun 2006 05:47:23 -0700 Subject: [PATCH] ufs: not usual amounts of fragments per block The writing to UFS file system with block/fragment!=8 may cause bogus behaviour. The problem in "ufs_bitmap_search" function, which doesn't work correctly in "block/fragment!=8" case. The idea is stolen from BSD code. Signed-off-by: Evgeniy Dushistov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/ufs/util.h | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'fs/ufs/util.h') diff --git a/fs/ufs/util.h b/fs/ufs/util.h index 6a0b48cf9cef..e95d1c46461f 100644 --- a/fs/ufs/util.h +++ b/fs/ufs/util.h @@ -513,29 +513,3 @@ static inline void ufs_fragacct (struct super_block * sb, unsigned blockmap, if (fragsize > 0 && fragsize < uspi->s_fpb) fs32_add(sb, &fraglist[fragsize], cnt); } - -#define ubh_scanc(ubh,begin,size,table,mask) _ubh_scanc_(uspi,ubh,begin,size,table,mask) -static inline unsigned _ubh_scanc_(struct ufs_sb_private_info * uspi, struct ufs_buffer_head * ubh, - unsigned begin, unsigned size, unsigned char * table, unsigned char mask) -{ - unsigned rest, offset; - unsigned char * cp; - - - offset = begin & ~uspi->s_fmask; - begin >>= uspi->s_fshift; - for (;;) { - if ((offset + size) < uspi->s_fsize) - rest = size; - else - rest = uspi->s_fsize - offset; - size -= rest; - cp = ubh->bh[begin]->b_data + offset; - while ((table[*cp++] & mask) == 0 && --rest); - if (rest || !size) - break; - begin++; - offset = 0; - } - return (size + rest); -} -- cgit v1.2.1