From 99619df061623c26d5c1767e50c136a6e7bcc799 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 3 Dec 2000 04:41:37 +0000 Subject: 2000-10-01 Roland McGrath * truncate.c (diskfs_truncate): Use & instead of %. --- ext2fs/truncate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext2fs') 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); -- cgit v1.2.3