Commit f522c3ac authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds

mm, hugetlb: change variable name reservations to resv

'reservations' is so long name as a variable and we use 'resv_map' to
represent 'struct resv_map' in other place.  To reduce confusion and
unreadability, change it.
Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
Reviewed-by: default avatarAneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: default avatarDavidlohr Bueso <davidlohr@hp.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Hillf Danton <dhillf@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4ef91848
...@@ -1115,9 +1115,9 @@ static long vma_needs_reservation(struct hstate *h, ...@@ -1115,9 +1115,9 @@ static long vma_needs_reservation(struct hstate *h,
} else { } else {
long err; long err;
pgoff_t idx = vma_hugecache_offset(h, vma, addr); pgoff_t idx = vma_hugecache_offset(h, vma, addr);
struct resv_map *reservations = vma_resv_map(vma); struct resv_map *resv = vma_resv_map(vma);
err = region_chg(&reservations->regions, idx, idx + 1); err = region_chg(&resv->regions, idx, idx + 1);
if (err < 0) if (err < 0)
return err; return err;
return 0; return 0;
...@@ -1135,10 +1135,10 @@ static void vma_commit_reservation(struct hstate *h, ...@@ -1135,10 +1135,10 @@ static void vma_commit_reservation(struct hstate *h,
} else if (is_vma_resv_set(vma, HPAGE_RESV_OWNER)) { } else if (is_vma_resv_set(vma, HPAGE_RESV_OWNER)) {
pgoff_t idx = vma_hugecache_offset(h, vma, addr); pgoff_t idx = vma_hugecache_offset(h, vma, addr);
struct resv_map *reservations = vma_resv_map(vma); struct resv_map *resv = vma_resv_map(vma);
/* Mark this page used in the map. */ /* Mark this page used in the map. */
region_add(&reservations->regions, idx, idx + 1); region_add(&resv->regions, idx, idx + 1);
} }
} }
...@@ -2188,7 +2188,7 @@ static int hugetlb_acct_memory(struct hstate *h, long delta) ...@@ -2188,7 +2188,7 @@ static int hugetlb_acct_memory(struct hstate *h, long delta)
static void hugetlb_vm_op_open(struct vm_area_struct *vma) static void hugetlb_vm_op_open(struct vm_area_struct *vma)
{ {
struct resv_map *reservations = vma_resv_map(vma); struct resv_map *resv = vma_resv_map(vma);
/* /*
* This new VMA should share its siblings reservation map if present. * This new VMA should share its siblings reservation map if present.
...@@ -2198,34 +2198,34 @@ static void hugetlb_vm_op_open(struct vm_area_struct *vma) ...@@ -2198,34 +2198,34 @@ static void hugetlb_vm_op_open(struct vm_area_struct *vma)
* after this open call completes. It is therefore safe to take a * after this open call completes. It is therefore safe to take a
* new reference here without additional locking. * new reference here without additional locking.
*/ */
if (reservations) if (resv)
kref_get(&reservations->refs); kref_get(&resv->refs);
} }
static void resv_map_put(struct vm_area_struct *vma) static void resv_map_put(struct vm_area_struct *vma)
{ {
struct resv_map *reservations = vma_resv_map(vma); struct resv_map *resv = vma_resv_map(vma);
if (!reservations) if (!resv)
return; return;
kref_put(&reservations->refs, resv_map_release); kref_put(&resv->refs, resv_map_release);
} }
static void hugetlb_vm_op_close(struct vm_area_struct *vma) static void hugetlb_vm_op_close(struct vm_area_struct *vma)
{ {
struct hstate *h = hstate_vma(vma); struct hstate *h = hstate_vma(vma);
struct resv_map *reservations = vma_resv_map(vma); struct resv_map *resv = vma_resv_map(vma);
struct hugepage_subpool *spool = subpool_vma(vma); struct hugepage_subpool *spool = subpool_vma(vma);
unsigned long reserve; unsigned long reserve;
unsigned long start; unsigned long start;
unsigned long end; unsigned long end;
if (reservations) { if (resv) {
start = vma_hugecache_offset(h, vma, vma->vm_start); start = vma_hugecache_offset(h, vma, vma->vm_start);
end = vma_hugecache_offset(h, vma, vma->vm_end); end = vma_hugecache_offset(h, vma, vma->vm_end);
reserve = (end - start) - reserve = (end - start) -
region_count(&reservations->regions, start, end); region_count(&resv->regions, start, end);
resv_map_put(vma); resv_map_put(vma);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment