Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fscache: Change %p in format strings to something else

Change plain %p in format strings in fscache code to something more useful,
since %p is now hashed before printing and thus no longer matches the
contents of an oops register dump.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/160588474843.3465195.5446072310069374803.stgit@warthog.procyon.org.uk/ # rfc
Link: https://lore.kernel.org/r/162431199509.2908479.2950631488219944294.stgit@warthog.procyon.org.uk/

+11 -14
+4 -4
fs/fscache/cache.c
··· 116 116 cache = NULL; 117 117 118 118 spin_unlock(&cookie->lock); 119 - _leave(" = %p [parent]", cache); 119 + _leave(" = %s [parent]", cache ? cache->tag->name : "NULL"); 120 120 return cache; 121 121 } 122 122 ··· 152 152 if (test_bit(FSCACHE_IOERROR, &tag->cache->flags)) 153 153 return NULL; 154 154 155 - _leave(" = %p [specific]", tag->cache); 155 + _leave(" = %s [specific]", tag->name); 156 156 return tag->cache; 157 157 158 158 no_preference: 159 159 /* netfs has no preference - just select first cache */ 160 160 cache = list_entry(fscache_cache_list.next, 161 161 struct fscache_cache, link); 162 - _leave(" = %p [first]", cache); 162 + _leave(" = %s [first]", cache->tag->name); 163 163 return cache; 164 164 } 165 165 ··· 334 334 struct fscache_object, cache_link); 335 335 list_move_tail(&object->cache_link, dying_objects); 336 336 337 - _debug("withdraw %p", object->cookie); 337 + _debug("withdraw %x", object->cookie->debug_id); 338 338 339 339 /* This must be done under object_list_lock to prevent 340 340 * a race with fscache_drop_object().
+7 -9
fs/fscache/cookie.c
··· 375 375 bool (*can_enable)(void *data), 376 376 void *data) 377 377 { 378 - _enter("%p", cookie); 378 + _enter("%x", cookie->debug_id); 379 379 380 380 trace_fscache_enable(cookie); 381 381 ··· 472 472 473 473 /* we may be required to wait for lookup to complete at this point */ 474 474 if (!fscache_defer_lookup) { 475 - _debug("non-deferred lookup %p", &cookie->flags); 476 475 wait_on_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP, 477 476 TASK_UNINTERRUPTIBLE); 478 - _debug("complete"); 479 477 if (test_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags)) 480 478 goto unavailable; 481 479 } ··· 498 500 struct fscache_object *object; 499 501 int ret; 500 502 501 - _enter("%p,%p{%s}", cache, cookie, cookie->def->name); 503 + _enter("%s,%x{%s}", cache->tag->name, cookie->debug_id, cookie->def->name); 502 504 503 505 spin_lock(&cookie->lock); 504 506 hlist_for_each_entry(object, &cookie->backing_objects, ··· 674 676 */ 675 677 void __fscache_wait_on_invalidate(struct fscache_cookie *cookie) 676 678 { 677 - _enter("%p", cookie); 679 + _enter("%x", cookie->debug_id); 678 680 679 681 wait_on_bit(&cookie->flags, FSCACHE_COOKIE_INVALIDATING, 680 682 TASK_UNINTERRUPTIBLE); ··· 729 731 struct fscache_object *object; 730 732 bool awaken = false; 731 733 732 - _enter("%p,%u", cookie, invalidate); 734 + _enter("%x,%u", cookie->debug_id, invalidate); 733 735 734 736 trace_fscache_disable(cookie); 735 737 ··· 819 821 return; 820 822 } 821 823 822 - _enter("%p{%s,%p,%d},%d", 823 - cookie, cookie->def->name, cookie->netfs_data, 824 + _enter("%x{%s,%d},%d", 825 + cookie->debug_id, cookie->def->name, 824 826 atomic_read(&cookie->n_active), retire); 825 827 826 828 trace_fscache_relinquish(cookie, retire); ··· 875 877 struct fscache_cookie *parent; 876 878 int usage; 877 879 878 - _enter("%p", cookie); 880 + _enter("%x", cookie->debug_id); 879 881 880 882 do { 881 883 usage = atomic_dec_return(&cookie->usage);
-1
fs/fscache/object.c
··· 518 518 set_bit(FSCACHE_COOKIE_NO_DATA_YET, &cookie->flags); 519 519 clear_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags); 520 520 521 - _debug("wake up lookup %p", &cookie->flags); 522 521 clear_bit_unlock(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags); 523 522 wake_up_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP); 524 523 }