merge HDFS-573 changes from trunk to jnifs.c

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HADOOP-10388@1619016 13f79535-47bb-0310-9956-ffa450edef68