diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-10-09 17:43:15 -0400 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2015-11-13 11:56:17 -0500 |
commit | 9be68b08719c10cc3cc9305e7b2452475a9dcacd (patch) | |
tree | 57c53608d11d3c42f75f16b057e8fd12306d8bdd /fs/orangefs/dir.c | |
parent | ef4af94edcf8fc32ab1d4141537a4eb29ff45a40 (diff) | |
download | linux-9be68b08719c10cc3cc9305e7b2452475a9dcacd.tar.bz2 |
orangefs: get rid of dec_string and enc_string
The latter is never used, the former has one user and would be
better off spelled out right there.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/dir.c')
-rw-r--r-- | fs/orangefs/dir.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c index 280755db1814..eb4c3d334088 100644 --- a/fs/orangefs/dir.c +++ b/fs/orangefs/dir.c @@ -23,7 +23,6 @@ static long decode_dirents(char *ptr, struct pvfs2_readdir_response_s *readdir) struct pvfs2_readdir_response_s *rd = (struct pvfs2_readdir_response_s *) ptr; char *buf = ptr; - char **pptr = &buf; readdir->token = rd->token; readdir->pvfs_dirent_outcount = rd->pvfs_dirent_outcount; @@ -32,15 +31,17 @@ static long decode_dirents(char *ptr, struct pvfs2_readdir_response_s *readdir) GFP_KERNEL); if (readdir->dirent_array == NULL) return -ENOMEM; - *pptr += offsetof(struct pvfs2_readdir_response_s, dirent_array); + buf += offsetof(struct pvfs2_readdir_response_s, dirent_array); for (i = 0; i < readdir->pvfs_dirent_outcount; i++) { - dec_string(pptr, &readdir->dirent_array[i].d_name, - &readdir->dirent_array[i].d_length); + __u32 len = *(__u32 *)buf; + readdir->dirent_array[i].d_name = buf + 4; + buf += roundup8(4 + len + 1); + readdir->dirent_array[i].d_length = len; readdir->dirent_array[i].khandle = - *(struct pvfs2_khandle *) *pptr; - *pptr += 16; + *(struct pvfs2_khandle *) buf; + buf += 16; } - return (unsigned long)*pptr - (unsigned long)ptr; + return buf - ptr; } static long readdir_handle_ctor(struct readdir_handle_s *rhandle, void *buf, |