diff options
author | Joe Perches <joe@perches.com> | 2013-05-04 23:12:25 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-05-04 23:17:23 -0400 |
commit | f96637be081141d6f8813429499f164260b49d70 (patch) | |
tree | c91f5a9b5a2b7a67bbeda15d7c9805655547a098 /fs/cifs/fscache.c | |
parent | f7f7c1850eb98da758731ea7edfa830ebefe24cd (diff) |
[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg
It's not obvious from reading the macro names that these macros
are for debugging. Convert the names to a single more typical
kernel style cifs_dbg macro.
cERROR(1, ...) -> cifs_dbg(VFS, ...)
cFYI(1, ...) -> cifs_dbg(FYI, ...)
cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...)
Move the terminating format newline from the macro to the call site.
Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the
"CIFS VFS: " prefix for VFS messages.
Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y)
$ size fs/cifs/cifs.ko*
text data bss dec hex filename
265245 2525 132 267902 4167e fs/cifs/cifs.ko.new
268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old
Other miscellaneous changes around these conversions:
o Miscellaneous typo fixes
o Add terminating \n's to almost all formats and remove them
from the macros to be more kernel style like. A few formats
previously had defective \n's
o Remove unnecessary OOM messages as kmalloc() calls dump_stack
o Coalesce formats to make grep easier,
added missing spaces when coalescing formats
o Use %s, __func__ instead of embedded function name
o Removed unnecessary "cifs: " prefixes
o Convert kzalloc with multiply to kcalloc
o Remove unused cifswarn macro
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/fscache.c')
-rw-r--r-- | fs/cifs/fscache.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c index 42e5363b4102..2f4bc5a58054 100644 --- a/fs/cifs/fscache.c +++ b/fs/cifs/fscache.c | |||
@@ -28,14 +28,14 @@ void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server) | |||
28 | server->fscache = | 28 | server->fscache = |
29 | fscache_acquire_cookie(cifs_fscache_netfs.primary_index, | 29 | fscache_acquire_cookie(cifs_fscache_netfs.primary_index, |
30 | &cifs_fscache_server_index_def, server); | 30 | &cifs_fscache_server_index_def, server); |
31 | cFYI(1, "%s: (0x%p/0x%p)", __func__, server, | 31 | cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", |
32 | server->fscache); | 32 | __func__, server, server->fscache); |
33 | } | 33 | } |
34 | 34 | ||
35 | void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) | 35 | void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) |
36 | { | 36 | { |
37 | cFYI(1, "%s: (0x%p/0x%p)", __func__, server, | 37 | cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", |
38 | server->fscache); | 38 | __func__, server, server->fscache); |
39 | fscache_relinquish_cookie(server->fscache, 0); | 39 | fscache_relinquish_cookie(server->fscache, 0); |
40 | server->fscache = NULL; | 40 | server->fscache = NULL; |
41 | } | 41 | } |
@@ -47,13 +47,13 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon) | |||
47 | tcon->fscache = | 47 | tcon->fscache = |
48 | fscache_acquire_cookie(server->fscache, | 48 | fscache_acquire_cookie(server->fscache, |
49 | &cifs_fscache_super_index_def, tcon); | 49 | &cifs_fscache_super_index_def, tcon); |
50 | cFYI(1, "%s: (0x%p/0x%p)", __func__, server->fscache, | 50 | cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", |
51 | tcon->fscache); | 51 | __func__, server->fscache, tcon->fscache); |
52 | } | 52 | } |
53 | 53 | ||
54 | void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) | 54 | void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) |
55 | { | 55 | { |
56 | cFYI(1, "%s: (0x%p)", __func__, tcon->fscache); | 56 | cifs_dbg(FYI, "%s: (0x%p)\n", __func__, tcon->fscache); |
57 | fscache_relinquish_cookie(tcon->fscache, 0); | 57 | fscache_relinquish_cookie(tcon->fscache, 0); |
58 | tcon->fscache = NULL; | 58 | tcon->fscache = NULL; |
59 | } | 59 | } |
@@ -70,8 +70,8 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode) | |||
70 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) { | 70 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) { |
71 | cifsi->fscache = fscache_acquire_cookie(tcon->fscache, | 71 | cifsi->fscache = fscache_acquire_cookie(tcon->fscache, |
72 | &cifs_fscache_inode_object_def, cifsi); | 72 | &cifs_fscache_inode_object_def, cifsi); |
73 | cFYI(1, "%s: got FH cookie (0x%p/0x%p)", __func__, | 73 | cifs_dbg(FYI, "%s: got FH cookie (0x%p/0x%p)\n", |
74 | tcon->fscache, cifsi->fscache); | 74 | __func__, tcon->fscache, cifsi->fscache); |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
@@ -80,7 +80,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode) | |||
80 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 80 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |
81 | 81 | ||
82 | if (cifsi->fscache) { | 82 | if (cifsi->fscache) { |
83 | cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); | 83 | cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache); |
84 | fscache_relinquish_cookie(cifsi->fscache, 0); | 84 | fscache_relinquish_cookie(cifsi->fscache, 0); |
85 | cifsi->fscache = NULL; | 85 | cifsi->fscache = NULL; |
86 | } | 86 | } |
@@ -91,7 +91,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode) | |||
91 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 91 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |
92 | 92 | ||
93 | if (cifsi->fscache) { | 93 | if (cifsi->fscache) { |
94 | cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); | 94 | cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache); |
95 | fscache_uncache_all_inode_pages(cifsi->fscache, inode); | 95 | fscache_uncache_all_inode_pages(cifsi->fscache, inode); |
96 | fscache_relinquish_cookie(cifsi->fscache, 1); | 96 | fscache_relinquish_cookie(cifsi->fscache, 1); |
97 | cifsi->fscache = NULL; | 97 | cifsi->fscache = NULL; |
@@ -120,8 +120,8 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode) | |||
120 | cifs_sb_master_tcon(cifs_sb)->fscache, | 120 | cifs_sb_master_tcon(cifs_sb)->fscache, |
121 | &cifs_fscache_inode_object_def, | 121 | &cifs_fscache_inode_object_def, |
122 | cifsi); | 122 | cifsi); |
123 | cFYI(1, "%s: new cookie 0x%p oldcookie 0x%p", | 123 | cifs_dbg(FYI, "%s: new cookie 0x%p oldcookie 0x%p\n", |
124 | __func__, cifsi->fscache, old); | 124 | __func__, cifsi->fscache, old); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
@@ -131,8 +131,8 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) | |||
131 | struct inode *inode = page->mapping->host; | 131 | struct inode *inode = page->mapping->host; |
132 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 132 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |
133 | 133 | ||
134 | cFYI(1, "%s: (0x%p/0x%p)", __func__, page, | 134 | cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", |
135 | cifsi->fscache); | 135 | __func__, page, cifsi->fscache); |
136 | if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) | 136 | if (!fscache_maybe_release_page(cifsi->fscache, page, gfp)) |
137 | return 0; | 137 | return 0; |
138 | } | 138 | } |
@@ -143,7 +143,7 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp) | |||
143 | static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, | 143 | static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx, |
144 | int error) | 144 | int error) |
145 | { | 145 | { |
146 | cFYI(1, "%s: (0x%p/%d)", __func__, page, error); | 146 | cifs_dbg(FYI, "%s: (0x%p/%d)\n", __func__, page, error); |
147 | if (!error) | 147 | if (!error) |
148 | SetPageUptodate(page); | 148 | SetPageUptodate(page); |
149 | unlock_page(page); | 149 | unlock_page(page); |
@@ -156,8 +156,8 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page) | |||
156 | { | 156 | { |
157 | int ret; | 157 | int ret; |
158 | 158 | ||
159 | cFYI(1, "%s: (fsc:%p, p:%p, i:0x%p", __func__, | 159 | cifs_dbg(FYI, "%s: (fsc:%p, p:%p, i:0x%p\n", |
160 | CIFS_I(inode)->fscache, page, inode); | 160 | __func__, CIFS_I(inode)->fscache, page, inode); |
161 | ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, | 161 | ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page, |
162 | cifs_readpage_from_fscache_complete, | 162 | cifs_readpage_from_fscache_complete, |
163 | NULL, | 163 | NULL, |
@@ -165,15 +165,15 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page) | |||
165 | switch (ret) { | 165 | switch (ret) { |
166 | 166 | ||
167 | case 0: /* page found in fscache, read submitted */ | 167 | case 0: /* page found in fscache, read submitted */ |
168 | cFYI(1, "%s: submitted", __func__); | 168 | cifs_dbg(FYI, "%s: submitted\n", __func__); |
169 | return ret; | 169 | return ret; |
170 | case -ENOBUFS: /* page won't be cached */ | 170 | case -ENOBUFS: /* page won't be cached */ |
171 | case -ENODATA: /* page not in cache */ | 171 | case -ENODATA: /* page not in cache */ |
172 | cFYI(1, "%s: %d", __func__, ret); | 172 | cifs_dbg(FYI, "%s: %d\n", __func__, ret); |
173 | return 1; | 173 | return 1; |
174 | 174 | ||
175 | default: | 175 | default: |
176 | cERROR(1, "unknown error ret = %d", ret); | 176 | cifs_dbg(VFS, "unknown error ret = %d\n", ret); |
177 | } | 177 | } |
178 | return ret; | 178 | return ret; |
179 | } | 179 | } |
@@ -188,8 +188,8 @@ int __cifs_readpages_from_fscache(struct inode *inode, | |||
188 | { | 188 | { |
189 | int ret; | 189 | int ret; |
190 | 190 | ||
191 | cFYI(1, "%s: (0x%p/%u/0x%p)", __func__, | 191 | cifs_dbg(FYI, "%s: (0x%p/%u/0x%p)\n", |
192 | CIFS_I(inode)->fscache, *nr_pages, inode); | 192 | __func__, CIFS_I(inode)->fscache, *nr_pages, inode); |
193 | ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, | 193 | ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping, |
194 | pages, nr_pages, | 194 | pages, nr_pages, |
195 | cifs_readpage_from_fscache_complete, | 195 | cifs_readpage_from_fscache_complete, |
@@ -197,16 +197,16 @@ int __cifs_readpages_from_fscache(struct inode *inode, | |||
197 | mapping_gfp_mask(mapping)); | 197 | mapping_gfp_mask(mapping)); |
198 | switch (ret) { | 198 | switch (ret) { |
199 | case 0: /* read submitted to the cache for all pages */ | 199 | case 0: /* read submitted to the cache for all pages */ |
200 | cFYI(1, "%s: submitted", __func__); | 200 | cifs_dbg(FYI, "%s: submitted\n", __func__); |
201 | return ret; | 201 | return ret; |
202 | 202 | ||
203 | case -ENOBUFS: /* some pages are not cached and can't be */ | 203 | case -ENOBUFS: /* some pages are not cached and can't be */ |
204 | case -ENODATA: /* some pages are not cached */ | 204 | case -ENODATA: /* some pages are not cached */ |
205 | cFYI(1, "%s: no page", __func__); | 205 | cifs_dbg(FYI, "%s: no page\n", __func__); |
206 | return 1; | 206 | return 1; |
207 | 207 | ||
208 | default: | 208 | default: |
209 | cFYI(1, "unknown error ret = %d", ret); | 209 | cifs_dbg(FYI, "unknown error ret = %d\n", ret); |
210 | } | 210 | } |
211 | 211 | ||
212 | return ret; | 212 | return ret; |
@@ -216,8 +216,8 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) | |||
216 | { | 216 | { |
217 | int ret; | 217 | int ret; |
218 | 218 | ||
219 | cFYI(1, "%s: (fsc: %p, p: %p, i: %p)", __func__, | 219 | cifs_dbg(FYI, "%s: (fsc: %p, p: %p, i: %p)\n", |
220 | CIFS_I(inode)->fscache, page, inode); | 220 | __func__, CIFS_I(inode)->fscache, page, inode); |
221 | ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); | 221 | ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL); |
222 | if (ret != 0) | 222 | if (ret != 0) |
223 | fscache_uncache_page(CIFS_I(inode)->fscache, page); | 223 | fscache_uncache_page(CIFS_I(inode)->fscache, page); |
@@ -228,7 +228,7 @@ void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode) | |||
228 | struct cifsInodeInfo *cifsi = CIFS_I(inode); | 228 | struct cifsInodeInfo *cifsi = CIFS_I(inode); |
229 | struct fscache_cookie *cookie = cifsi->fscache; | 229 | struct fscache_cookie *cookie = cifsi->fscache; |
230 | 230 | ||
231 | cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cookie); | 231 | cifs_dbg(FYI, "%s: (0x%p/0x%p)\n", __func__, page, cookie); |
232 | fscache_wait_on_page_write(cookie, page); | 232 | fscache_wait_on_page_write(cookie, page); |
233 | fscache_uncache_page(cookie, page); | 233 | fscache_uncache_page(cookie, page); |
234 | } | 234 | } |