From 9576429f7ff53a80dcbc6dbeea934bc1ae23c538 Mon Sep 17 00:00:00 2001 From: "(none)!yura" <(none)!yura> Date: Thu, 8 Jul 2004 20:19:52 +0000 Subject: [PATCH] ntfs_rl_p{read,write}: "* vol->cluster_size" replaced with faster and more compatible "<< vol->cluster_size_bits" (Logical change 1.448) --- libntfs/runlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libntfs/runlist.c b/libntfs/runlist.c index 0e6b2c75..7b8968fe 100644 --- a/libntfs/runlist.c +++ b/libntfs/runlist.c @@ -1035,7 +1035,7 @@ s64 ntfs_rl_pread(const ntfs_volume *vol, const runlist_element *rl, /* Seek in @rl to the run containing @pos. */ for (ofs = 0; rl->length && (ofs + (rl->length << vol->cluster_size_bits) <= pos); rl++) - ofs += rl->length * vol->cluster_size; + ofs += (rl->length << vol->cluster_size_bits); /* Offset in the run at which to begin reading. */ ofs = pos - ofs; for (total = 0LL; count; rl++, ofs = 0) { @@ -1119,7 +1119,7 @@ s64 ntfs_rl_pwrite(const ntfs_volume *vol, const runlist_element *rl, /* Seek in @rl to the run containing @pos. */ for (ofs = 0; rl->length && (ofs + (rl->length << vol->cluster_size_bits) <= pos); rl++) - ofs += rl->length * vol->cluster_size; + ofs += (rl->length << vol->cluster_size_bits); /* Offset in the run at which to begin writing. */ ofs = pos - ofs; for (total = 0LL; count; rl++, ofs = 0) {