ceph: use __getname/__putname in ceph_mdsc_build_path
authorJeff Layton <jlayton@kernel.org>
Mon, 29 Apr 2019 16:13:14 +0000 (12:13 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 7 May 2019 17:22:37 +0000 (19:22 +0200)
commitf77f21bb28367d0ac4861a24da1db118bba850e6
tree09381ee5d6fac1e444a8795da70eb08fe4ce551d
parent964fff7491e4923e18ff08f2a254c4b94e3f83d6
ceph: use __getname/__putname in ceph_mdsc_build_path

Al suggested we get rid of the kmalloc here and just use __getname
and __putname to get a full PATH_MAX pathname buffer.

Since we build the path in reverse, we continue to return a pointer
to the beginning of the string and the length, and add a new helper
to free the thing at the end.

Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/debugfs.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h