Skip to content

Commit a9d47a5

Browse files
dhowellsbrauner
authored andcommitted
netfs: Revert "netfs: Switch debug logging to pr_debug()"
Revert commit 163eae0 to get back the original operation of the debugging macros. Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] cc: Uwe Kleine-König <[email protected]> cc: Christian Brauner <[email protected]> cc: Jeff Layton <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 9330697 commit a9d47a5

15 files changed

+113
-78
lines changed

fs/netfs/buffered_read.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq)
117117
if (!test_bit(NETFS_RREQ_DONT_UNLOCK_FOLIOS, &rreq->flags)) {
118118
if (folio->index == rreq->no_unlock_folio &&
119119
test_bit(NETFS_RREQ_NO_UNLOCK_FOLIO, &rreq->flags))
120-
kdebug("no unlock");
120+
_debug("no unlock");
121121
else
122122
folio_unlock(folio);
123123
}
@@ -204,7 +204,7 @@ void netfs_readahead(struct readahead_control *ractl)
204204
struct netfs_inode *ctx = netfs_inode(ractl->mapping->host);
205205
int ret;
206206

207-
kenter("%lx,%x", readahead_index(ractl), readahead_count(ractl));
207+
_enter("%lx,%x", readahead_index(ractl), readahead_count(ractl));
208208

209209
if (readahead_count(ractl) == 0)
210210
return;
@@ -268,7 +268,7 @@ int netfs_read_folio(struct file *file, struct folio *folio)
268268
struct folio *sink = NULL;
269269
int ret;
270270

271-
kenter("%lx", folio->index);
271+
_enter("%lx", folio->index);
272272

