int again = 0;
u32 bnum;
int bcnt;
- int inum, fsnum;
+ u32 inum, fsnum;
struct inode *ino = NULL;
struct datablock *b, *tmp;
break;
} else {
dprintk("got the inode\n");
- if (bnum > (i_size_read(ino) >> ino->i_blkbits))
+ /* Minor optimisation for files that have shrunk */
+ if (LAFSI(ino)->type >= TypeBase &&
+ (bnum << ino->i_blkbits) >= i_size_read(ino))
goto skip;
- /* FIXME that test isn't really right, and maybe
- * we should include some locking?? But how important
- * is it to avoid blocked beyond EOF anyway??
- */
b = lafs_get_block(ino, bnum, NULL, GFP_NOFS,
MKREF(cleaning));
if (b == NULL)