Messages in this thread | | | Date | Tue, 27 Mar 2018 17:10:15 +0900 | From | Sergey Senozhatsky <> | 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
| |