273273
rreq = netfs_alloc_request(mapping, file,
274274
folio_pos(folio), folio_size(folio),
@@ -508,7 +508,7 @@ int netfs_write_begin(struct netfs_inode *ctx,
508508

509509
have_folio:
510510
*_folio = folio;
511-
kleave(" = 0");
511+
_leave(" = 0");
512512
return 0;
513513

514514
error_put:
@@ -518,7 +518,7 @@ int netfs_write_begin(struct netfs_inode *ctx,
518518
folio_unlock(folio);
519519
folio_put(folio);
520520
}
521-
kleave(" = %d", ret);
521+
_leave(" = %d", ret);
522522
return ret;
523523
}
524524
EXPORT_SYMBOL(netfs_write_begin);
@@ -536,7 +536,7 @@ int netfs_prefetch_for_write(struct file *file, struct folio *folio,
536536
size_t flen = folio_size(folio);
537537
int ret;
538538

539-
kenter("%zx @%llx", flen, start);
539+
_enter("%zx @%llx", flen, start);
540540

541541
ret = -ENOMEM;
542542

@@ -567,7 +567,7 @@ int netfs_prefetch_for_write(struct file *file, struct folio *folio,
567567
error_put:
568568
netfs_put_request(rreq, false, netfs_rreq_trace_put_discard);
569569
error:
570-
kleave(" = %d", ret);
570+
_leave(" = %d", ret);
571571
return ret;
572572
}
573573

fs/netfs/buffered_write.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static enum netfs_how_to_modify netfs_how_to_modify(struct netfs_inode *ctx,
5656
struct netfs_group *group = netfs_folio_group(folio);
5757
loff_t pos = folio_pos(folio);
5858

59-
kenter("");
59+
_enter("");
6060

6161
if (group != netfs_group && group != NETFS_FOLIO_COPY_TO_CACHE)
6262
return NETFS_FLUSH_CONTENT;
@@ -272,12 +272,12 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
272272
*/
273273
howto = netfs_how_to_modify(ctx, file, folio, netfs_group,
274274
flen, offset, part, maybe_trouble);
275-
kdebug("howto %u", howto);
275+
_debug("howto %u", howto);
276276
switch (howto) {
277277
case NETFS_JUST_PREFETCH:
278278
ret = netfs_prefetch_for_write(file, folio, offset, part);
279279
if (ret < 0) {
280-
kdebug("prefetch = %zd", ret);
280+
_debug("prefetch = %zd", ret);
281281
goto error_folio_unlock;
282282
}
283283
break;
@@ -418,7 +418,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
418418
}
419419

420420
iocb->ki_pos += written;
421-
kleave(" = %zd [%zd]", written, ret);
421+
_leave(" = %zd [%zd]", written, ret);
422422
return written ? written : ret;
423423

424424
error_folio_unlock:
@@ -491,7 +491,7 @@ ssize_t netfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
491491
struct netfs_inode *ictx = netfs_inode(inode);
492492
ssize_t ret;
493493

494-
kenter("%llx,%zx,%llx", iocb->ki_pos, iov_iter_count(from), i_size_read(inode));
494+
_enter("%llx,%zx,%llx", iocb->ki_pos, iov_iter_count(from), i_size_read(inode));
495495

496496
if (!iov_iter_count(from))
497497
return 0;
@@ -529,7 +529,7 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr
529529
vm_fault_t ret = VM_FAULT_RETRY;
530530
int err;
531531

532-
kenter("%lx", folio->index);
532+
_enter("%lx", folio->index);
533533

534534
sb_start_pagefault(inode->i_sb);
535535

fs/netfs/direct_read.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ssize_t netfs_unbuffered_read_iter_locked(struct kiocb *iocb, struct iov_iter *i
3333
size_t orig_count = iov_iter_count(iter);
3434
bool async = !is_sync_kiocb(iocb);
3535

36-
kenter("");
36+
_enter("");
3737

3838
if (!orig_count)
3939
return 0; /* Don't update atime */

fs/netfs/direct_write.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov_iter *
3737
size_t len = iov_iter_count(iter);
3838
bool async = !is_sync_kiocb(iocb);
3939

40-
kenter("");
40+
_enter("");
4141

4242
/* We're going to need a bounce buffer if what we transmit is going to
4343
* be different in some way to the source buffer, e.g. because it gets
4444
* encrypted/compressed or because it needs expanding to a block size.
4545
*/
4646
// TODO
4747

48-
kdebug("uw %llx-%llx", start, end);
48+
_debug("uw %llx-%llx", start, end);
4949

5050
wreq = netfs_create_write_req(iocb->ki_filp->f_mapping, iocb->ki_filp, start,
5151
iocb->ki_flags & IOCB_DIRECT ?
@@ -96,7 +96,7 @@ ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov_iter *
9696
wreq->cleanup = netfs_cleanup_dio_write;
9797
ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), wreq->len);
9898
if (ret < 0) {
99-
kdebug("begin = %zd", ret);
99+
_debug("begin = %zd", ret);
100100
goto out;
101101
}
102102

@@ -143,7 +143,7 @@ ssize_t netfs_unbuffered_write_iter(struct kiocb *iocb, struct iov_iter *from)
143143
loff_t pos = iocb->ki_pos;
144144
unsigned long long end = pos + iov_iter_count(from) - 1;
145145

146-
kenter("%llx,%zx,%llx", pos, iov_iter_count(from), i_size_read(inode));
146+
_enter("%llx,%zx,%llx", pos, iov_iter_count(from), i_size_read(inode));
147147

148148
if (!iov_iter_count(from))
149149
return 0;

fs/netfs/fscache_cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ int fscache_add_cache(struct fscache_cache *cache,
237237
{
238238
int n_accesses;
239239

240-
kenter("{%s,%s}", ops->name, cache->name);
240+
_enter("{%s,%s}", ops->name, cache->name);
241241

242242
BUG_ON(fscache_cache_state(cache) != FSCACHE_CACHE_IS_PREPARING);
243243

@@ -257,7 +257,7 @@ int fscache_add_cache(struct fscache_cache *cache,
257257

258258
up_write(&fscache_addremove_sem);
259259
pr_notice("Cache \"%s\" added (type %s)\n", cache->name, ops->name);
260-
kleave(" = 0 [%s]", cache->name);
260+
_leave(" = 0 [%s]", cache->name);
261261
return 0;
262262
}
263263
EXPORT_SYMBOL(fscache_add_cache);

fs/netfs/fscache_cookie.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ struct fscache_cookie *__fscache_acquire_cookie(
456456
{
457457
struct fscache_cookie *cookie;
458458

459-
kenter("V=%x", volume->debug_id);
459+
_enter("V=%x", volume->debug_id);
460460

461461
if (!index_key || !index_key_len || index_key_len > 255 || aux_data_len > 255)
462462
return NULL;
@@ -484,7 +484,7 @@ struct fscache_cookie *__fscache_acquire_cookie(
484484

485485
trace_fscache_acquire(cookie);
486486
fscache_stat(&fscache_n_acquires_ok);
487-
kleave(" = c=%08x", cookie->debug_id);
487+
_leave(" = c=%08x", cookie->debug_id);
488488
return cookie;
489489
}
490490
EXPORT_SYMBOL(__fscache_acquire_cookie);
@@ -505,7 +505,7 @@ static void fscache_perform_lookup(struct fscache_cookie *cookie)
505505
enum fscache_access_trace trace = fscache_access_lookup_cookie_end_failed;
506506
bool need_withdraw = false;
507507

508-
kenter("");
508+
_enter("");
509509

510510
if (!cookie->volume->cache_priv) {
511511
fscache_create_volume(cookie->volume, true);
@@ -519,7 +519,7 @@ static void fscache_perform_lookup(struct fscache_cookie *cookie)
519519
if (cookie->state != FSCACHE_COOKIE_STATE_FAILED)
520520
fscache_set_cookie_state(cookie, FSCACHE_COOKIE_STATE_QUIESCENT);
521521
need_withdraw = true;
522-
kleave(" [fail]");
522+
_leave(" [fail]");
523523
goto out;
524524
}
525525

@@ -572,7 +572,7 @@ void __fscache_use_cookie(struct fscache_cookie *cookie, bool will_modify)
572572
bool queue = false;
573573
int n_active;
574574

575-
kenter("c=%08x", cookie->debug_id);
575+
_enter("c=%08x", cookie->debug_id);
576576

577577
if (WARN(test_bit(FSCACHE_COOKIE_RELINQUISHED, &cookie->flags),
578578
"Trying to use relinquished cookie\n"))
@@ -636,7 +636,7 @@ void __fscache_use_cookie(struct fscache_cookie *cookie, bool will_modify)
636636
spin_unlock(&cookie->lock);
637637
if (queue)
638638
fscache_queue_cookie(cookie, fscache_cookie_get_use_work);
639-
kleave("");
639+
_leave("");
640640
}
641641
EXPORT_SYMBOL(__fscache_use_cookie);
642642

@@ -702,7 +702,7 @@ static void fscache_cookie_state_machine(struct fscache_cookie *cookie)
702702
enum fscache_cookie_state state;
703703
bool wake = false;
704704

705-
kenter("c=%x", cookie->debug_id);
705+
_enter("c=%x", cookie->debug_id);
706706

707707
again:
708708
spin_lock(&cookie->lock);
@@ -820,7 +820,7 @@ static void fscache_cookie_state_machine(struct fscache_cookie *cookie)
820820
spin_unlock(&cookie->lock);
821821
if (wake)
822822
wake_up_cookie_state(cookie);
823-
kleave("");
823+
_leave("");
824824
}
825825

826826
static void fscache_cookie_worker(struct work_struct *work)
@@ -867,7 +867,7 @@ static void fscache_cookie_lru_do_one(struct fscache_cookie *cookie)
867867
set_bit(FSCACHE_COOKIE_DO_LRU_DISCARD, &cookie->flags);
868868
spin_unlock(&cookie->lock);
869869
fscache_stat(&fscache_n_cookies_lru_expired);
870-
kdebug("lru c=%x", cookie->debug_id);
870+
_debug("lru c=%x", cookie->debug_id);
871871
__fscache_withdraw_cookie(cookie);
872872
}
873873

@@ -971,7 +971,7 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, bool retire)
971971
if (retire)
972972
fscache_stat(&fscache_n_relinquishes_retire);
973973

974-
kenter("c=%08x{%d},%d",
974+
_enter("c=%08x{%d},%d",
975975
cookie->debug_id, atomic_read(&cookie->n_active), retire);
976976

977977
if (WARN(test_and_set_bit(FSCACHE_COOKIE_RELINQUISHED, &cookie->flags),
@@ -1050,7 +1050,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie,
10501050
{
10511051
bool is_caching;
10521052

1053-
kenter("c=%x", cookie->debug_id);
1053+
_enter("c=%x", cookie->debug_id);
10541054

10551055
fscache_stat(&fscache_n_invalidates);
10561056

@@ -1072,7 +1072,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie,
10721072
case FSCACHE_COOKIE_STATE_INVALIDATING: /* is_still_valid will catch it */
10731073
default:
10741074
spin_unlock(&cookie->lock);
1075-
kleave(" [no %u]", cookie->state);
1075+
_leave(" [no %u]", cookie->state);
10761076
return;
10771077

10781078
case FSCACHE_COOKIE_STATE_LOOKING_UP:
@@ -1081,7 +1081,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie,
10811081
fallthrough;
10821082
case FSCACHE_COOKIE_STATE_CREATING:
10831083
spin_unlock(&cookie->lock);
1084-
kleave(" [look %x]", cookie->inval_counter);
1084+
_leave(" [look %x]", cookie->inval_counter);
10851085
return;
10861086

10871087
case FSCACHE_COOKIE_STATE_ACTIVE:
@@ -1094,7 +1094,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie,
10941094

10951095
if (is_caching)
10961096
fscache_queue_cookie(cookie, fscache_cookie_get_inval_work);
1097-
kleave(" [inv]");
1097+
_leave(" [inv]");
10981098
return;
10991099
}
11001100
}

fs/netfs/fscache_io.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ bool fscache_wait_for_operation(struct netfs_cache_resources *cres,
2828

2929
again:
3030
if (!fscache_cache_is_live(cookie->volume->cache)) {
31-
kleave(" [broken]");
31+
_leave(" [broken]");
3232
return false;
3333
}
3434

3535
state = fscache_cookie_state(cookie);
36-
kenter("c=%08x{%u},%x", cookie->debug_id, state, want_state);
36+
_enter("c=%08x{%u},%x", cookie->debug_id, state, want_state);
3737

3838
switch (state) {
3939
case FSCACHE_COOKIE_STATE_CREATING:
@@ -52,7 +52,7 @@ bool fscache_wait_for_operation(struct netfs_cache_resources *cres,
5252
case FSCACHE_COOKIE_STATE_DROPPED:
5353
case FSCACHE_COOKIE_STATE_RELINQUISHING:
5454
default:
55-
kleave(" [not live]");
55+
_leave(" [not live]");
5656
return false;
5757
}
5858

@@ -92,7 +92,7 @@ static int fscache_begin_operation(struct netfs_cache_resources *cres,
9292
spin_lock(&cookie->lock);
9393

9494
state = fscache_cookie_state(cookie);
95-
kenter("c=%08x{%u},%x", cookie->debug_id, state, want_state);
95+
_enter("c=%08x{%u},%x", cookie->debug_id, state, want_state);
9696

9797
switch (state) {
9898
case FSCACHE_COOKIE_STATE_LOOKING_UP:
@@ -140,7 +140,7 @@ static int fscache_begin_operation(struct netfs_cache_resources *cres,
140140
cres->cache_priv = NULL;
141141
cres->ops = NULL;
142142
fscache_end_cookie_access(cookie, fscache_access_io_not_live);
143-
kleave(" = -ENOBUFS");
143+
_leave(" = -ENOBUFS");
144144
return -ENOBUFS;
145145
}
146146

@@ -224,7 +224,7 @@ void __fscache_write_to_cache(struct fscache_cookie *cookie,
224224
if (len == 0)
225225
goto abandon;
226226

227-
kenter("%llx,%zx", start, len);
227+
_enter("%llx,%zx", start, len);
228228

229229
wreq = kzalloc(sizeof(struct fscache_write_request), GFP_NOFS);
230230
if (!wreq)

fs/netfs/fscache_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ int __init fscache_init(void)
9999
*/
100100
void __exit fscache_exit(void)
101101
{
102-
kenter("");
102+
_enter("");
103103

104104
kmem_cache_destroy(fscache_cookie_jar);
105105
fscache_proc_cleanup();

fs/netfs/fscache_volume.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static struct fscache_volume *fscache_alloc_volume(const char *volume_key,
264264
fscache_see_volume(volume, fscache_volume_new_acquire);
265265
fscache_stat(&fscache_n_volumes);
266266
up_write(&fscache_addremove_sem);
267-
kleave(" = v=%x", volume->debug_id);
267+
_leave(" = v=%x", volume->debug_id);
268268
return volume;
269269

270270
err_vol:
@@ -466,7 +466,7 @@ void fscache_withdraw_volume(struct fscache_volume *volume)
466466
{
467467
int n_accesses;
468468

469-
kdebug("withdraw V=%x", volume->debug_id);
469+
_debug("withdraw V=%x", volume->debug_id);
470470

471471
/* Allow wakeups on dec-to-0 */
472472
n_accesses = atomic_dec_return(&volume->n_accesses);

0 commit comments

Comments
 (0)