Skip to content

Commit 6f4dbd1

Browse files
committed
libceph: use kbasename() and kill ceph_file_part()
Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org>
1 parent 0833289 commit 6f4dbd1

2 files changed

Lines changed: 3 additions & 16 deletions

File tree

‎include/linux/ceph/ceph_debug.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
55

6+
#include <linux/string.h>
7+
68
#ifdef CONFIG_CEPH_LIB_PRETTYDEBUG
79

810
/*
@@ -12,12 +14,10 @@
1214
*/
1315

1416
# if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
15-
extern const char *ceph_file_part(const char *s, int len);
1617
# define dout(fmt, ...) \
1718
pr_debug("%.*s %12.12s:%-4d : " fmt, \
1819
8 - (int)sizeof(KBUILD_MODNAME), " ", \
19-
ceph_file_part(__FILE__, sizeof(__FILE__)), \
20-
__LINE__, ##__VA_ARGS__)
20+
kbasename(__FILE__), __LINE__, ##__VA_ARGS__)
2121
# else
2222
/* faux printk call just to see any compiler warnings. */
2323
# define dout(fmt, ...) do { \

‎net/ceph/ceph_common.c‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,6 @@ static const struct kernel_param_ops param_ops_supported_features = {
5656
module_param_cb(supported_features, &param_ops_supported_features, NULL,
5757
S_IRUGO);
5858

59-
/*
60-
* find filename portion of a path (/foo/bar/baz -> baz)
61-
*/
62-
const char *ceph_file_part(const char *s, int len)
63-
{
64-
const char *e = s + len;
65-
66-
while (e != s && *(e-1) != '/')
67-
e--;
68-
return e;
69-
}
70-
EXPORT_SYMBOL(ceph_file_part);
71-
7259
const char *ceph_msg_type_name(int type)
7360
{
7461
switch (type) {

0 commit comments

Comments
 (0)