Skip to content

Commit 040d15c

Browse files
author
Steve French
committed
[CIFS] trivial cleanup fscache cFYI and cERROR messages
... for uniformity and cleaner debug logs. Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
1 parent 8d1bca3 commit 040d15c

2 files changed

Lines changed: 27 additions & 30 deletions

File tree

‎fs/cifs/cache.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static uint16_t cifs_server_get_key(const void *cookie_netfs_data,
9292
break;
9393

9494
default:
95-
cERROR(1, "CIFS: Unknown network family '%d'", sa->sa_family);
95+
cERROR(1, "Unknown network family '%d'", sa->sa_family);
9696
key_len = 0;
9797
break;
9898
}
@@ -152,7 +152,7 @@ static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer,
152152

153153
sharename = extract_sharename(tcon->treeName);
154154
if (IS_ERR(sharename)) {
155-
cFYI(1, "CIFS: couldn't extract sharename\n");
155+
cFYI(1, "%s: couldn't extract sharename\n", __func__);
156156
sharename = NULL;
157157
return 0;
158158
}
@@ -302,7 +302,7 @@ static void cifs_fscache_inode_now_uncached(void *cookie_netfs_data)
302302
pagevec_init(&pvec, 0);
303303
first = 0;
304304

305-
cFYI(1, "cifs inode 0x%p now uncached", cifsi);
305+
cFYI(1, "%s: cifs inode 0x%p now uncached", __func__, cifsi);
306306

307307
for (;;) {
308308
nr_pages = pagevec_lookup(&pvec,

‎fs/cifs/fscache.c‎

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ void cifs_fscache_get_client_cookie(struct TCP_Server_Info *server)
2828
server->fscache =
2929
fscache_acquire_cookie(cifs_fscache_netfs.primary_index,
3030
&cifs_fscache_server_index_def, server);
31-
cFYI(1, "CIFS: get client cookie (0x%p/0x%p)", server,
32-
server->fscache);
31+
cFYI(1, "%s: (0x%p/0x%p)", __func__, server,
32+
server->fscache);
3333
}
3434

3535
void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server)
3636
{
37-
cFYI(1, "CIFS: release client cookie (0x%p/0x%p)", server,
38-
server->fscache);
37+
cFYI(1, "%s: (0x%p/0x%p)", __func__, server,
38+
server->fscache);
3939
fscache_relinquish_cookie(server->fscache, 0);
4040
server->fscache = NULL;
4141
}
@@ -47,13 +47,13 @@ void cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
4747
tcon->fscache =
4848
fscache_acquire_cookie(server->fscache,
4949
&cifs_fscache_super_index_def, tcon);
50-
cFYI(1, "CIFS: get superblock cookie (0x%p/0x%p)",
51-
server->fscache, tcon->fscache);
50+
cFYI(1, "%s: (0x%p/0x%p)", __func__, server->fscache,
51+
tcon->fscache);
5252
}
5353

5454
void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon)
5555
{
56-
cFYI(1, "CIFS: releasing superblock cookie (0x%p)", tcon->fscache);
56+
cFYI(1, "%s: (0x%p)", __func__, tcon->fscache);
5757
fscache_relinquish_cookie(tcon->fscache, 0);
5858
tcon->fscache = NULL;
5959
}
@@ -70,8 +70,8 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode)
7070
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) {
7171
cifsi->fscache = fscache_acquire_cookie(tcon->fscache,
7272
&cifs_fscache_inode_object_def, cifsi);
73-
cFYI(1, "CIFS: got FH cookie (0x%p/0x%p)", tcon->fscache,
74-
cifsi->fscache);
73+
cFYI(1, "%s: got FH cookie (0x%p/0x%p)", __func__,
74+
tcon->fscache, cifsi->fscache);
7575
}
7676
}
7777

@@ -80,8 +80,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode)
8080
struct cifsInodeInfo *cifsi = CIFS_I(inode);
8181

8282
if (cifsi->fscache) {
83-
cFYI(1, "CIFS releasing inode cookie (0x%p)",
84-
cifsi->fscache);
83+
cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache);
8584
fscache_relinquish_cookie(cifsi->fscache, 0);
8685
cifsi->fscache = NULL;
8786
}
@@ -92,8 +91,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode)
9291
struct cifsInodeInfo *cifsi = CIFS_I(inode);
9392

9493
if (cifsi->fscache) {
95-
cFYI(1, "CIFS disabling inode cookie (0x%p)",
96-
cifsi->fscache);
94+
cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache);
9795
fscache_relinquish_cookie(cifsi->fscache, 1);
9896
cifsi->fscache = NULL;
9997
}
@@ -121,8 +119,8 @@ void cifs_fscache_reset_inode_cookie(struct inode *inode)
121119
cifs_sb_master_tcon(cifs_sb)->fscache,
122120
&cifs_fscache_inode_object_def,
123121
cifsi);
124-
cFYI(1, "CIFS: new cookie 0x%p oldcookie 0x%p",
125-
cifsi->fscache, old);
122+
cFYI(1, "%s: new cookie 0x%p oldcookie 0x%p",
123+
__func__, cifsi->fscache, old);
126124
}
127125
}
128126

