lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 27 Mar 2018 17:10:15 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:     Minchan Kim <minchan@...nel.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 4/4] zram: introduce zram memory tracking

On (03/27/18 15:50), Minchan Kim wrote:
[..]
>
> +	char flags[__NR_ZRAM_PAGEFLAGS - ZRAM_FLAG_SHIFT];
>

Technically, you don't need this buffer...

> +		snprintf(flags, sizeof(flags), "%c%c%c",
> +			zram_test_flag(zram, index, ZRAM_SAME) ? 's' : '.',
> +			zram_test_flag(zram, index, ZRAM_WB) ? 'w' : '.',
> +			zram_test_flag(zram, index, ZRAM_HUGE) ? 'h' : '.');
> +
> +		last_access = get_seconds() - zram->table[index].ac_time;
> +		copied = snprintf(kbuf + written, count, "%12lu %6s %12lu\n",
> +						index, flags, last_access);

... if you'll do flags decoding in place. But if you prefer it this way
then OK.

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