Whamcloud - gitweb
LU-1735 ptlrpc: cleanup jobid code
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 10 Aug 2012 22:24:00 +0000 (16:24 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Sep 2012 14:29:08 +0000 (10:29 -0400)
commitf6085c49dfb866934d4ba62b7e2a328102ed8a83
tree9c5fc740689235f6091cdafee9965c9764731ec4
parent886de3fb6eb2d1e65c85aa13b86422dff08cf1f4
LU-1735 ptlrpc: cleanup jobid code

Some cleanups for the jobid code:
- if obd_jobid_var is too large, only print an error message once
- in linux cfs_get_environ():
-- cache strlen(key) since it doesn't change and is used often
-- remove unnecessary typecasts of void pointers
-- use "rc" instead of "ret"
-- balance ENTRY and RETURN/GOTO calls
- add cfs_get_environ() for liblustre and remove inline #ifdef
- use strcmp() to compare strings that are known NUL-terminated
- use strlcpy() to ensure NUL-terminated strings in target buffer
-- add strlcpy() wrapper for liblustre, it isn't in Glibc on RHEL5

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I22c3d5c1755c1d6aab666a769df38218b954cab0
Reviewed-on: http://review.whamcloud.com/3713
Tested-by: Hudson
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/curproc.h
libcfs/include/libcfs/user-prim.h
libcfs/libcfs/linux/linux-curproc.c
libcfs/libcfs/user-prim.c
lustre/obdclass/class_obd.c
lustre/obdclass/obd_config.c