[L] Change in ...nfs-ganesha[next]: Make FSAL readlink use utf8string instead of gsh_buffdesc and elimina...
by Frank Filz (GerritHub)
Frank Filz has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1226855?usp=email )
Change subject: Make FSAL readlink use utf8string instead of gsh_buffdesc and eliminate gsh_strldup
......................................................................
Make FSAL readlink use utf8string instead of gsh_buffdesc and eliminate gsh_strldup
gsh_strldup was used in several places to make copies of a string in
either a gsh_buffdesc or a utf8string which use different types for the
length. Also the length in gsh_buffdesc is the length of the buffer so
it is string length +1. The length was not being consistently set.
Changing the FSAL readlink method to take a utf8string instead of a
gsh_buffdesc allows for a clear definitions since we assure that
internally all utf8strings are NUL terminated with the length just
being a conveniemce.
Introduced a new function that copies a character buffer (that need not
be NUL terminated) into a utf8string, making a copy of the buffer,
adding a NUL termination, and setting the utf8string_len properly.
This allows elimination of all uses of the gsh_strldup macro that
doesn't convert to an inline function well (due the the unknown type
of the length variable) as part of a subsequent patch to make more
header files usable with C++.
Change-Id: Ifd5a250ba500f005d4345cac0fd1defaa14f8485
Signed-off-by: Frank S. Filz <ffilzlnx(a)mindspring.com>
---
M src/FSAL/FSAL_CEPH/handle.c
M src/FSAL/FSAL_GLUSTER/handle.c
M src/FSAL/FSAL_GPFS/handle.c
M src/FSAL/FSAL_KVSFS/kvsfs_handle.c
M src/FSAL/FSAL_LIZARDFS/handle.c
M src/FSAL/FSAL_MEM/mem_handle.c
M src/FSAL/FSAL_MEM/mem_int.h
M src/FSAL/FSAL_PROXY_V3/main.c
M src/FSAL/FSAL_PROXY_V4/handle.c
M src/FSAL/FSAL_RGW/handle.c
M src/FSAL/FSAL_SAUNAFS/handle.c
M src/FSAL/FSAL_VFS/handle.c
M src/FSAL/FSAL_VFS/handle_syscalls.c
M src/FSAL/FSAL_VFS/vfs_methods.h
M src/FSAL/FSAL_VFS/xfs/handle_syscalls.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c
M src/FSAL/Stackable_FSALs/FSAL_NULL/handle.c
M src/FSAL/default_methods.c
M src/FSAL/fsal_helper.c
M src/Protocols/9P/9p_readlink.c
M src/Protocols/NFS/nfs3_readlink.c
M src/Protocols/NFS/nfs4_op_readlink.c
M src/gtest/fsal_api/test_readlink_latency.cc
M src/gtest/fsal_api/test_symlink_latency.cc
M src/include/abstract_mem.h
M src/include/fsal.h
M src/include/fsal_api.h
M src/include/nfsv41.h
28 files changed, 145 insertions(+), 150 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/55/1226855/1
--
To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1226855?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Ifd5a250ba500f005d4345cac0fd1defaa14f8485
Gerrit-Change-Number: 1226855
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilzlnx(a)mindspring.com>