From 159448f746b14b4a75ec4caa77820c212b002ee1 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 27 Mar 2012 01:50:30 +0000 Subject: [PATCH] Use page_count() since that is recommended over using atomic_read() directly. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4174 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index eb2721fe8..065158e6a 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -1209,11 +1209,11 @@ void sgv_pool_free(struct sgv_pool_obj *obj, struct scst_mem_lim *mem_lim) int len = sg[i].length; int pages = PAGE_ALIGN(len) >> PAGE_SHIFT; while (pages > 0) { - if (atomic_read(&p->_count) != 1) { + if (page_count(p) != 1) { PRINT_WARNING("Freeing page %p with " "additional owners (_count %d). " "Data corruption possible!", - p, atomic_read(&p->_count)); + p, page_count(p)); WARN_ON(1); } pages--;