@@ -132,8 +130,8 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
132130
struct inode *inode = page->mapping->host;
133131
struct cifsInodeInfo *cifsi = CIFS_I(inode);
134132

135-
cFYI(1, "CIFS: fscache release page (0x%p/0x%p)",
136-
page, cifsi->fscache);
133+
cFYI(1, "%s: (0x%p/0x%p)", __func__, page,
134+
cifsi->fscache);
137135
if (!fscache_maybe_release_page(cifsi->fscache, page, gfp))
138136
return 0;
139137
}
@@ -144,8 +142,7 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
144142
static void cifs_readpage_from_fscache_complete(struct page *page, void *ctx,
145143
int error)
146144
{
147-
cFYI(1, "CFS: readpage_from_fscache_complete (0x%p/%d)",
148-
page, error);
145+
cFYI(1, "%s: (0x%p/%d)", __func__, page, error);
149146
if (!error)
150147
SetPageUptodate(page);
151148
unlock_page(page);
@@ -158,7 +155,7 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
158155
{
159156
int ret;
160157

161-
cFYI(1, "CIFS: readpage_from_fscache(fsc:%p, p:%p, i:0x%p",
158+
cFYI(1, "%s: (fsc:%p, p:%p, i:0x%p", __func__,
162159
CIFS_I(inode)->fscache, page, inode);
163160
ret = fscache_read_or_alloc_page(CIFS_I(inode)->fscache, page,
164161
cifs_readpage_from_fscache_complete,
@@ -167,11 +164,11 @@ int __cifs_readpage_from_fscache(struct inode *inode, struct page *page)
167164
switch (ret) {
168165

169166
case 0: /* page found in fscache, read submitted */
170-
cFYI(1, "CIFS: readpage_from_fscache: submitted");
167+
cFYI(1, "%s: submitted", __func__);
171168
return ret;
172169
case -ENOBUFS: /* page won't be cached */
173170
case -ENODATA: /* page not in cache */
174-
cFYI(1, "CIFS: readpage_from_fscache %d", ret);
171+
cFYI(1, "%s: %d", __func__, ret);
175172
return 1;
176173

177174
default:
@@ -190,7 +187,7 @@ int __cifs_readpages_from_fscache(struct inode *inode,
190187
{
191188
int ret;
192189

193-
cFYI(1, "CIFS: __cifs_readpages_from_fscache (0x%p/%u/0x%p)",
190+
cFYI(1, "%s: (0x%p/%u/0x%p)", __func__,
194191
CIFS_I(inode)->fscache, *nr_pages, inode);
195192
ret = fscache_read_or_alloc_pages(CIFS_I(inode)->fscache, mapping,
196193
pages, nr_pages,
@@ -199,12 +196,12 @@ int __cifs_readpages_from_fscache(struct inode *inode,
199196
mapping_gfp_mask(mapping));
200197
switch (ret) {
201198
case 0: /* read submitted to the cache for all pages */
202-
cFYI(1, "CIFS: readpages_from_fscache: submitted");
199+
cFYI(1, "%s: submitted", __func__);
203200
return ret;
204201

205202
case -ENOBUFS: /* some pages are not cached and can't be */
206203
case -ENODATA: /* some pages are not cached */
207-
cFYI(1, "CIFS: readpages_from_fscache: no page");
204+
cFYI(1, "%s: no page", __func__);
208205
return 1;
209206

210207
default:
@@ -218,7 +215,7 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
218215
{
219216
int ret;
220217

221-
cFYI(1, "CIFS: readpage_to_fscache(fsc: %p, p: %p, i: %p",
218+
cFYI(1, "%s: (fsc: %p, p: %p, i: %p)", __func__,
222219
CIFS_I(inode)->fscache, page, inode);
223220
ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL);
224221
if (ret != 0)
@@ -230,7 +227,7 @@ void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode)
230227
struct cifsInodeInfo *cifsi = CIFS_I(inode);
231228
struct fscache_cookie *cookie = cifsi->fscache;
232229

233-
cFYI(1, "CIFS: fscache invalidatepage (0x%p/0x%p)", page, cookie);
230+
cFYI(1, "%s: (0x%p/0x%p)", __func__, page, cookie);
234231
fscache_wait_on_page_write(cookie, page);
235232
fscache_uncache_page(cookie, page);
236233
}

0 commit comments

Comments
 (0)