Commit 3d4401d9 authored by Yehuda Sadeh's avatar Yehuda Sadeh Committed by Sage Weil

ceph: fix pagelist kunmap tail

A wrong parameter was passed to the kunmap.
Signed-off-by: default avatarYehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent ca04d9c3
......@@ -5,10 +5,18 @@
#include "pagelist.h"
static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl)
{
struct page *page = list_entry(pl->head.prev, struct page,
lru);
kunmap(page);
}
int ceph_pagelist_release(struct ceph_pagelist *pl)
{
if (pl->mapped_tail)
kunmap(pl->mapped_tail);
ceph_pagelist_unmap_tail(pl);
while (!list_empty(&pl->head)) {
struct page *page = list_first_entry(&pl->head, struct page,
lru);
......@@ -26,7 +34,7 @@ static int ceph_pagelist_addpage(struct ceph_pagelist *pl)
pl->room += PAGE_SIZE;
list_add_tail(&page->lru, &pl->head);
if (pl->mapped_tail)
kunmap(pl->mapped_tail);
ceph_pagelist_unmap_tail(pl);
pl->mapped_tail = kmap(page);
return 0;
}
......
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