diff options
author | Dave Jones <davej@redhat.com> | 2006-09-05 17:20:21 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-09-05 17:20:21 -0400 |
commit | 115b384cf87249d76adb0b21aca11ee22128927d (patch) | |
tree | f39a2a54863e9d82d1196906f92c82ab5991c6af /mm/mempolicy.c | |
parent | 8eb7925f93af75e66a240d148efdec212f95bcb7 (diff) | |
parent | c336923b668fdcf0312efbec3b44895d713f4d81 (diff) |
Merge ../linus
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index e07e27e846a2..a9963ceddd65 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -1176,7 +1176,15 @@ static inline unsigned interleave_nid(struct mempolicy *pol, | |||
1176 | if (vma) { | 1176 | if (vma) { |
1177 | unsigned long off; | 1177 | unsigned long off; |
1178 | 1178 | ||
1179 | off = vma->vm_pgoff; | 1179 | /* |
1180 | * for small pages, there is no difference between | ||
1181 | * shift and PAGE_SHIFT, so the bit-shift is safe. | ||
1182 | * for huge pages, since vm_pgoff is in units of small | ||
1183 | * pages, we need to shift off the always 0 bits to get | ||
1184 | * a useful offset. | ||
1185 | */ | ||
1186 | BUG_ON(shift < PAGE_SHIFT); | ||
1187 | off = vma->vm_pgoff >> (shift - PAGE_SHIFT); | ||
1180 | off += (addr - vma->vm_start) >> shift; | 1188 | off += (addr - vma->vm_start) >> shift; |
1181 | return offset_il_node(pol, vma, off); | 1189 | return offset_il_node(pol, vma, off); |
1182 | } else | 1190 | } else |