summaryrefslogtreecommitdiff
path: root/fs/orangefs/protocol.h
diff options
context:
space:
mode:
authorMike Marshall <hubcap@omnibond.com>2016-04-06 18:19:37 +0300
committerMike Marshall <hubcap@omnibond.com>2016-04-08 21:08:27 +0300
commita9bb3ba81fba1750139654360cb716ab093103b0 (patch)
tree98483c708424a6aa36a66a823d6e90fc9102840f /fs/orangefs/protocol.h
parent2d09a2ca6a6c66d765458df2653f888c4a481c81 (diff)
downloadlinux-a9bb3ba81fba1750139654360cb716ab093103b0.tar.xz
Orangefs: optimize boilerplate code.
Suggested by David Binderman <dcb314@hotmail.com> The former can potentially be a performance win over the latter. memcpy(d, s, len); memset(d+len, c, size-len); memset(d, c, size); memcpy(d, s, len); Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/protocol.h')
-rw-r--r--fs/orangefs/protocol.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/orangefs/protocol.h b/fs/orangefs/protocol.h
index 50578a28bd9e..a7f21a3b2d02 100644
--- a/fs/orangefs/protocol.h
+++ b/fs/orangefs/protocol.h
@@ -74,8 +74,8 @@ static inline void ORANGEFS_khandle_to(const struct orangefs_khandle *kh,
void *p, int size)
{
- memset(p, 0, size);
memcpy(p, kh->u, 16);
+ memset(p + 16, 0, size - 16);
}