The patch titled Subject: zram: cosmetic zram_bvec_write() cleanup has been added to the -mm tree. Its filename is zram-cosmetic-zram_bvec_write-cleanup.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/zram-cosmetic-zram_bvec_write-cleanup.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/zram-cosmetic-zram_bvec_write-cleanup.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> Subject: zram: cosmetic zram_bvec_write() cleanup `bool locked' local variable tells us if we should perform zcomp_strm_release() or not (jumped to `out' label before zcomp_strm_find() occurred), which is equivalent to `zstrm' being or not being NULL. remove `locked' and check `zstrm' instead. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> Acked-by: Minchan Kim <minchan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/block/zram/zram_drv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff -puN drivers/block/zram/zram_drv.c~zram-cosmetic-zram_bvec_write-cleanup drivers/block/zram/zram_drv.c --- a/drivers/block/zram/zram_drv.c~zram-cosmetic-zram_bvec_write-cleanup +++ a/drivers/block/zram/zram_drv.c @@ -642,8 +642,7 @@ static int zram_bvec_write(struct zram * struct page *page; unsigned char *user_mem, *cmem, *src, *uncmem = NULL; struct zram_meta *meta = zram->meta; - struct zcomp_strm *zstrm; - bool locked = false; + struct zcomp_strm *zstrm = NULL; unsigned long alloced_pages; page = bvec->bv_page; @@ -663,7 +662,6 @@ static int zram_bvec_write(struct zram * } zstrm = zcomp_strm_find(zram->comp); - locked = true; user_mem = kmap_atomic(page); if (is_partial_io(bvec)) { @@ -735,7 +733,7 @@ static int zram_bvec_write(struct zram * } zcomp_strm_release(zram->comp, zstrm); - locked = false; + zstrm = NULL; zs_unmap_object(meta->mem_pool, handle); /* @@ -753,7 +751,7 @@ static int zram_bvec_write(struct zram * atomic64_add(clen, &zram->stats.compr_data_size); atomic64_inc(&zram->stats.pages_stored); out: - if (locked) + if (zstrm) zcomp_strm_release(zram->comp, zstrm); if (is_partial_io(bvec)) kfree(uncmem); _ Patches currently in -mm which might be from sergey.senozhatsky@xxxxxxxxx are zram-add-compact-sysfs-entry-to-documentation.patch zram-cosmetic-zram_attr_ro-code-formatting-tweak.patch zram-use-idr-instead-of-zram_devices-array.patch zram-reorganize-code-layout.patch zram-remove-max_num_devices-limitation.patch zram-report-every-added-and-removed-device.patch zram-trivial-correct-flag-operations-comment.patch zram-return-zram-device_id-from-zram_add.patch zram-close-race-by-open-overriding.patch zram-add-dynamic-device-add-remove-functionality.patch zram-cosmetic-zram_bvec_write-cleanup.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html