lkml.org 
[lkml]   [2012]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] speed up /proc/pid/stat, statm
On Tue, 31 Jan 2012 17:14:43 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> +int seq_put_decimal_ll(struct seq_file *m, char delimiter,
> + long long num)
> +{
> + if (num < 0) {
> + if (m->count + 3 >= m->size) {
> + m->count = m->size;

Why is m->count udpated even thought we didn't write any data?
seq_put_decimal_ull() does it too.

> + return -1;
> + }
> + if (delimiter)
> + m->buf[m->count++] = delimiter;
> + num = -num;
> + delimiter = '-';
> + }
> + return seq_put_decimal_ull(m, delimiter, num);
> +
> +}
> +EXPORT_SYMBOL(seq_put_decimal_ll);


\
 
 \ /
  Last update: 2012-01-31 21:39    [W:0.059 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site