aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2010-09-03 12:57:11 -0700
committerSage Weil <sage@newdream.net>2010-09-11 10:52:47 -0700
commit3d4401d9d0aef5c40706350685ddea3df6708496 (patch)
tree91f92cdc2bb440ffd1baff6bf3efdc2b83855174 /fs/ceph
parentca04d9c3ec721e474f00992efc1b1afb625507f5 (diff)
downloadkernel_samsung_smdk4412-3d4401d9d0aef5c40706350685ddea3df6708496.zip
kernel_samsung_smdk4412-3d4401d9d0aef5c40706350685ddea3df6708496.tar.gz
kernel_samsung_smdk4412-3d4401d9d0aef5c40706350685ddea3df6708496.tar.bz2
ceph: fix pagelist kunmap tail
A wrong parameter was passed to the kunmap. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/pagelist.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/ceph/pagelist.c b/fs/ceph/pagelist.c
index b6859f4..46a368b 100644
--- a/fs/ceph/pagelist.c
+++ b/fs/ceph/pagelist.c
@@ -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;
}