diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-02 14:22:04 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-04 10:29:28 -0500 |
commit | 76e8d7cb71d415581402dbc5c5bbbbcc28ca0e47 (patch) | |
tree | 0931ab7c56068073b12ec74b39dd479c42de2fe6 | |
parent | 222e4adec52418dc1c80a30eff80b33ec954745e (diff) | |
download | linux-76e8d7cb71d415581402dbc5c5bbbbcc28ca0e47.tar.gz linux-76e8d7cb71d415581402dbc5c5bbbbcc28ca0e47.tar.bz2 linux-76e8d7cb71d415581402dbc5c5bbbbcc28ca0e47.zip |
jfs: microoptimize get_zeroed_page / virt_to_page
get_zeroed_page does alloc_page and returns page_address of the result;
subsequent virt_to_page will recover the page, but since the caller
needs both page and its page_address() anyway, why bother going through
that wrapper at all?
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/jfs/jfs_logmgr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index a69bdf2a1085..a270cb7ff4e0 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1835,17 +1835,16 @@ static int lbmLogInit(struct jfs_log * log) for (i = 0; i < LOGPAGES;) { char *buffer; uint offset; - struct page *page; + struct page *page = alloc_page(GFP_KERNEL | __GFP_ZERO); - buffer = (char *) get_zeroed_page(GFP_KERNEL); - if (buffer == NULL) + if (!page) goto error; - page = virt_to_page(buffer); + buffer = page_address(page); for (offset = 0; offset < PAGE_SIZE; offset += LOGPSIZE) { lbuf = kmalloc(sizeof(struct lbuf), GFP_KERNEL); if (lbuf == NULL) { if (offset == 0) - free_page((unsigned long) buffer); + __free_page(page); goto error; } if (offset) /* we already have one reference */ |