aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/util.h
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2006-06-25 08:47:23 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:02 -0400
commit3e41f597b1595479e4a1b2e6b17b3542120ef165 (patch)
treea4adfd190f25b6b896ae04e9d4cbd6c4d94c872c /fs/ufs/util.h
parent9695ef16ed4e00b59303f39f9a4a422a2c6a3b89 (diff)
[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 <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ufs/util.h')
-rw-r--r--fs/ufs/util.h26
1 files changed, 0 insertions, 26 deletions
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,
513 if (fragsize > 0 && fragsize < uspi->s_fpb) 513 if (fragsize > 0 && fragsize < uspi->s_fpb)
514 fs32_add(sb, &fraglist[fragsize], cnt); 514 fs32_add(sb, &fraglist[fragsize], cnt);
515} 515}
516
517#define ubh_scanc(ubh,begin,size,table,mask) _ubh_scanc_(uspi,ubh,begin,size,table,mask)
518static inline unsigned _ubh_scanc_(struct ufs_sb_private_info * uspi, struct ufs_buffer_head * ubh,
519 unsigned begin, unsigned size, unsigned char * table, unsigned char mask)
520{
521 unsigned rest, offset;
522 unsigned char * cp;
523
524
525 offset = begin & ~uspi->s_fmask;
526 begin >>= uspi->s_fshift;
527 for (;;) {
528 if ((offset + size) < uspi->s_fsize)
529 rest = size;
530 else
531 rest = uspi->s_fsize - offset;
532 size -= rest;
533 cp = ubh->bh[begin]->b_data + offset;
534 while ((table[*cp++] & mask) == 0 && --rest);
535 if (rest || !size)
536 break;
537 begin++;
538 offset = 0;
539 }
540 return (size + rest);
541}