summaryrefslogtreecommitdiff
path: root/ext2fs
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-12-03 04:41:37 +0000
committerRoland McGrath <roland@gnu.org>2000-12-03 04:41:37 +0000
commit99619df061623c26d5c1767e50c136a6e7bcc799 (patch)
treea25b67ea32c2fe656cc3b7b534daf313e2fed8e9 /ext2fs
parent9ebf803f04275f1958de9f378de68e45c377ac65 (diff)
2000-10-01 Roland McGrath <roland@frob.com>
* truncate.c (diskfs_truncate): Use & instead of %.
Diffstat (limited to 'ext2fs')
-rw-r--r--ext2fs/truncate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext2fs/truncate.c b/ext2fs/truncate.c
index b1793ef0..077225b0 100644
--- a/ext2fs/truncate.c
+++ b/ext2fs/truncate.c
@@ -304,7 +304,7 @@ diskfs_truncate (struct node *node, off_t length)
* zeroed in case it ever becomes accessible again because of
* subsequent file growth.
*/
- offset = length % block_size;
+ offset = length & (block_size - 1);
if (offset > 0)
{
diskfs_node_rdwr (node, (void *)zeroblock, length, block_size - offset,
@@ -312,7 +312,7 @@ diskfs_truncate (struct node *node, off_t length)
diskfs_file_update (node, 1);
}
- ext2_discard_prealloc(node);
+ ext2_discard_prealloc (node);
force_delayed_copies (node, length);