diff options
author | Amerigo Wang <amwang@redhat.com> | 2010-05-05 00:26:45 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-15 23:28:38 -0700 |
commit | 00b7c3395aec3df43de5bd02a3c5a099ca51169f (patch) | |
tree | 6e4a1ec71a1cedadab752bdbfc25ddbf53202447 /lib/genalloc.c | |
parent | 1cdc5abf40c561982d2f7b06bcff17f9496309a5 (diff) |
sysctl: refactor integer handling proc code
(Based on Octavian's work, and I modified a lot.)
As we are about to add another integer handling proc function a little
bit of cleanup is in order: add a few helper functions to improve code
readability and decrease code duplication.
In the process a bug is also fixed: if the user specifies a number
with more then 20 digits it will be interpreted as two integers
(e.g. 10000...13 will be interpreted as 100.... and 13).
Behavior for EFAULT handling was changed as well. Previous to this
patch, when an EFAULT error occurred in the middle of a write
operation, although some of the elements were set, that was not
acknowledged to the user (by shorting the write and returning the
number of bytes accepted). EFAULT is now treated just like any other
errors by acknowledging the amount of bytes accepted.
Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/genalloc.c')
0 files changed, 0 insertions, 0 deletions