libceph: use kbasename() and kill ceph_file_part()
Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org>
This commit is contained in:
parent
08332893e3
commit
6f4dbd149d
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
|
#include <linux/string.h>
|
||||||
|
|
||||||
#ifdef CONFIG_CEPH_LIB_PRETTYDEBUG
|
#ifdef CONFIG_CEPH_LIB_PRETTYDEBUG
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -12,12 +14,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
|
# if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
|
||||||
extern const char *ceph_file_part(const char *s, int len);
|
|
||||||
# define dout(fmt, ...) \
|
# define dout(fmt, ...) \
|
||||||
pr_debug("%.*s %12.12s:%-4d : " fmt, \
|
pr_debug("%.*s %12.12s:%-4d : " fmt, \
|
||||||
8 - (int)sizeof(KBUILD_MODNAME), " ", \
|
8 - (int)sizeof(KBUILD_MODNAME), " ", \
|
||||||
ceph_file_part(__FILE__, sizeof(__FILE__)), \
|
kbasename(__FILE__), __LINE__, ##__VA_ARGS__)
|
||||||
__LINE__, ##__VA_ARGS__)
|
|
||||||
# else
|
# else
|
||||||
/* faux printk call just to see any compiler warnings. */
|
/* faux printk call just to see any compiler warnings. */
|
||||||
# define dout(fmt, ...) do { \
|
# define dout(fmt, ...) do { \
|
||||||
|
|
|
@ -56,19 +56,6 @@ static const struct kernel_param_ops param_ops_supported_features = {
|
||||||
module_param_cb(supported_features, ¶m_ops_supported_features, NULL,
|
module_param_cb(supported_features, ¶m_ops_supported_features, NULL,
|
||||||
S_IRUGO);
|
S_IRUGO);
|
||||||
|
|
||||||
/*
|
|
||||||
* find filename portion of a path (/foo/bar/baz -> baz)
|
|
||||||
*/
|
|
||||||
const char *ceph_file_part(const char *s, int len)
|
|
||||||
{
|
|
||||||
const char *e = s + len;
|
|
||||||
|
|
||||||
while (e != s && *(e-1) != '/')
|
|
||||||
e--;
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(ceph_file_part);
|
|
||||||
|
|
||||||
const char *ceph_msg_type_name(int type)
|
const char *ceph_msg_type_name(int type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
Loading…
Reference in New Issue