Displaying 1 result from an estimated 1 matches for "blocks_for_trunc".
2003 Feb 04
0
[PATCH] Fix signed use of i_blocks in ext3 truncate
...3/inode.c.=K0000=.orig 2003-02-03 19:14:43.000000000 +0000
+++ linux-2.4-tmp/fs/ext3/inode.c 2003-02-03 19:17:35.000000000 +0000
@@ -87,6 +87,34 @@
return err;
}
+/*
+ * Work out how many blocks we need to progress with the next chunk of a
+ * truncate transaction.
+ */
+
+static unsigned long blocks_for_truncate(struct inode *inode)
+{
+ unsigned long needed;
+
+ needed = inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9);
+
+ /* Give ourselves just enough room to cope with inodes in which
+ * i_blocks is corrupt: we've seen disk corruptions in the past
+ * which resulted in r...