Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0227d6ab authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds
Browse files

fs/cachefiles: replace kerror by pr_err



Also add pr_fmt in internal.h

Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4e1eb883
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -50,18 +50,18 @@ int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args)
	       cache->brun_percent  < 100);

	if (*args) {
		kerror("'bind' command doesn't take an argument");
		pr_err("'bind' command doesn't take an argument");
		return -EINVAL;
	}

	if (!cache->rootdirname) {
		kerror("No cache directory specified");
		pr_err("No cache directory specified");
		return -EINVAL;
	}

	/* don't permit already bound caches to be re-bound */
	if (test_bit(CACHEFILES_READY, &cache->flags)) {
		kerror("Cache already bound");
		pr_err("Cache already bound");
		return -EBUSY;
	}

@@ -228,8 +228,7 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)
	set_bit(CACHEFILES_READY, &cache->flags);
	dput(root);

	pr_info("CacheFiles: File cache on %s registered\n",
		cache->cache.identifier);
	pr_info("File cache on %s registered\n", cache->cache.identifier);

	/* check how much space the cache has */
	cachefiles_has_space(cache, 0, 0);
@@ -249,7 +248,7 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)
	kmem_cache_free(cachefiles_object_jar, fsdef);
error_root_object:
	cachefiles_end_secure(cache, saved_cred);
	kerror("Failed to register: %d", ret);
	pr_err("Failed to register: %d", ret);
	return ret;
}

@@ -261,7 +260,7 @@ void cachefiles_daemon_unbind(struct cachefiles_cache *cache)
	_enter("");

	if (test_bit(CACHEFILES_READY, &cache->flags)) {
		pr_info("CacheFiles: File cache on %s unregistering\n",
		pr_info("File cache on %s unregistering\n",
			cache->cache.identifier);

		fscache_withdraw_cache(&cache->cache);
+15 −16
Original line number Diff line number Diff line
@@ -315,8 +315,7 @@ static unsigned int cachefiles_daemon_poll(struct file *file,
static int cachefiles_daemon_range_error(struct cachefiles_cache *cache,
					 char *args)
{
	kerror("Free space limits must be in range"
	       " 0%%<=stop<cull<run<100%%");
	pr_err("Free space limits must be in range 0%%<=stop<cull<run<100%%");

	return -EINVAL;
}
@@ -476,12 +475,12 @@ static int cachefiles_daemon_dir(struct cachefiles_cache *cache, char *args)
	_enter(",%s", args);

	if (!*args) {
		kerror("Empty directory specified");
		pr_err("Empty directory specified");
		return -EINVAL;
	}

	if (cache->rootdirname) {
		kerror("Second cache directory specified");
		pr_err("Second cache directory specified");
		return -EEXIST;
	}

@@ -504,12 +503,12 @@ static int cachefiles_daemon_secctx(struct cachefiles_cache *cache, char *args)
	_enter(",%s", args);

	if (!*args) {
		kerror("Empty security context specified");
		pr_err("Empty security context specified");
		return -EINVAL;
	}

	if (cache->secctx) {
		kerror("Second security context specified");
		pr_err("Second security context specified");
		return -EINVAL;
	}

@@ -532,7 +531,7 @@ static int cachefiles_daemon_tag(struct cachefiles_cache *cache, char *args)
	_enter(",%s", args);

	if (!*args) {
		kerror("Empty tag specified");
		pr_err("Empty tag specified");
		return -EINVAL;
	}

@@ -563,12 +562,12 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)
		goto inval;

	if (!test_bit(CACHEFILES_READY, &cache->flags)) {
		kerror("cull applied to unready cache");
		pr_err("cull applied to unready cache");
		return -EIO;
	}

	if (test_bit(CACHEFILES_DEAD, &cache->flags)) {
		kerror("cull applied to dead cache");
		pr_err("cull applied to dead cache");
		return -EIO;
	}

@@ -588,11 +587,11 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)

notdir:
	path_put(&path);
	kerror("cull command requires dirfd to be a directory");
	pr_err("cull command requires dirfd to be a directory");
	return -ENOTDIR;

inval:
	kerror("cull command requires dirfd and filename");
	pr_err("cull command requires dirfd and filename");
	return -EINVAL;
}

@@ -615,7 +614,7 @@ static int cachefiles_daemon_debug(struct cachefiles_cache *cache, char *args)
	return 0;

inval:
	kerror("debug command requires mask");
	pr_err("debug command requires mask");
	return -EINVAL;
}

