diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:56:43 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:39:24 -0400 |
commit | 9c261b33a9c417ccaf07f41796be278d09d02d49 (patch) | |
tree | 6cf47f47364647dfbba845c0fd3f05539072175a /fs/jffs2/compr_zlib.c | |
parent | bf011f2ed53d587fdd8148c173c4f09ed77bdf1a (diff) |
jffs2: Convert most D1/D2 macros to jffs2_dbg
D1 and D2 macros are mostly uses to emit debugging messages.
Convert the logging uses of D1 & D2 to jffs2_dbg(level, fmt, ...)
to be a bit more consistent style with the rest of the kernel.
All jffs2_dbg output is now at KERN_DEBUG where some of
the previous uses were emitted at various KERN_<LEVEL>s.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/compr_zlib.c')
-rw-r--r-- | fs/jffs2/compr_zlib.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c index 4e7a138745ec..40979c928751 100644 --- a/fs/jffs2/compr_zlib.c +++ b/fs/jffs2/compr_zlib.c | |||
@@ -45,13 +45,15 @@ static int __init alloc_workspaces(void) | |||
45 | if (!def_strm.workspace) | 45 | if (!def_strm.workspace) |
46 | return -ENOMEM; | 46 | return -ENOMEM; |
47 | 47 | ||
48 | D1(printk(KERN_DEBUG "Allocated %d bytes for deflate workspace\n", zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL))); | 48 | jffs2_dbg(1, "Allocated %d bytes for deflate workspace\n", |
49 | zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL)); | ||
49 | inf_strm.workspace = vmalloc(zlib_inflate_workspacesize()); | 50 | inf_strm.workspace = vmalloc(zlib_inflate_workspacesize()); |
50 | if (!inf_strm.workspace) { | 51 | if (!inf_strm.workspace) { |
51 | vfree(def_strm.workspace); | 52 | vfree(def_strm.workspace); |
52 | return -ENOMEM; | 53 | return -ENOMEM; |
53 | } | 54 | } |
54 | D1(printk(KERN_DEBUG "Allocated %d bytes for inflate workspace\n", zlib_inflate_workspacesize())); | 55 | jffs2_dbg(1, "Allocated %d bytes for inflate workspace\n", |
56 | zlib_inflate_workspacesize()); | ||
55 | return 0; | 57 | return 0; |
56 | } | 58 | } |
57 | 59 | ||
@@ -91,13 +93,14 @@ static int jffs2_zlib_compress(unsigned char *data_in, | |||
91 | while (def_strm.total_out < *dstlen - STREAM_END_SPACE && def_strm.total_in < *sourcelen) { | 93 | while (def_strm.total_out < *dstlen - STREAM_END_SPACE && def_strm.total_in < *sourcelen) { |
92 | def_strm.avail_out = *dstlen - (def_strm.total_out + STREAM_END_SPACE); | 94 | def_strm.avail_out = *dstlen - (def_strm.total_out + STREAM_END_SPACE); |
93 | def_strm.avail_in = min((unsigned)(*sourcelen-def_strm.total_in), def_strm.avail_out); | 95 | def_strm.avail_in = min((unsigned)(*sourcelen-def_strm.total_in), def_strm.avail_out); |
94 | D1(printk(KERN_DEBUG "calling deflate with avail_in %d, avail_out %d\n", | 96 | jffs2_dbg(1, "calling deflate with avail_in %d, avail_out %d\n", |
95 | def_strm.avail_in, def_strm.avail_out)); | 97 | def_strm.avail_in, def_strm.avail_out); |
96 | ret = zlib_deflate(&def_strm, Z_PARTIAL_FLUSH); | 98 | ret = zlib_deflate(&def_strm, Z_PARTIAL_FLUSH); |
97 | D1(printk(KERN_DEBUG "deflate returned with avail_in %d, avail_out %d, total_in %ld, total_out %ld\n", | 99 | jffs2_dbg(1, "deflate returned with avail_in %d, avail_out %d, total_in %ld, total_out %ld\n", |
98 | def_strm.avail_in, def_strm.avail_out, def_strm.total_in, def_strm.total_out)); | 100 | def_strm.avail_in, def_strm.avail_out, |
101 | def_strm.total_in, def_strm.total_out); | ||
99 | if (ret != Z_OK) { | 102 | if (ret != Z_OK) { |
100 | D1(printk(KERN_DEBUG "deflate in loop returned %d\n", ret)); | 103 | jffs2_dbg(1, "deflate in loop returned %d\n", ret); |
101 | zlib_deflateEnd(&def_strm); | 104 | zlib_deflateEnd(&def_strm); |
102 | mutex_unlock(&deflate_mutex); | 105 | mutex_unlock(&deflate_mutex); |
103 | return -1; | 106 | return -1; |
@@ -109,20 +112,20 @@ static int jffs2_zlib_compress(unsigned char *data_in, | |||
109 | zlib_deflateEnd(&def_strm); | 112 | zlib_deflateEnd(&def_strm); |
110 | 113 | ||
111 | if (ret != Z_STREAM_END) { | 114 | if (ret != Z_STREAM_END) { |
112 | D1(printk(KERN_DEBUG "final deflate returned %d\n", ret)); | 115 | jffs2_dbg(1, "final deflate returned %d\n", ret); |
113 | ret = -1; | 116 | ret = -1; |
114 | goto out; | 117 | goto out; |
115 | } | 118 | } |
116 | 119 | ||
117 | if (def_strm.total_out >= def_strm.total_in) { | 120 | if (def_strm.total_out >= def_strm.total_in) { |
118 | D1(printk(KERN_DEBUG "zlib compressed %ld bytes into %ld; failing\n", | 121 | jffs2_dbg(1, "zlib compressed %ld bytes into %ld; failing\n", |
119 | def_strm.total_in, def_strm.total_out)); | 122 | def_strm.total_in, def_strm.total_out); |
120 | ret = -1; | 123 | ret = -1; |
121 | goto out; | 124 | goto out; |
122 | } | 125 | } |
123 | 126 | ||
124 | D1(printk(KERN_DEBUG "zlib compressed %ld bytes into %ld\n", | 127 | jffs2_dbg(1, "zlib compressed %ld bytes into %ld\n", |
125 | def_strm.total_in, def_strm.total_out)); | 128 | def_strm.total_in, def_strm.total_out); |
126 | 129 | ||
127 | *dstlen = def_strm.total_out; | 130 | *dstlen = def_strm.total_out; |
128 | *sourcelen = def_strm.total_in; | 131 | *sourcelen = def_strm.total_in; |
@@ -155,13 +158,13 @@ static int jffs2_zlib_decompress(unsigned char *data_in, | |||
155 | ((data_in[0] & 0x0f) == Z_DEFLATED) && | 158 | ((data_in[0] & 0x0f) == Z_DEFLATED) && |
156 | !(((data_in[0]<<8) + data_in[1]) % 31)) { | 159 | !(((data_in[0]<<8) + data_in[1]) % 31)) { |
157 | 160 | ||
158 | D2(printk(KERN_DEBUG "inflate skipping adler32\n")); | 161 | jffs2_dbg(2, "inflate skipping adler32\n"); |
159 | wbits = -((data_in[0] >> 4) + 8); | 162 | wbits = -((data_in[0] >> 4) + 8); |
160 | inf_strm.next_in += 2; | 163 | inf_strm.next_in += 2; |
161 | inf_strm.avail_in -= 2; | 164 | inf_strm.avail_in -= 2; |
162 | } else { | 165 | } else { |
163 | /* Let this remain D1 for now -- it should never happen */ | 166 | /* Let this remain D1 for now -- it should never happen */ |
164 | D1(printk(KERN_DEBUG "inflate not skipping adler32\n")); | 167 | jffs2_dbg(1, "inflate not skipping adler32\n"); |
165 | } | 168 | } |
166 | 169 | ||
167 | 170 | ||