btrfs: convert kmap to kmap_local_page, simple cases
[sfrench/cifs-2.6.git] / fs / btrfs / lzo.c
index 9084a950dc091c0bef974613108d8b5c3988b202..cd042c7567a4752f2103cb2d1d5a23fc578ff5b2 100644 (file)
@@ -118,7 +118,7 @@ int lzo_compress_pages(struct list_head *ws, struct address_space *mapping,
        struct workspace *workspace = list_entry(ws, struct workspace, list);
        int ret = 0;
        char *data_in;
-       char *cpage_out;
+       char *cpage_out, *sizes_ptr;
        int nr_pages = 0;
        struct page *in_page = NULL;
        struct page *out_page = NULL;
@@ -258,10 +258,9 @@ int lzo_compress_pages(struct list_head *ws, struct address_space *mapping,
        }
 
        /* store the size of all chunks of compressed data */
-       cpage_out = kmap(pages[0]);
-       write_compress_length(cpage_out, tot_out);
-
-       kunmap(pages[0]);
+       sizes_ptr = kmap_local_page(pages[0]);
+       write_compress_length(sizes_ptr, tot_out);
+       kunmap_local(sizes_ptr);
 
        ret = 0;
        *total_out = tot_out;