Use page_count() since that is recommended over using atomic_read() directly.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4174 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-03-27 01:50:30 +00:00
parent 8517d9da8a
commit 159448f746

View File

@@ -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--;