@@ -635,12 +634,12 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)
		goto inval;

	if (!test_bit(CACHEFILES_READY, &cache->flags)) {
		kerror("inuse applied to unready cache");
		pr_err("inuse applied to unready cache");
		return -EIO;
	}

	if (test_bit(CACHEFILES_DEAD, &cache->flags)) {
		kerror("inuse applied to dead cache");
		pr_err("inuse applied to dead cache");
		return -EIO;
	}

@@ -660,11 +659,11 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)

notdir:
	path_put(&path);
	kerror("inuse command requires dirfd to be a directory");
	pr_err("inuse command requires dirfd to be a directory");
	return -ENOTDIR;

inval:
	kerror("inuse command requires dirfd and filename");
	pr_err("inuse command requires dirfd and filename");
	return -EINVAL;
}

+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ static int cachefiles_lookup_object(struct fscache_object *_object)

	if (ret < 0 && ret != -ETIMEDOUT) {
		if (ret != -ENOBUFS)
			pr_warn("CacheFiles: Lookup failed error %d\n", ret);
			pr_warn("Lookup failed error %d\n", ret);
		fscache_object_lookup_error(&object->fscache);
	}

+12 −6
Original line number Diff line number Diff line
@@ -9,6 +9,13 @@
 * 2 of the Licence, or (at your option) any later version.
 */

#ifdef pr_fmt
#undef pr_fmt
#endif

#define pr_fmt(fmt) "CacheFiles: " fmt


#include <linux/fscache-cache.h>
#include <linux/timer.h>
#include <linux/wait.h>
@@ -245,11 +252,10 @@ extern int cachefiles_remove_object_xattr(struct cachefiles_cache *cache,
/*
 * error handling
 */
#define kerror(FMT, ...) pr_err("CacheFiles: "FMT"\n", ##__VA_ARGS__)

#define cachefiles_io_error(___cache, FMT, ...)		\
do {							\
	kerror("I/O Error: " FMT, ##__VA_ARGS__);	\
	pr_err("I/O Error: " FMT, ##__VA_ARGS__);	\
	fscache_io_error(&(___cache)->cache);		\
	set_bit(CACHEFILES_DEAD, &(___cache)->flags);	\
} while (0)
@@ -311,7 +317,7 @@ do { \
do {									\
	if (unlikely(!(X))) {						\
		pr_err("\n");						\
		pr_err("CacheFiles: Assertion failed\n");		\
		pr_err("Assertion failed\n");		\
		BUG();							\
	}								\
} while (0)
@@ -320,7 +326,7 @@ do { \
do {									\
	if (unlikely(!((X) OP (Y)))) {					\
		pr_err("\n");						\
		pr_err("CacheFiles: Assertion failed\n");		\
		pr_err("Assertion failed\n");		\
		pr_err("%lx " #OP " %lx is false\n",			\
		       (unsigned long)(X), (unsigned long)(Y));		\
		BUG();							\
@@ -331,7 +337,7 @@ do { \
do {									\
	if (unlikely((C) && !(X))) {					\
		pr_err("\n");						\
		pr_err("CacheFiles: Assertion failed\n");		\
		pr_err("Assertion failed\n");		\
		BUG();							\
	}								\
} while (0)
@@ -340,7 +346,7 @@ do { \
do {									\
	if (unlikely((C) && !((X) OP (Y)))) {				\
		pr_err("\n");						\
		pr_err("CacheFiles: Assertion failed\n");		\
		pr_err("Assertion failed\n");		\
		pr_err("%lx " #OP " %lx is false\n",			\
		       (unsigned long)(X), (unsigned long)(Y));		\
		BUG();							\
+4 −4
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ static int __init cachefiles_init(void)
				  SLAB_HWCACHE_ALIGN,
				  cachefiles_object_init_once);
	if (!cachefiles_object_jar) {
		pr_notice("CacheFiles: Failed to allocate an object jar\n");
		pr_notice("Failed to allocate an object jar\n");
		goto error_object_jar;
	}

@@ -76,7 +76,7 @@ static int __init cachefiles_init(void)
	if (ret < 0)
		goto error_proc;

	pr_info("CacheFiles: Loaded\n");
	pr_info("Loaded\n");
	return 0;

error_proc:
@@ -84,7 +84,7 @@ static int __init cachefiles_init(void)
error_object_jar:
	misc_deregister(&cachefiles_dev);
error_dev:
	kerror("failed to register: %d", ret);
	pr_err("failed to register: %d", ret);
	return ret;
}

@@ -95,7 +95,7 @@ fs_initcall(cachefiles_init);
 */
static void __exit cachefiles_exit(void)
{
	pr_info("CacheFiles: Unloading\n");
	pr_info("Unloading\n");

	cachefiles_proc_cleanup();
	kmem_cache_destroy(cachefiles_object_jar);
Loading