diff options
author | Roland McGrath <roland@gnu.org> | 2000-12-03 04:41:37 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2000-12-03 04:41:37 +0000 |
commit | 99619df061623c26d5c1767e50c136a6e7bcc799 (patch) | |
tree | a25b67ea32c2fe656cc3b7b534daf313e2fed8e9 | |
parent | 9ebf803f04275f1958de9f378de68e45c377ac65 (diff) |
2000-10-01 Roland McGrath <roland@frob.com>
* truncate.c (diskfs_truncate): Use & instead of %.
-rw-r--r-- | ext2fs/truncate.c | 4 |
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); |