Re: free_page() in readpage?

From: Juan J. Quintela (quintela@fi.udc.es)
Date: Wed May 03 2000 - 07:17:11 EST


>>>>> "thomas" == Thomas Horsten <th@horsten.com> writes:

Hi

please, use the macros defined in include/linux/mm.h to access the
PG_* bits. In this case:

thomas> atomic_inc(&page->count);
thomas> set_bit(PG_locked, &page->flags);
thomas> buf = page_address(page);

get_page(page);
LockPage(page);
buf = page_address(page);

    I am not sure that you want to use here LockPage, I think that you
    will preffer TryLockPage(page), but I don't now about this
    specific example.

thomas> clear_bit(PG_locked, &page->flags);
thomas> wake_up(&page->wait);
thomas> free_page(buf);
thomas> return result;

UnlockPage(page);
free_page(buf);
return result;

Note I am not discussing the logic of the operation. I am only proposing
the use of the macros. I don't know the answer to your question.

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:11 EST