Skip to contentSkip to conversation

ceph: Use more generic logging

PATCH In review Joe Perches 2 participants 9 messages Aug 17, 2020

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover ceph: Use more generic logging

Convert the dout macro to the normal pr_debug.
Convert embedded function names in these changes to %s, __func__ Remove the dout macro definitions

Joe Perches (6):
ceph: Use generic debugging facility
ceph: Remove embedded function names from pr_debug uses
net: ceph: Use generic debugging facility
net: ceph: Remove embedded function names from pr_debug uses
rbd: Use generic debugging facility
ceph_debug: Remove now unused dout macro definitions

 drivers/block/rbd.c             | 231 +++++++-------
 fs/ceph/addr.c                  | 266 ++++++++--------
 fs/ceph/cache.c                 |  22 +-
 fs/ceph/caps.c                  | 533 ++++++++++++++++----------------
 fs/ceph/debugfs.c               |   4 +-
 fs/ceph/dir.c                   | 141 ++++-----
 fs/ceph/export.c                |  36 +--
 fs/ceph/file.c                  | 170 +++++-----
 fs/ceph/inode.c                 | 338 ++++++++++----------
 fs/ceph/ioctl.c                 |   6 +-
 fs/ceph/locks.c                 |  42 +--
 fs/ceph/mds_client.c            | 374 +++++++++++-----------
 fs/ceph/mdsmap.c                |  16 +-
 fs/ceph/metric.c                |   4 +-
 fs/ceph/quota.c                 |   4 +-
 fs/ceph/snap.c                  | 135 ++++----
 fs/ceph/super.c                 |  67 ++--
 fs/ceph/xattr.c                 |  64 ++--
 include/linux/ceph/ceph_debug.h |  30 --
 include/linux/ceph/messenger.h  |   2 +-
 net/ceph/auth.c                 |  21 +-
 net/ceph/auth_none.c            |   4 +-
 net/ceph/auth_x.c               |  85 ++---
 net/ceph/buffer.c               |   6 +-
 net/ceph/ceph_common.c          |  18 +-
 net/ceph/cls_lock_client.c      |  32 +-
 net/ceph/crypto.c               |   8 +-
 net/ceph/debugfs.c              |   4 +-
 net/ceph/messenger.c            | 330 ++++++++++----------
 net/ceph/mon_client.c           |  99 +++---
 net/ceph/msgpool.c              |  14 +-
 net/ceph/osd_client.c           | 393 ++++++++++++-----------
 net/ceph/osdmap.c               | 101 +++---
 net/ceph/pagevec.c              |  10 +-
 34 files changed, 1835 insertions(+), 1775 deletions(-)
Signature · 1 line
2.26.0
#1 lore raw

PATCH v2 1/6 ceph: Use generic debugging facility

The dout macro duplicates the generic features of pr_debug with __FILE__ and __func__ output capability when using dynamic_debug.

Convert dout to pr_debug and remove the "pretty" print feature of dout.

Miscellanea:

o Realign arguments

---
 fs/ceph/addr.c                 | 265 +++++++++--------
 fs/ceph/cache.c                |  22 +-
 fs/ceph/caps.c                 | 529 +++++++++++++++++----------------
 fs/ceph/debugfs.c              |   4 +-
 fs/ceph/dir.c                  | 141 ++++-----
 fs/ceph/export.c               |  36 +--
 fs/ceph/file.c                 | 170 ++++++-----
 fs/ceph/inode.c                | 338 +++++++++++----------
 fs/ceph/ioctl.c                |   6 +-
 fs/ceph/locks.c                |  43 +--
 fs/ceph/mds_client.c           | 373 +++++++++++------------
 fs/ceph/mdsmap.c               |  16 +-
 fs/ceph/metric.c               |   4 +-
 fs/ceph/quota.c                |   4 +-
 fs/ceph/snap.c                 | 135 +++++----
 fs/ceph/super.c                |  67 +++--
 fs/ceph/xattr.c                |  63 ++--
 include/linux/ceph/messenger.h |   2 +-
 18 files changed, 1133 insertions(+), 1085 deletions(-)
fs/ceph/addr.c +135 -130
index 6ea761c84494..12ae6f7874fb 100644
@@ -84,8 +84,8 @@ static int ceph_set_page_dirty(struct page *page)
 		return !TestSetPageDirty(page);
 
 	if (PageDirty(page)) {
-		dout("%p set_page_dirty %p idx %lu -- already dirty\n",
-		     mapping->host, page, page->index);
+		pr_debug("%p set_page_dirty %p idx %lu -- already dirty\n",
+			 mapping->host, page, page->index);
 		BUG_ON(!PagePrivate(page));
 		return 0;
 	}
@@ -111,12 +111,11 @@ static int ceph_set_page_dirty(struct page *page)
 	if (ci->i_wrbuffer_ref == 0)
 		ihold(inode);
 	++ci->i_wrbuffer_ref;
-	dout("%p set_page_dirty %p idx %lu head %d/%d -> %d/%d "
-	     "snapc %p seq %lld (%d snaps)\n",
-	     mapping->host, page, page->index,
-	     ci->i_wrbuffer_ref-1, ci->i_wrbuffer_ref_head-1,
-	     ci->i_wrbuffer_ref, ci->i_wrbuffer_ref_head,
-	     snapc, snapc->seq, snapc->num_snaps);
+	pr_debug("%p set_page_dirty %p idx %lu head %d/%d -> %d/%d snapc %p seq %lld (%d snaps)\n",
+		 mapping->host, page, page->index,
+		 ci->i_wrbuffer_ref - 1, ci->i_wrbuffer_ref_head - 1,
+		 ci->i_wrbuffer_ref, ci->i_wrbuffer_ref_head,
+		 snapc, snapc->seq, snapc->num_snaps);
 	spin_unlock(&ci->i_ceph_lock);
 
 	/*
@@ -150,8 +149,8 @@ static void ceph_invalidatepage(struct page *page, unsigned int offset,
 	ci = ceph_inode(inode);
 
 	if (offset != 0 || length != PAGE_SIZE) {
-		dout("%p invalidatepage %p idx %lu partial dirty page %u~%u\n",
-		     inode, page, page->index, offset, length);
+		pr_debug("%p invalidatepage %p idx %lu partial dirty page %u~%u\n",
+			 inode, page, page->index, offset, length);
 		return;
 	}
 
@@ -161,8 +160,8 @@ static void ceph_invalidatepage(struct page *page, unsigned int offset,
 	if (!PagePrivate(page))
 		return;
 
-	dout("%p invalidatepage %p idx %lu full dirty page\n",
-	     inode, page, page->index);
+	pr_debug("%p invalidatepage %p idx %lu full dirty page\n",
+		 inode, page, page->index);
 
 	ceph_put_wrbuffer_cap_refs(ci, 1, snapc);
 	ceph_put_snap_context(snapc);
@@ -172,8 +171,9 @@ static void ceph_invalidatepage(struct page *page, unsigned int offset,
 
 static int ceph_releasepage(struct page *page, gfp_t g)
 {
-	dout("%p releasepage %p idx %lu (%sdirty)\n", page->mapping->host,
-	     page, page->index, PageDirty(page) ? "" : "not ");
+	pr_debug("%p releasepage %p idx %lu (%sdirty)\n",
+		 page->mapping->host, page, page->index,
+		 PageDirty(page) ? "" : "not ");
 
 	/* Can we release the page from the cache? */
 	if (!ceph_release_fscache_page(page, g))
@@ -198,8 +198,8 @@ static int ceph_sync_readpages(struct ceph_fs_client *fsc,
 	struct ceph_osd_request *req;
 	int rc = 0;
 
-	dout("readpages on ino %llx.%llx on %llu~%llu\n", vino.ino,
-	     vino.snap, off, *plen);
+	pr_debug("readpages on ino %llx.%llx on %llu~%llu\n",
+		 vino.ino, vino.snap, off, *plen);
 	req = ceph_osdc_new_request(osdc, layout, vino, off, plen, 0, 1,
 				    CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ,
 				    NULL, truncate_seq, truncate_size,
@@ -211,8 +211,8 @@ static int ceph_sync_readpages(struct ceph_fs_client *fsc,
 	osd_req_op_extent_osd_data_pages(req, 0,
 				pages, *plen, page_align, false, false);
 
-	dout("readpages  final extent is %llu~%llu (%llu bytes align %d)\n",
-	     off, *plen, *plen, page_align);
+	pr_debug("readpages final extent is %llu~%llu (%llu bytes align %d)\n",
+		 off, *plen, *plen, page_align);
 
 	rc = ceph_osdc_start_request(osdc, req, false);
 	if (!rc)
@@ -222,7 +222,7 @@ static int ceph_sync_readpages(struct ceph_fs_client *fsc,
 				 req->r_end_latency, rc);
 
 	ceph_osdc_put_request(req);
-	dout("readpages result %d\n", rc);
+	pr_debug("readpages result %d\n", rc);
 	return rc;
 }
 
@@ -260,8 +260,8 @@ static int ceph_do_readpage(struct file *filp, struct page *page)
 	if (err == 0)
 		return -EINPROGRESS;
 
-	dout("readpage inode %p file %p page %p index %lu\n",
-	     inode, filp, page, page->index);
+	pr_debug("readpage inode %p file %p page %p index %lu\n",
+		 inode, filp, page, page->index);
 	err = ceph_sync_readpages(fsc, ceph_vino(inode),
 				  &ci->i_layout, off, &len,
 				  ci->i_truncate_seq, ci->i_truncate_size,
@@ -311,7 +311,8 @@ static void finish_read(struct ceph_osd_request *req)
 	int num_pages;
 	int i;
 
-	dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes);
+	pr_debug("finish_read %p req %p rc %d bytes %d\n",
+		 inode, req, rc, bytes);
 	if (rc == -EBLACKLISTED)
 		ceph_inode_to_client(inode)->blacklisted = true;
 
@@ -332,8 +333,8 @@ static void finish_read(struct ceph_osd_request *req)
 			int s = bytes < 0 ? 0 : bytes;
 			zero_user_segment(page, s, PAGE_SIZE);
 		}
- 		dout("finish_read %p uptodate %p idx %lu\n", inode, page,
-		     page->index);
+		pr_debug("finish_read %p uptodate %p idx %lu\n",
+			 inode, page, page->index);
 		flush_dcache_page(page);
 		SetPageUptodate(page);
 		ceph_readpage_to_fscache(inode, page);
@@ -378,9 +379,9 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 		ret = ceph_try_get_caps(inode, CEPH_CAP_FILE_RD, want,
 					true, &got);
 		if (ret < 0) {
-			dout("start_read %p, error getting cap\n", inode);
+			pr_debug("start_read %p, error getting cap\n", inode);
 		} else if (!(got & want)) {
-			dout("start_read %p, no cache cap\n", inode);
+			pr_debug("start_read %p, no cache cap\n", inode);
 			ret = 0;
 		}
 		if (ret <= 0) {
@@ -408,8 +409,8 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 			break;
 	}
 	len = nr_pages << PAGE_SHIFT;
-	dout("start_read %p nr_pages %d is %lld~%lld\n", inode, nr_pages,
-	     off, len);
+	pr_debug("start_read %p nr_pages %d is %lld~%lld\n",
+		 inode, nr_pages, off, len);
 	vino = ceph_vino(inode);
 	req = ceph_osdc_new_request(osdc, &ci->i_layout, vino, off, &len,
 				    0, 1, CEPH_OSD_OP_READ,
@@ -433,14 +434,14 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 		BUG_ON(PageLocked(page));
 		list_del(&page->lru);
 
- 		dout("start_read %p adding %p idx %lu\n", inode, page,
-		     page->index);
+		pr_debug("start_read %p adding %p idx %lu\n",
+			 inode, page, page->index);
 		if (add_to_page_cache_lru(page, &inode->i_data, page->index,
 					  GFP_KERNEL)) {
 			ceph_fscache_uncache_page(inode, page);
 			put_page(page);
-			dout("start_read %p add_to_page_cache failed %p\n",
-			     inode, page);
+			pr_debug("start_read %p add_to_page_cache failed %p\n",
+				 inode, page);
 			nr_pages = i;
 			if (nr_pages > 0) {
 				len = nr_pages << PAGE_SHIFT;
@@ -455,7 +456,7 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 	req->r_callback = finish_read;
 	req->r_inode = inode;
 
-	dout("start_read %p starting %p %lld~%lld\n", inode, req, off, len);
+	pr_debug("start_read %p starting %p %lld~%lld\n", inode, req, off, len);
 	ret = ceph_osdc_start_request(osdc, req, false);
 	if (ret < 0)
 		goto out_pages;
@@ -508,8 +509,8 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
 
 	rw_ctx = ceph_find_rw_context(fi);
 	max = fsc->mount_options->rsize >> PAGE_SHIFT;
-	dout("readpages %p file %p ctx %p nr_pages %d max %d\n",
-	     inode, file, rw_ctx, nr_pages, max);
+	pr_debug("readpages %p file %p ctx %p nr_pages %d max %d\n",
+		 inode, file, rw_ctx, nr_pages, max);
 	while (!list_empty(page_list)) {
 		rc = start_read(inode, rw_ctx, page_list, max);
 		if (rc < 0)
@@ -518,7 +519,7 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
 out:
 	ceph_fscache_readpages_cancel(inode, page_list);
 
-	dout("readpages %p file %p ret %d\n", inode, file, rc);
+	pr_debug("readpages %p file %p ret %d\n", inode, file, rc);
 	return rc;
 }
 
@@ -545,8 +546,8 @@ get_oldest_context(struct inode *inode, struct ceph_writeback_ctl *ctl,
 
 	spin_lock(&ci->i_ceph_lock);
 	list_for_each_entry(capsnap, &ci->i_cap_snaps, ci_item) {
-		dout(" cap_snap %p snapc %p has %d dirty pages\n", capsnap,
-		     capsnap->context, capsnap->dirty_pages);
+		pr_debug("cap_snap %p snapc %p has %d dirty pages\n",
+			 capsnap, capsnap->context, capsnap->dirty_pages);
 		if (!capsnap->dirty_pages)
 			continue;
 
@@ -578,8 +579,8 @@ get_oldest_context(struct inode *inode, struct ceph_writeback_ctl *ctl,
 	}
 	if (!snapc && ci->i_wrbuffer_ref_head) {
 		snapc = ceph_get_snap_context(ci->i_head_snapc);
-		dout(" head snapc %p has %d dirty pages\n",
-		     snapc, ci->i_wrbuffer_ref_head);
+		pr_debug("head snapc %p has %d dirty pages\n",
+			 snapc, ci->i_wrbuffer_ref_head);
 		if (ctl) {
 			ctl->i_size = i_size_read(inode);
 			ctl->truncate_size = ci->i_truncate_size;
@@ -646,7 +647,7 @@ static int ceph_sync_writepages(struct ceph_fs_client *fsc,
 	/* it may be a short write due to an object boundary */
 	osd_req_op_extent_osd_data_pages(req, 0, pages, len, page_align,
 				false, false);
-	dout("writepages %llu~%llu (%llu bytes)\n", off, len, len);
+	pr_debug("writepages %llu~%llu (%llu bytes)\n", off, len, len);
 
 	req->r_mtime = *mtime;
 	rc = ceph_osdc_start_request(osdc, req, true);
@@ -659,7 +660,7 @@ static int ceph_sync_writepages(struct ceph_fs_client *fsc,
 	ceph_osdc_put_request(req);
 	if (rc == 0)
 		rc = len;
-	dout("writepages result %d\n", rc);
+	pr_debug("writepages result %d\n", rc);
 	return rc;
 }
 
@@ -679,7 +680,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
 	int err, len = PAGE_SIZE;
 	struct ceph_writeback_ctl ceph_wbc;
 
-	dout("writepage %p idx %lu\n", page, page->index);
+	pr_debug("writepage %p idx %lu\n", page, page->index);
 
 	inode = page->mapping->host;
 	ci = ceph_inode(inode);
@@ -688,13 +689,13 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
 	/* verify this is a writeable snap context */
 	snapc = page_snap_context(page);
 	if (!snapc) {
-		dout("writepage %p page %p not dirty?\n", inode, page);
+		pr_debug("writepage %p page %p not dirty?\n", inode, page);
 		return 0;
 	}
 	oldest = get_oldest_context(inode, &ceph_wbc, snapc);
 	if (snapc->seq > oldest->seq) {
-		dout("writepage %p page %p snapc %p not writeable - noop\n",
-		     inode, page, snapc);
+		pr_debug("writepage %p page %p snapc %p not writeable - noop\n",
+			 inode, page, snapc);
 		/* we should only noop if called by kswapd */
 		WARN_ON(!(current->flags & PF_MEMALLOC));
 		ceph_put_snap_context(oldest);
@@ -705,7 +706,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
 
 	/* is this a partial page at end of file? */
 	if (page_off >= ceph_wbc.i_size) {
-		dout("%p page eof %llu\n", page, ceph_wbc.i_size);
+		pr_debug("%p page eof %llu\n", page, ceph_wbc.i_size);
 		page->mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
 		return 0;
 	}
@@ -713,8 +714,8 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
 	if (ceph_wbc.i_size < page_off + len)
 		len = ceph_wbc.i_size - page_off;
 
-	dout("writepage %p page %p index %lu on %llu~%u snapc %p seq %lld\n",
-	     inode, page, page->index, page_off, len, snapc, snapc->seq);
+	pr_debug("writepage %p page %p index %lu on %llu~%u snapc %p seq %lld\n",
+		 inode, page, page->index, page_off, len, snapc, snapc->seq);
 
 	if (atomic_long_inc_return(&fsc->writeback_count) >
 	    CONGESTION_ON_THRESH(fsc->mount_options->congestion_kb))
@@ -732,19 +733,19 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
 			wbc = &tmp_wbc;
 		if (err == -ERESTARTSYS) {
 			/* killed by SIGKILL */
-			dout("writepage interrupted page %p\n", page);
+			pr_debug("writepage interrupted page %p\n", page);
 			redirty_page_for_writepage(wbc, page);
 			end_page_writeback(page);
 			return err;
 		}
 		if (err == -EBLACKLISTED)
 			fsc->blacklisted = true;
-		dout("writepage setting page/mapping error %d %p\n",
-		     err, page);
+		pr_debug("writepage setting page/mapping error %d %p\n",
+			 err, page);
 		mapping_set_error(&inode->i_data, err);
 		wbc->pages_skipped++;
 	} else {
-		dout("writepage cleaned page %p\n", page);
+		pr_debug("writepage cleaned page %p\n", page);
 		err = 0;  /* vfs expects us to return 0 */
 	}
 	page->private = 0;
@@ -797,7 +798,7 @@ static void writepages_finish(struct ceph_osd_request *req)
 	struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
 	bool remove_page;
 
-	dout("writepages_finish %p rc %d\n", inode, rc);
+	pr_debug("writepages_finish %p rc %d\n", inode, rc);
 	if (rc < 0) {
 		mapping_set_error(mapping, rc);
 		ceph_set_error_write(ci);
@@ -843,7 +844,7 @@ static void writepages_finish(struct ceph_osd_request *req)
 			ceph_put_snap_context(page_snap_context(page));
 			page->private = 0;
 			ClearPagePrivate(page);
-			dout("unlocking %p\n", page);
+			pr_debug("unlocking %p\n", page);
 			end_page_writeback(page);
 
 			if (remove_page)
@@ -852,8 +853,8 @@ static void writepages_finish(struct ceph_osd_request *req)
 
 			unlock_page(page);
 		}
-		dout("writepages_finish %p wrote %llu bytes cleaned %d pages\n",
-		     inode, osd_data->length, rc >= 0 ? num_pages : 0);
+		pr_debug("writepages_finish %p wrote %llu bytes cleaned %d pages\n",
+			 inode, osd_data->length, rc >= 0 ? num_pages : 0);
 
 		release_pages(osd_data->pages, num_pages);
 	}
@@ -888,9 +889,10 @@ static int ceph_writepages_start(struct address_space *mapping,
 	bool should_loop, range_whole = false;
 	bool done = false;
 
-	dout("writepages_start %p (mode=%s)\n", inode,
-	     wbc->sync_mode == WB_SYNC_NONE ? "NONE" :
-	     (wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD"));
+	pr_debug("writepages_start %p (mode=%s)\n",
+		 inode,
+		 wbc->sync_mode == WB_SYNC_NONE ? "NONE" :
+		 wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD");
 
 	if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
 		if (ci->i_wrbuffer_ref > 0) {
@@ -915,11 +917,11 @@ static int ceph_writepages_start(struct address_space *mapping,
 	if (!snapc) {
 		/* hmm, why does writepages get called when there
 		   is no dirty data? */
-		dout(" no snap context with dirty data?\n");
+		pr_debug("no snap context with dirty data?\n");
 		goto out;
 	}
-	dout(" oldest snapc is %p seq %lld (%d snaps)\n",
-	     snapc, snapc->seq, snapc->num_snaps);
+	pr_debug("oldest snapc is %p seq %lld (%d snaps)\n",
+		 snapc, snapc->seq, snapc->num_snaps);
 
 	should_loop = false;
 	if (ceph_wbc.head_snapc && snapc != last_snapc) {
@@ -929,13 +931,13 @@ static int ceph_writepages_start(struct address_space *mapping,
 			end = -1;
 			if (index > 0)
 				should_loop = true;
-			dout(" cyclic, start at %lu\n", index);
+			pr_debug("cyclic, start at %lu\n", index);
 		} else {
 			index = wbc->range_start >> PAGE_SHIFT;
 			end = wbc->range_end >> PAGE_SHIFT;
 			if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
 				range_whole = true;
-			dout(" not cyclic, %lu to %lu\n", index, end);
+			pr_debug("not cyclic, %lu to %lu\n", index, end);
 		}
 	} else if (!ceph_wbc.head_snapc) {
 		/* Do not respect wbc->range_{start,end}. Dirty pages
@@ -944,7 +946,7 @@ static int ceph_writepages_start(struct address_space *mapping,
 		 * associated with 'snapc' get written */
 		if (index > 0)
 			should_loop = true;
-		dout(" non-head snapc, range whole\n");
+		pr_debug("non-head snapc, range whole\n");
 	}
 
 	ceph_put_snap_context(last_snapc);
@@ -965,12 +967,12 @@ static int ceph_writepages_start(struct address_space *mapping,
 		pvec_pages = pagevec_lookup_range_nr_tag(&pvec, mapping, &index,
 						end, PAGECACHE_TAG_DIRTY,
 						max_pages - locked_pages);
-		dout("pagevec_lookup_range_tag got %d\n", pvec_pages);
+		pr_debug("pagevec_lookup_range_tag got %d\n", pvec_pages);
 		if (!pvec_pages && !locked_pages)
 			break;
 		for (i = 0; i < pvec_pages && locked_pages < max_pages; i++) {
 			page = pvec.pages[i];
-			dout("? %p idx %lu\n", page, page->index);
+			pr_debug("? %p idx %lu\n", page, page->index);
 			if (locked_pages == 0)
 				lock_page(page);  /* first page */
 			else if (!trylock_page(page))
@@ -979,15 +981,16 @@ static int ceph_writepages_start(struct address_space *mapping,
 			/* only dirty pages, or our accounting breaks */
 			if (unlikely(!PageDirty(page)) ||
 			    unlikely(page->mapping != mapping)) {
-				dout("!dirty or !mapping %p\n", page);
+				pr_debug("!dirty or !mapping %p\n", page);
 				unlock_page(page);
 				continue;
 			}
 			/* only if matching snap context */
 			pgsnapc = page_snap_context(page);
 			if (pgsnapc != snapc) {
-				dout("page snapc %p %lld != oldest %p %lld\n",
-				     pgsnapc, pgsnapc->seq, snapc, snapc->seq);
+				pr_debug("page snapc %p %lld != oldest %p %lld\n",
+					 pgsnapc, pgsnapc->seq,
+					 snapc, snapc->seq);
 				if (!should_loop &&
 				    !ceph_wbc.head_snapc &&
 				    wbc->sync_mode != WB_SYNC_NONE)
@@ -996,8 +999,8 @@ static int ceph_writepages_start(struct address_space *mapping,
 				continue;
 			}
 			if (page_offset(page) >= ceph_wbc.i_size) {
-				dout("%p page eof %llu\n",
-				     page, ceph_wbc.i_size);
+				pr_debug("%p page eof %llu\n",
+					 page, ceph_wbc.i_size);
 				if ((ceph_wbc.size_stable ||
 				    page_offset(page) >= i_size_read(inode)) &&
 				    clear_page_dirty_for_io(page))
@@ -1007,22 +1010,22 @@ static int ceph_writepages_start(struct address_space *mapping,
 				continue;
 			}
 			if (strip_unit_end && (page->index > strip_unit_end)) {
-				dout("end of strip unit %p\n", page);
+				pr_debug("end of strip unit %p\n", page);
 				unlock_page(page);
 				break;
 			}
 			if (PageWriteback(page)) {
 				if (wbc->sync_mode == WB_SYNC_NONE) {
-					dout("%p under writeback\n", page);
+					pr_debug("%p under writeback\n", page);
 					unlock_page(page);
 					continue;
 				}
-				dout("waiting on writeback %p\n", page);
+				pr_debug("waiting on writeback %p\n", page);
 				wait_on_page_writeback(page);
 			}
 
 			if (!clear_page_dirty_for_io(page)) {
-				dout("%p !clear_page_dirty_for_io\n", page);
+				pr_debug("%p !clear_page_dirty_for_io\n", page);
 				unlock_page(page);
 				continue;
 			}
@@ -1077,8 +1080,8 @@ static int ceph_writepages_start(struct address_space *mapping,
 			}
 
 			/* note position of first page in pvec */
-			dout("%p will write page %p idx %lu\n",
-			     inode, page, page->index);
+			pr_debug("%p will write page %p idx %lu\n",
+				 inode, page, page->index);
 
 			if (atomic_long_inc_return(&fsc->writeback_count) >
 			    CONGESTION_ON_THRESH(
@@ -1111,7 +1114,7 @@ static int ceph_writepages_start(struct address_space *mapping,
 
 			if (pvec_pages && i == pvec_pages &&
 			    locked_pages < max_pages) {
-				dout("reached end pvec, trying for more\n");
+				pr_debug("reached end pvec, trying for more\n");
 				pagevec_release(&pvec);
 				goto get_more_pages;
 			}
@@ -1156,8 +1159,8 @@ static int ceph_writepages_start(struct address_space *mapping,
 					break;
 				osd_req_op_extent_dup_last(req, op_idx,
 							   cur_offset - offset);
-				dout("writepages got pages at %llu~%llu\n",
-				     offset, len);
+				pr_debug("writepages got pages at %llu~%llu\n",
+					 offset, len);
 				osd_req_op_extent_osd_data_pages(req, op_idx,
 							data_pages, len, 0,
 							from_pool, false);
@@ -1184,7 +1187,7 @@ static int ceph_writepages_start(struct address_space *mapping,
 							 offset);
 			len = max(len, min_len);
 		}
-		dout("writepages got pages at %llu~%llu\n", offset, len);
+		pr_debug("writepages got pages at %llu~%llu\n", offset, len);
 
 		osd_req_op_extent_osd_data_pages(req, op_idx, data_pages, len,
 						 0, from_pool, false);
@@ -1237,14 +1240,14 @@ static int ceph_writepages_start(struct address_space *mapping,
 			done = true;
 
 release_pvec_pages:
-		dout("pagevec_release on %d pages (%p)\n", (int)pvec.nr,
-		     pvec.nr ? pvec.pages[0] : NULL);
+		pr_debug("pagevec_release on %d pages (%p)\n",
+			 (int)pvec.nr, pvec.nr ? pvec.pages[0] : NULL);
 		pagevec_release(&pvec);
 	}
 
 	if (should_loop && !done) {
 		/* more to do; loop back to beginning of file */
-		dout("writepages looping back to beginning of file\n");
+		pr_debug("writepages looping back to beginning of file\n");
 		end = start_index - 1; /* OK even when start_index == 0 */
 
 		/* to write dirty pages associated with next snapc,
@@ -1280,7 +1283,7 @@ static int ceph_writepages_start(struct address_space *mapping,
 out:
 	ceph_osdc_put_request(req);
 	ceph_put_snap_context(last_snapc);
-	dout("writepages dend - startone, rc = %d\n", rc);
+	pr_debug("writepages dend - startone, rc = %d\n", rc);
 	return rc;
 }
 
@@ -1322,7 +1325,7 @@ static int ceph_update_writeable_page(struct file *file,
 	struct ceph_snap_context *snapc, *oldest;
 
 	if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
-		dout(" page %p forced umount\n", page);
+		pr_debug("page %p forced umount\n", page);
 		unlock_page(page);
 		return -EIO;
 	}
@@ -1340,8 +1343,8 @@ static int ceph_update_writeable_page(struct file *file,
 		oldest = get_oldest_context(inode, NULL, NULL);
 		if (snapc->seq > oldest->seq) {
 			ceph_put_snap_context(oldest);
-			dout(" page %p snapc %p not current or oldest\n",
-			     page, snapc);
+			pr_debug("page %p snapc %p not current or oldest\n",
+				 page, snapc);
 			/*
 			 * queue for writeback, and wait for snapc to
 			 * be writeable or written
@@ -1359,8 +1362,8 @@ static int ceph_update_writeable_page(struct file *file,
 		ceph_put_snap_context(oldest);
 
 		/* yay, writeable, do it now (without dropping page lock) */
-		dout(" page %p snapc %p not current, but oldest\n",
-		     page, snapc);
+		pr_debug("page %p snapc %p not current, but oldest\n",
+			 page, snapc);
 		if (!clear_page_dirty_for_io(page))
 			goto retry_locked;
 		r = writepage_nounlock(page, NULL);
@@ -1370,7 +1373,7 @@ static int ceph_update_writeable_page(struct file *file,
 	}
 
 	if (PageUptodate(page)) {
-		dout(" page %p already uptodate\n", page);
+		pr_debug("page %p already uptodate\n", page);
 		return 0;
 	}
 
@@ -1384,8 +1387,8 @@ static int ceph_update_writeable_page(struct file *file,
 	if (page_off >= i_size ||
 	    (pos_in_page == 0 && (pos+len) >= i_size &&
 	     end_in_page - pos_in_page != PAGE_SIZE)) {
-		dout(" zeroing %p 0 - %d and %d - %d\n",
-		     page, pos_in_page, end_in_page, (int)PAGE_SIZE);
+		pr_debug("zeroing %p 0 - %d and %d - %d\n",
+			 page, pos_in_page, end_in_page, (int)PAGE_SIZE);
 		zero_user_segments(page,
 				   0, pos_in_page,
 				   end_in_page, PAGE_SIZE);
@@ -1424,8 +1427,8 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
 		if (!page)
 			return -ENOMEM;
 
-		dout("write_begin file %p inode %p page %p %d~%d\n", file,
-		     inode, page, (int)pos, (int)len);
+		pr_debug("write_begin file %p inode %p page %p %d~%d\n",
+			 file, inode, page, (int)pos, (int)len);
 
 		r = ceph_update_writeable_page(file, pos, len, page);
 		if (r < 0)
@@ -1448,8 +1451,8 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
 	struct inode *inode = file_inode(file);
 	bool check_cap = false;
 
-	dout("write_end file %p inode %p page %p %d~%d (%d)\n", file,
-	     inode, page, (int)pos, (int)copied, (int)len);
+	pr_debug("write_end file %p inode %p page %p %d~%d (%d)\n",
+		 file, inode, page, (int)pos, (int)copied, (int)len);
 
 	/* zero the stale part of the page if we did a short copy */
 	if (!PageUptodate(page)) {
@@ -1529,8 +1532,8 @@ static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
 
 	ceph_block_sigs(&oldset);
 
-	dout("filemap_fault %p %llx.%llx %llu~%zd trying to get caps\n",
-	     inode, ceph_vinop(inode), off, (size_t)PAGE_SIZE);
+	pr_debug("filemap_fault %p %llx.%llx %llu~%zd trying to get caps\n",
+		 inode, ceph_vinop(inode), off, (size_t)PAGE_SIZE);
 	if (fi->fmode & CEPH_FILE_MODE_LAZY)
 		want = CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO;
 	else
@@ -1542,8 +1545,8 @@ static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
 	if (err < 0)
 		goto out_restore;
 
-	dout("filemap_fault %p %llu~%zd got cap refs on %s\n",
-	     inode, off, (size_t)PAGE_SIZE, ceph_cap_string(got));
+	pr_debug("filemap_fault %p %llu~%zd got cap refs on %s\n",
+		 inode, off, (size_t)PAGE_SIZE, ceph_cap_string(got));
 
 	if ((got & (CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO)) ||
 	    ci->i_inline_version == CEPH_INLINE_NONE) {
@@ -1551,9 +1554,9 @@ static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
 		ceph_add_rw_context(fi, &rw_ctx);
 		ret = filemap_fault(vmf);
 		ceph_del_rw_context(fi, &rw_ctx);
-		dout("filemap_fault %p %llu~%zd drop cap refs %s ret %x\n",
-			inode, off, (size_t)PAGE_SIZE,
-				ceph_cap_string(got), ret);
+		pr_debug("filemap_fault %p %llu~%zd drop cap refs %s ret %x\n",
+			 inode, off, (size_t)PAGE_SIZE,
+			 ceph_cap_string(got), ret);
 	} else
 		err = -EAGAIN;
 
@@ -1593,8 +1596,8 @@ static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
 		vmf->page = page;
 		ret = VM_FAULT_MAJOR | VM_FAULT_LOCKED;
 out_inline:
-		dout("filemap_fault %p %llu~%zd read inline data ret %x\n",
-		     inode, off, (size_t)PAGE_SIZE, ret);
+		pr_debug("filemap_fault %p %llu~%zd read inline data ret %x\n",
+			 inode, off, (size_t)PAGE_SIZE, ret);
 	}
 out_restore:
 	ceph_restore_sigs(&oldset);
@@ -1647,8 +1650,8 @@ static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
 	else
 		len = size & ~PAGE_MASK;
 
-	dout("page_mkwrite %p %llx.%llx %llu~%zd getting caps i_size %llu\n",
-	     inode, ceph_vinop(inode), off, len, size);
+	pr_debug("page_mkwrite %p %llx.%llx %llu~%zd getting caps i_size %llu\n",
+		 inode, ceph_vinop(inode), off, len, size);
 	if (fi->fmode & CEPH_FILE_MODE_LAZY)
 		want = CEPH_CAP_FILE_BUFFER | CEPH_CAP_FILE_LAZYIO;
 	else
@@ -1660,8 +1663,8 @@ static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
 	if (err < 0)
 		goto out_free;
 
-	dout("page_mkwrite %p %llu~%zd got cap refs on %s\n",
-	     inode, off, len, ceph_cap_string(got));
+	pr_debug("page_mkwrite %p %llu~%zd got cap refs on %s\n",
+		 inode, off, len, ceph_cap_string(got));
 
 	/* Update time before taking page lock */
 	file_update_time(vma->vm_file);
@@ -1696,8 +1699,8 @@ static vm_fault_t ceph_page_mkwrite(struct vm_fault *vmf)
 			__mark_inode_dirty(inode, dirty);
 	}
 
-	dout("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %x\n",
-	     inode, off, len, ceph_cap_string(got), ret);
+	pr_debug("page_mkwrite %p %llu~%zd dropping cap refs on %s ret %x\n",
+		 inode, off, len, ceph_cap_string(got), ret);
 	ceph_put_cap_refs(ci, got);
 out_free:
 	ceph_restore_sigs(&oldset);
@@ -1731,8 +1734,8 @@ void ceph_fill_inline_data(struct inode *inode, struct page *locked_page,
 		}
 	}
 
-	dout("fill_inline_data %p %llx.%llx len %zu locked_page %p\n",
-	     inode, ceph_vinop(inode), len, locked_page);
+	pr_debug("fill_inline_data %p %llx.%llx len %zu locked_page %p\n",
+		 inode, ceph_vinop(inode), len, locked_page);
 
 	if (len > 0) {
 		void *kaddr = kmap_atomic(page);
@@ -1767,8 +1770,8 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page)
 	inline_version = ci->i_inline_version;
 	spin_unlock(&ci->i_ceph_lock);
 
-	dout("uninline_data %p %llx.%llx inline_version %llu\n",
-	     inode, ceph_vinop(inode), inline_version);
+	pr_debug("uninline_data %p %llx.%llx inline_version %llu\n",
+		 inode, ceph_vinop(inode), inline_version);
 
 	if (inline_version == 1 || /* initial version, no data */
 	    inline_version == CEPH_INLINE_NONE)
@@ -1884,8 +1887,8 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page)
 			__free_pages(page, 0);
 	}
 
-	dout("uninline_data %p %llx.%llx inline_version %llu = %d\n",
-	     inode, ceph_vinop(inode), inline_version, err);
+	pr_debug("uninline_data %p %llx.%llx inline_version %llu = %d\n",
+		 inode, ceph_vinop(inode), inline_version, err);
 	return err;
 }
 
@@ -1949,10 +1952,11 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
 		goto out;
 
 	if (pool_ns)
-		dout("__ceph_pool_perm_get pool %lld ns %.*s no perm cached\n",
-		     pool, (int)pool_ns->len, pool_ns->str);
+		pr_debug("__ceph_pool_perm_get pool %lld ns %.*s no perm cached\n",
+			 pool, (int)pool_ns->len, pool_ns->str);
 	else
-		dout("__ceph_pool_perm_get pool %lld no perm cached\n", pool);
+		pr_debug("__ceph_pool_perm_get pool %lld no perm cached\n",
+			 pool);
 
 	down_write(&mdsc->pool_perm_rwsem);
 	p = &mdsc->pool_perm_tree.rb_node;
@@ -2079,10 +2083,11 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
 	if (!err)
 		err = have;
 	if (pool_ns)
-		dout("__ceph_pool_perm_get pool %lld ns %.*s result = %d\n",
-		     pool, (int)pool_ns->len, pool_ns->str, err);
+		pr_debug("__ceph_pool_perm_get pool %lld ns %.*s result = %d\n",
+			 pool, (int)pool_ns->len, pool_ns->str, err);
 	else
-		dout("__ceph_pool_perm_get pool %lld result = %d\n", pool, err);
+		pr_debug("__ceph_pool_perm_get pool %lld result = %d\n",
+			 pool, err);
 	return err;
 }
 
@@ -2113,13 +2118,13 @@ int ceph_pool_perm_check(struct inode *inode, int need)
 check:
 	if (flags & CEPH_I_POOL_PERM) {
 		if ((need & CEPH_CAP_FILE_RD) && !(flags & CEPH_I_POOL_RD)) {
-			dout("ceph_pool_perm_check pool %lld no read perm\n",
-			     pool);
+			pr_debug("ceph_pool_perm_check pool %lld no read perm\n",
+				 pool);
 			return -EPERM;
 		}
 		if ((need & CEPH_CAP_FILE_WR) && !(flags & CEPH_I_POOL_WR)) {
-			dout("ceph_pool_perm_check pool %lld no write perm\n",
-			     pool);
+			pr_debug("ceph_pool_perm_check pool %lld no write perm\n",
+				 pool);
 			return -EPERM;
 		}
 		return 0;
fs/ceph/cache.c +11 -11
index 2f5cb6bc78e1..59c1083d00dd 100644
@@ -125,7 +125,7 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux(
 	if (memcmp(data, &aux, sizeof(aux)) != 0)
 		return FSCACHE_CHECKAUX_OBSOLETE;
 
-	dout("ceph inode 0x%p cached okay\n", ci);
+	pr_debug("ceph inode 0x%p cached okay\n", ci);
 	return FSCACHE_CHECKAUX_OKAY;
 }
 
@@ -191,16 +191,16 @@ void ceph_fscache_file_set_cookie(struct inode *inode, struct file *filp)
 		return;
 
 	if (inode_is_open_for_write(inode)) {
-		dout("fscache_file_set_cookie %p %p disabling cache\n",
-		     inode, filp);
+		pr_debug("fscache_file_set_cookie %p %p disabling cache\n",
+			 inode, filp);
 		fscache_disable_cookie(ci->fscache, &ci->i_vino, false);
 		fscache_uncache_all_inode_pages(ci->fscache, inode);
 	} else {
 		fscache_enable_cookie(ci->fscache, &ci->i_vino, i_size_read(inode),
 				      ceph_fscache_can_enable, inode);
 		if (fscache_cookie_enabled(ci->fscache)) {
-			dout("fscache_file_set_cookie %p %p enabling cache\n",
-			     inode, filp);
+			pr_debug("fscache_file_set_cookie %p %p enabling cache\n",
+				 inode, filp);
 		}
 	}
 }
@@ -238,14 +238,14 @@ int ceph_readpage_from_fscache(struct inode *inode, struct page *page)
 
 	switch (ret) {
 		case 0: /* Page found */
-			dout("page read submitted\n");
+			pr_debug("page read submitted\n");
 			return 0;
 		case -ENOBUFS: /* Pages were not found, and can't be */
 		case -ENODATA: /* Pages were not found */
-			dout("page/inode not in cache\n");
+			pr_debug("page/inode not in cache\n");
 			return ret;
 		default:
-			dout("%s: unknown error ret = %i\n", __func__, ret);
+			pr_debug("%s: unknown error ret = %i\n", __func__, ret);
 			return ret;
 	}
 }
@@ -267,14 +267,14 @@ int ceph_readpages_from_fscache(struct inode *inode,
 
 	switch (ret) {
 		case 0: /* All pages found */
-			dout("all-page read submitted\n");
+			pr_debug("all-page read submitted\n");
 			return 0;
 		case -ENOBUFS: /* Some pages were not found, and can't be */
 		case -ENODATA: /* some pages were not found */
-			dout("page/inode not in cache\n");
+			pr_debug("page/inode not in cache\n");
 			return ret;
 		default:
-			dout("%s: unknown error ret = %i\n", __func__, ret);
+			pr_debug("%s: unknown error ret = %i\n", __func__, ret);
 			return ret;
 	}
 }
fs/ceph/caps.c +270 -259

1,180 lines not on this page · raw message

fs/ceph/debugfs.c +2 -2
index 97539b497e4c..244428de3c4b 100644
@@ -324,7 +324,7 @@ DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
 
 void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
 {
-	dout("ceph_fs_debugfs_cleanup\n");
+	pr_debug("ceph_fs_debugfs_cleanup\n");
 	debugfs_remove(fsc->debugfs_bdi);
 	debugfs_remove(fsc->debugfs_congestion_kb);
 	debugfs_remove(fsc->debugfs_mdsmap);
@@ -338,7 +338,7 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
 {
 	char name[100];
 
-	dout("ceph_fs_debugfs_init\n");
+	pr_debug("ceph_fs_debugfs_init\n");
 	fsc->debugfs_congestion_kb =
 		debugfs_create_file("writeback_congestion_kb",
 				    0600,
fs/ceph/dir.c +71 -70

393 lines not on this page · raw message

fs/ceph/export.c +18 -18
index e088843a7734..fe5c0adb9cc2 100644
@@ -78,7 +78,7 @@ static int ceph_encode_snapfh(struct inode *inode, u32 *rawfh, int *max_len,
 	*max_len = snap_handle_length;
 	ret = FILEID_BTRFS_WITH_PARENT;
 out:
-	dout("encode_snapfh %llx.%llx ret=%d\n", ceph_vinop(inode), ret);
+	pr_debug("encode_snapfh %llx.%llx ret=%d\n", ceph_vinop(inode), ret);
 	return ret;
 }
 
@@ -104,15 +104,15 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
 
 	if (parent_inode) {
 		struct ceph_nfs_confh *cfh = (void *)rawfh;
-		dout("encode_fh %llx with parent %llx\n",
-		     ceph_ino(inode), ceph_ino(parent_inode));
+		pr_debug("encode_fh %llx with parent %llx\n",
+			 ceph_ino(inode), ceph_ino(parent_inode));
 		cfh->ino = ceph_ino(inode);
 		cfh->parent_ino = ceph_ino(parent_inode);
 		*max_len = connected_handle_length;
 		type = FILEID_INO32_GEN_PARENT;
 	} else {
 		struct ceph_nfs_fh *fh = (void *)rawfh;
-		dout("encode_fh %llx\n", ceph_ino(inode));
+		pr_debug("encode_fh %llx\n", ceph_ino(inode));
 		fh->ino = ceph_ino(inode);
 		*max_len = handle_length;
 		type = FILEID_INO32_GEN;
@@ -255,11 +255,11 @@ static struct dentry *__snapfh_to_dentry(struct super_block *sb,
 	ceph_mdsc_put_request(req);
 
 	if (want_parent) {
-		dout("snapfh_to_parent %llx.%llx\n err=%d\n",
-		     vino.ino, vino.snap, err);
+		pr_debug("snapfh_to_parent %llx.%llx\n err=%d\n",
+			 vino.ino, vino.snap, err);
 	} else {
-		dout("snapfh_to_dentry %llx.%llx parent %llx hash %x err=%d",
-		      vino.ino, vino.snap, sfh->parent_ino, sfh->hash, err);
+		pr_debug("snapfh_to_dentry %llx.%llx parent %llx hash %x err=%d\n",
+			 vino.ino, vino.snap, sfh->parent_ino, sfh->hash, err);
 	}
 	if (!inode)
 		return ERR_PTR(-ESTALE);
@@ -287,7 +287,7 @@ static struct dentry *ceph_fh_to_dentry(struct super_block *sb,
 	if (fh_len < sizeof(*fh) / 4)
 		return NULL;
 
-	dout("fh_to_dentry %llx\n", fh->ino);
+	pr_debug("fh_to_dentry %llx\n", fh->ino);
 	return __fh_to_dentry(sb, fh->ino);
 }
 
@@ -379,8 +379,8 @@ static struct dentry *ceph_get_parent(struct dentry *child)
 		dn = __get_parent(child->d_sb, child, 0);
 	}
 out:
-	dout("get_parent %p ino %llx.%llx err=%ld\n",
-	     child, ceph_vinop(inode), (long)PTR_ERR_OR_ZERO(dn));
+	pr_debug("get_parent %p ino %llx.%llx err=%ld\n",
+		 child, ceph_vinop(inode), (long)PTR_ERR_OR_ZERO(dn));
 	return dn;
 }
 
@@ -404,7 +404,7 @@ static struct dentry *ceph_fh_to_parent(struct super_block *sb,
 	if (fh_len < sizeof(*cfh) / 4)
 		return NULL;
 
-	dout("fh_to_parent %llx\n", cfh->parent_ino);
+	pr_debug("fh_to_parent %llx\n", cfh->parent_ino);
 	dentry = __get_parent(sb, NULL, cfh->ino);
 	if (unlikely(dentry == ERR_PTR(-ENOENT)))
 		dentry = __fh_to_dentry(sb, cfh->parent_ino);
@@ -503,8 +503,8 @@ static int __get_snap_name(struct dentry *parent, char *name,
 	if (req)
 		ceph_mdsc_put_request(req);
 	kfree(last_name);
-	dout("get_snap_name %p ino %llx.%llx err=%d\n",
-	     child, ceph_vinop(inode), err);
+	pr_debug("get_snap_name %p ino %llx.%llx err=%d\n",
+		 child, ceph_vinop(inode), err);
 	return err;
 }
 
@@ -541,11 +541,11 @@ static int ceph_get_name(struct dentry *parent, char *name,
 		struct ceph_mds_reply_info_parsed *rinfo = &req->r_reply_info;
 		memcpy(name, rinfo->dname, rinfo->dname_len);
 		name[rinfo->dname_len] = 0;
-		dout("get_name %p ino %llx.%llx name %s\n",
-		     child, ceph_vinop(inode), name);
+		pr_debug("get_name %p ino %llx.%llx name %s\n",
+			 child, ceph_vinop(inode), name);
 	} else {
-		dout("get_name %p ino %llx.%llx err %d\n",
-		     child, ceph_vinop(inode), err);
+		pr_debug("get_name %p ino %llx.%llx err %d\n",
+			 child, ceph_vinop(inode), err);
 	}
 
 	ceph_mdsc_put_request(req);
fs/ceph/file.c +88 -82

462 lines not on this page · raw message

fs/ceph/inode.c +173 -165

95 lines not on this page · raw message

fs/ceph/ioctl.c +3 -3
index 6e061bf62ad4..177417c23962 100644

Lines of this file are not shown. View the raw message.

fs/ceph/locks.c +22 -21

43 lines not on this page · raw message

fs/ceph/mds_client.c +191 -182

373 lines not on this page · raw message

fs/ceph/mdsmap.c +8 -8
index e4aba6c6d3b5..50c3f7f60409 100644

Lines of this file are not shown. View the raw message.

fs/ceph/metric.c +2 -2
index 2466b261fba2..cb257eee48f8 100644

Lines of this file are not shown. View the raw message.

fs/ceph/quota.c +2 -2
index 198ddde5c1e6..55bd95f86444 100644

Lines of this file are not shown. View the raw message.

fs/ceph/snap.c +69 -66

135 lines not on this page · raw message

fs/ceph/super.c +34 -33

67 lines not on this page · raw message

fs/ceph/xattr.c +33 -30

63 lines not on this page · raw message

include/linux/ceph/messenger.h +1 -1
index 76371aaae2d1..0a69a4cb8583 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.26.0

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH v2 2/6 ceph: Remove embedded function names from pr_debug uses

In reply to Joe Perches

Use "%s: " ..., __func__ so function renaming changes the logging too.

---
 fs/ceph/addr.c       | 57 +++++++++++++-------------
 fs/ceph/caps.c       | 92 ++++++++++++++++++++++--------------------
 fs/ceph/debugfs.c    |  2 +-
 fs/ceph/dir.c        | 16 ++++----
 fs/ceph/file.c       |  6 +--
 fs/ceph/inode.c      | 18 ++++-----
 fs/ceph/locks.c      | 15 ++++---
 fs/ceph/mds_client.c | 95 ++++++++++++++++++++++----------------------
 fs/ceph/snap.c       | 22 +++++-----
 fs/ceph/super.c      | 10 ++---
 fs/ceph/xattr.c      | 25 ++++++------
 11 files changed, 182 insertions(+), 176 deletions(-)
fs/ceph/addr.c +29 -28
index 12ae6f7874fb..4f0f177428c7 100644
@@ -311,8 +311,8 @@ static void finish_read(struct ceph_osd_request *req)
 	int num_pages;
 	int i;
 
-	pr_debug("finish_read %p req %p rc %d bytes %d\n",
-		 inode, req, rc, bytes);
+	pr_debug("%s: %p req %p rc %d bytes %d\n",
+		 __func__, inode, req, rc, bytes);
 	if (rc == -EBLACKLISTED)
 		ceph_inode_to_client(inode)->blacklisted = true;
 
@@ -333,8 +333,8 @@ static void finish_read(struct ceph_osd_request *req)
 			int s = bytes < 0 ? 0 : bytes;
 			zero_user_segment(page, s, PAGE_SIZE);
 		}
-		pr_debug("finish_read %p uptodate %p idx %lu\n",
-			 inode, page, page->index);
+		pr_debug("%s: %p uptodate %p idx %lu\n",
+			 __func__, inode, page, page->index);
 		flush_dcache_page(page);
 		SetPageUptodate(page);
 		ceph_readpage_to_fscache(inode, page);
@@ -379,9 +379,10 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 		ret = ceph_try_get_caps(inode, CEPH_CAP_FILE_RD, want,
 					true, &got);
 		if (ret < 0) {
-			pr_debug("start_read %p, error getting cap\n", inode);
+			pr_debug("%s: %p, error getting cap\n",
+				 __func__, inode);
 		} else if (!(got & want)) {
-			pr_debug("start_read %p, no cache cap\n", inode);
+			pr_debug("%s: %p, no cache cap\n", __func__, inode);
 			ret = 0;
 		}
 		if (ret <= 0) {
@@ -409,8 +410,8 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 			break;
 	}
 	len = nr_pages << PAGE_SHIFT;
-	pr_debug("start_read %p nr_pages %d is %lld~%lld\n",
-		 inode, nr_pages, off, len);
+	pr_debug("%s: %p nr_pages %d is %lld~%lld\n",
+		 __func__, inode, nr_pages, off, len);
 	vino = ceph_vino(inode);
 	req = ceph_osdc_new_request(osdc, &ci->i_layout, vino, off, &len,
 				    0, 1, CEPH_OSD_OP_READ,
@@ -434,14 +435,14 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 		BUG_ON(PageLocked(page));
 		list_del(&page->lru);
 
-		pr_debug("start_read %p adding %p idx %lu\n",
-			 inode, page, page->index);
+		pr_debug("%s: %p adding %p idx %lu\n",
+			 __func__, inode, page, page->index);
 		if (add_to_page_cache_lru(page, &inode->i_data, page->index,
 					  GFP_KERNEL)) {
 			ceph_fscache_uncache_page(inode, page);
 			put_page(page);
-			pr_debug("start_read %p add_to_page_cache failed %p\n",
-				 inode, page);
+			pr_debug("%s: %p add_to_page_cache failed %p\n",
+				 __func__, inode, page);
 			nr_pages = i;
 			if (nr_pages > 0) {
 				len = nr_pages << PAGE_SHIFT;
@@ -456,7 +457,8 @@ static int start_read(struct inode *inode, struct ceph_rw_context *rw_ctx,
 	req->r_callback = finish_read;
 	req->r_inode = inode;
 
-	pr_debug("start_read %p starting %p %lld~%lld\n", inode, req, off, len);
+	pr_debug("%s: %p starting %p %lld~%lld\n",
+		 __func__, inode, req, off, len);
 	ret = ceph_osdc_start_request(osdc, req, false);
 	if (ret < 0)
 		goto out_pages;
@@ -798,7 +800,7 @@ static void writepages_finish(struct ceph_osd_request *req)
 	struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
 	bool remove_page;
 
-	pr_debug("writepages_finish %p rc %d\n", inode, rc);
+	pr_debug("%s: %p rc %d\n", __func__, inode, rc);
 	if (rc < 0) {
 		mapping_set_error(mapping, rc);
 		ceph_set_error_write(ci);
@@ -853,8 +855,9 @@ static void writepages_finish(struct ceph_osd_request *req)
 
 			unlock_page(page);
 		}
-		pr_debug("writepages_finish %p wrote %llu bytes cleaned %d pages\n",
-			 inode, osd_data->length, rc >= 0 ? num_pages : 0);
+		pr_debug("%s: %p wrote %llu bytes cleaned %d pages\n",
+			 __func__, inode, osd_data->length,
+			 rc >= 0 ? num_pages : 0);
 
 		release_pages(osd_data->pages, num_pages);
 	}
@@ -1952,11 +1955,10 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
 		goto out;
 
 	if (pool_ns)
-		pr_debug("__ceph_pool_perm_get pool %lld ns %.*s no perm cached\n",
-			 pool, (int)pool_ns->len, pool_ns->str);
+		pr_debug("%s: %lld ns %.*s no perm cached\n",
+			 __func__, pool, (int)pool_ns->len, pool_ns->str);
 	else
-		pr_debug("__ceph_pool_perm_get pool %lld no perm cached\n",
-			 pool);
+		pr_debug("%s: %lld no perm cached\n", __func__, pool);
 
 	down_write(&mdsc->pool_perm_rwsem);
 	p = &mdsc->pool_perm_tree.rb_node;
@@ -2083,11 +2085,10 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
 	if (!err)
 		err = have;
 	if (pool_ns)
-		pr_debug("__ceph_pool_perm_get pool %lld ns %.*s result = %d\n",
-			 pool, (int)pool_ns->len, pool_ns->str, err);
+		pr_debug("%s: pool %lld ns %.*s result = %d\n",
+			 __func__, pool, (int)pool_ns->len, pool_ns->str, err);
 	else
-		pr_debug("__ceph_pool_perm_get pool %lld result = %d\n",
-			 pool, err);
+		pr_debug("%s: pool %lld result = %d\n", __func__, pool, err);
 	return err;
 }
 
@@ -2118,13 +2119,13 @@ int ceph_pool_perm_check(struct inode *inode, int need)
 check:
 	if (flags & CEPH_I_POOL_PERM) {
 		if ((need & CEPH_CAP_FILE_RD) && !(flags & CEPH_I_POOL_RD)) {
-			pr_debug("ceph_pool_perm_check pool %lld no read perm\n",
-				 pool);
+			pr_debug("%s: pool %lld no read perm\n",
+				 __func__, pool);
 			return -EPERM;
 		}
 		if ((need & CEPH_CAP_FILE_WR) && !(flags & CEPH_I_POOL_WR)) {
-			pr_debug("ceph_pool_perm_check pool %lld no write perm\n",
-				 pool);
+			pr_debug("%s: pool %lld no write perm\n",
+				 __func__, pool);
 			return -EPERM;
 		}
 		return 0;
fs/ceph/caps.c +48 -44

236 lines not on this page · raw message

fs/ceph/debugfs.c +1 -1
index 244428de3c4b..298b0df741cc 100644
@@ -338,7 +338,7 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
 {
 	char name[100];
 
-	pr_debug("ceph_fs_debugfs_init\n");
+	pr_debug("%s\n", __func__);
 	fsc->debugfs_congestion_kb =
 		debugfs_create_file("writeback_congestion_kb",
 				    0600,
fs/ceph/dir.c +8 -8
index 911b905cc181..9178b19f93f9 100644
@@ -120,7 +120,7 @@ static int note_last_dentry(struct ceph_dir_file_info *dfi, const char *name,
 	memcpy(dfi->last_name, name, len);
 	dfi->last_name[len] = 0;
 	dfi->next_offset = next_offset;
-	pr_debug("note_last_dentry '%s'\n", dfi->last_name);
+	pr_debug("%s: '%s'\n", __func__, dfi->last_name);
 	return 0;
 }
 
@@ -191,8 +191,8 @@ static int __dcache_readdir(struct file *file,  struct dir_context *ctx,
 	u64 idx = 0;
 	int err = 0;
 
-	pr_debug("__dcache_readdir %p v%u at %llx\n",
-		 dir, (unsigned int)shared_gen, ctx->pos);
+	pr_debug("%s: %p v%u at %llx\n",
+		 __func__, dir, (unsigned int)shared_gen, ctx->pos);
 
 	/* search start position */
 	if (ctx->pos > 2) {
@@ -222,7 +222,7 @@ static int __dcache_readdir(struct file *file,  struct dir_context *ctx,
 			dput(dentry);
 		}
 
-		pr_debug("__dcache_readdir %p cache idx %llu\n", dir, idx);
+		pr_debug("%s: %p cache idx %llu\n", __func__, dir, idx);
 	}
 
 
@@ -1597,7 +1597,7 @@ static int dentry_lease_is_valid(struct dentry *dentry, unsigned int flags)
 					 CEPH_MDS_LEASE_RENEW, seq);
 		ceph_put_mds_session(session);
 	}
-	pr_debug("dentry_lease_is_valid - dentry %p = %d\n", dentry, valid);
+	pr_debug("%s: dentry %p = %d\n", __func__, dentry, valid);
 	return valid;
 }
 
@@ -1661,8 +1661,8 @@ static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry,
 			valid = 0;
 		spin_unlock(&dentry->d_lock);
 	}
-	pr_debug("dir_lease_is_valid dir %p v%u dentry %p = %d\n",
-		 dir, (unsigned int)atomic_read(&ci->i_shared_gen),
+	pr_debug("%s: dir %p v%u dentry %p = %d\n",
+		 __func__, dir, (unsigned int)atomic_read(&ci->i_shared_gen),
 		 dentry, valid);
 	return valid;
 }
@@ -1825,7 +1825,7 @@ static void ceph_d_prune(struct dentry *dentry)
 	struct ceph_inode_info *dir_ci;
 	struct ceph_dentry_info *di;
 
-	pr_debug("ceph_d_prune %pd %p\n", dentry, dentry);
+	pr_debug("%s: %pd %p\n", __func__, dentry, dentry);
 
 	/* do we have a valid parent? */
 	if (IS_ROOT(dentry))
fs/ceph/file.c +3 -3
index 7d7644f8862c..d75b466780ca 100644
@@ -1020,7 +1020,7 @@ static void ceph_aio_complete(struct inode *inode,
 	if (!ret)
 		ret = aio_req->total_len;
 
-	pr_debug("ceph_aio_complete %p rc %d\n", inode, ret);
+	pr_debug("%s: %p rc %d\n", __func__, inode, ret);
 
 	if (ret >= 0 && aio_req->write) {
 		int dirty;
@@ -1062,8 +1062,8 @@ static void ceph_aio_complete_req(struct ceph_osd_request *req)
 	BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_BVECS);
 	BUG_ON(!osd_data->num_bvecs);
 
-	pr_debug("ceph_aio_complete_req %p rc %d bytes %u\n",
-		 inode, rc, osd_data->bvec_pos.iter.bi_size);
+	pr_debug("%s: %p rc %d bytes %u\n",
+		 __func__, inode, rc, osd_data->bvec_pos.iter.bi_size);
 
 	/* r_start_latency == 0 means the request was not submitted */
 	if (req->r_start_latency) {
fs/ceph/inode.c +9 -9
index b2ff9f03a46e..8658070c59ee 100644
@@ -1832,10 +1832,10 @@ void ceph_queue_writeback(struct inode *inode)
 	ihold(inode);
 	if (queue_work(ceph_inode_to_client(inode)->inode_wq,
 		       &ci->i_work)) {
-		pr_debug("ceph_queue_writeback %p\n", inode);
+		pr_debug("%s: %p\n", __func__, inode);
 	} else {
-		pr_debug("ceph_queue_writeback %p already queued, mask=%lx\n",
-			 inode, ci->i_work_mask);
+		pr_debug("%s: %p already queued, mask=%lx\n",
+			 __func__, inode, ci->i_work_mask);
 		iput(inode);
 	}
 }
@@ -1851,10 +1851,10 @@ void ceph_queue_invalidate(struct inode *inode)
 	ihold(inode);
 	if (queue_work(ceph_inode_to_client(inode)->inode_wq,
 		       &ceph_inode(inode)->i_work)) {
-		pr_debug("ceph_queue_invalidate %p\n", inode);
+		pr_debug("%s: %p\n", __func__, inode);
 	} else {
-		pr_debug("ceph_queue_invalidate %p already queued, mask=%lx\n",
-			 inode, ci->i_work_mask);
+		pr_debug("%s: %p already queued, mask=%lx\n",
+			 __func__, inode, ci->i_work_mask);
 		iput(inode);
 	}
 }
@@ -1871,10 +1871,10 @@ void ceph_queue_vmtruncate(struct inode *inode)
 	ihold(inode);
 	if (queue_work(ceph_inode_to_client(inode)->inode_wq,
 		       &ci->i_work)) {
-		pr_debug("ceph_queue_vmtruncate %p\n", inode);
+		pr_debug("%s: %p\n", __func__, inode);
 	} else {
-		pr_debug("ceph_queue_vmtruncate %p already queued, mask=%lx\n",
-			 inode, ci->i_work_mask);
+		pr_debug("%s: %p already queued, mask=%lx\n",
+			 __func__, inode, ci->i_work_mask);
 		iput(inode);
 	}
 }
fs/ceph/locks.c +7 -8
index 8f6819d2dc99..a414b8d51c3d 100644
@@ -98,8 +98,8 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct inode *inode,
 
 	owner = secure_addr(fl->fl_owner);
 
-	pr_debug("ceph_lock_message: rule: %d, op: %d, owner: %llx, pid: %llu, start: %llu, length: %llu, wait: %d, type: %d\n",
-		 (int)lock_type,
+	pr_debug("%s: rule: %d, op: %d, owner: %llx, pid: %llu, start: %llu, length: %llu, wait: %d, type: %d\n",
+		 __func__, (int)lock_type,
 		 (int)operation, owner, (u64)fl->fl_pid, fl->fl_start, length,
 		 wait, fl->fl_type);
 
@@ -134,8 +134,8 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct inode *inode,
 
 	}
 	ceph_mdsc_put_request(req);
-	pr_debug("ceph_lock_message: rule: %d, op: %d, pid: %llu, start: %llu, length: %llu, wait: %d, type: %d, err code %d\n",
-		 (int)lock_type,
+	pr_debug("%s: rule: %d, op: %d, pid: %llu, start: %llu, length: %llu, wait: %d, type: %d, err code %d\n",
+		 __func__, (int)lock_type,
 		 (int)operation, (u64)fl->fl_pid, fl->fl_start,
 		 length, wait, fl->fl_type, err);
 	return err;
@@ -161,8 +161,7 @@ static int ceph_lock_wait_for_completion(struct ceph_mds_client *mdsc,
 	if (!err)
 		return 0;
 
-	pr_debug("ceph_lock_wait_for_completion: request %llu was interrupted\n",
-		 req->r_tid);
+	pr_debug("%s: request %llu was interrupted\n", __func__, req->r_tid);
 
 	mutex_lock(&mdsc->mutex);
 	if (test_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags)) {
@@ -244,7 +243,7 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl)
 	if (__mandatory_lock(file->f_mapping->host) && fl->fl_type != F_UNLCK)
 		return -ENOLCK;
 
-	pr_debug("ceph_lock, fl_owner: %p\n", fl->fl_owner);
+	pr_debug("%s: fl_owner: %p\n", __func__, fl->fl_owner);
 
 	/* set wait bit as appropriate, then make command as Ceph expects it*/
 	if (IS_GETLK(cmd))
@@ -309,7 +308,7 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
 	if (fl->fl_type & LOCK_MAND)
 		return -EOPNOTSUPP;
 
-	pr_debug("ceph_flock, fl_file: %p\n", fl->fl_file);
+	pr_debug("%s: fl_file: %p\n", __func__, fl->fl_file);
 
 	spin_lock(&ci->i_ceph_lock);
 	if (ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) {
fs/ceph/mds_client.c +48 -47

278 lines not on this page · raw message

fs/ceph/snap.c +11 -11
index 73ccfd4172ac..5f22df095acd 100644
@@ -281,8 +281,8 @@ static int adjust_snap_realm_parent(struct ceph_mds_client *mdsc,
 		if (IS_ERR(parent))
 			return PTR_ERR(parent);
 	}
-	pr_debug("adjust_snap_realm_parent %llx %p: %llx %p -> %llx %p\n",
-		 realm->ino, realm, realm->parent_ino, realm->parent,
+	pr_debug("%s: %llx %p: %llx %p -> %llx %p\n",
+		 __func__, realm->ino, realm, realm->parent_ino, realm->parent,
 		 parentino, parent);
 	if (realm->parent) {
 		list_del_init(&realm->child_item);
@@ -338,8 +338,8 @@ static int build_snap_context(struct ceph_snap_realm *realm,
 	    realm->cached_context->seq == realm->seq &&
 	    (!parent ||
 	     realm->cached_context->seq >= parent->cached_context->seq)) {
-		pr_debug("build_snap_context %llx %p: %p seq %lld (%u snaps) (unchanged)\n",
-			 realm->ino, realm, realm->cached_context,
+		pr_debug("%s: %llx %p: %p seq %lld (%u snaps) (unchanged)\n",
+			 __func__, realm->ino, realm, realm->cached_context,
 			 realm->cached_context->seq,
 			 (unsigned int)realm->cached_context->num_snaps);
 		return 0;
@@ -378,8 +378,8 @@ static int build_snap_context(struct ceph_snap_realm *realm,
 
 	sort(snapc->snaps, num, sizeof(u64), cmpu64_rev, NULL);
 	snapc->num_snaps = num;
-	pr_debug("build_snap_context %llx %p: %p seq %lld (%u snaps)\n",
-		 realm->ino, realm, snapc, snapc->seq,
+	pr_debug("%s: %llx %p: %p seq %lld (%u snaps)\n",
+		 __func__, realm->ino, realm, snapc, snapc->seq,
 		 (unsigned int)snapc->num_snaps);
 
 	ceph_put_snap_context(realm->cached_context);
@@ -410,7 +410,7 @@ static void rebuild_snap_realms(struct ceph_snap_realm *realm,
 {
 	struct ceph_snap_realm *child;
 
-	pr_debug("rebuild_snap_realms %llx %p\n", realm->ino, realm);
+	pr_debug("%s: %llx %p\n", __func__, realm->ino, realm);
 	build_snap_context(realm, dirty_realms);
 
 	list_for_each_entry(child, &realm->children, child_item)
@@ -646,7 +646,7 @@ static void queue_realm_cap_snaps(struct ceph_snap_realm *realm)
 	struct ceph_inode_info *ci;
 	struct inode *lastinode = NULL;
 
-	pr_debug("queue_realm_cap_snaps %p %llx inodes\n", realm, realm->ino);
+	pr_debug("%s: %p %llx inodes\n", __func__, realm, realm->ino);
 
 	spin_lock(&realm->inodes_with_caps_lock);
 	list_for_each_entry(ci, &realm->inodes_with_caps, i_snap_realm_item) {
@@ -664,7 +664,7 @@ static void queue_realm_cap_snaps(struct ceph_snap_realm *realm)
 	spin_unlock(&realm->inodes_with_caps_lock);
 	ceph_async_iput(lastinode);
 
-	pr_debug("queue_realm_cap_snaps %p %llx done\n", realm, realm->ino);
+	pr_debug("%s: %p %llx done\n", __func__, realm, realm->ino);
 }
 
 /*
@@ -805,7 +805,7 @@ static void flush_snaps(struct ceph_mds_client *mdsc)
 	struct inode *inode;
 	struct ceph_mds_session *session = NULL;
 
-	pr_debug("flush_snaps\n");
+	pr_debug("%s\n", __func__);
 	spin_lock(&mdsc->snap_flush_lock);
 	while (!list_empty(&mdsc->snap_flush_list)) {
 		ci = list_first_entry(&mdsc->snap_flush_list,
@@ -825,7 +825,7 @@ static void flush_snaps(struct ceph_mds_client *mdsc)
 		mutex_unlock(&session->s_mutex);
 		ceph_put_mds_session(session);
 	}
-	pr_debug("flush_snaps done\n");
+	pr_debug("%s done\n", __func__);
 }
 
 
fs/ceph/super.c +5 -5
index 08dc6052d2b6..e7f079ebfbc4 100644
@@ -726,7 +726,7 @@ static void destroy_fs_client(struct ceph_fs_client *fsc)
 	ceph_destroy_client(fsc->client);
 
 	kfree(fsc);
-	pr_debug("destroy_fs_client %p done\n", fsc);
+	pr_debug("%s: %p done\n", __func__, fsc);
 }
 
 /*
@@ -841,7 +841,7 @@ static void ceph_umount_begin(struct super_block *sb)
 {
 	struct ceph_fs_client *fsc = ceph_sb_to_client(sb);
 
-	pr_debug("ceph_umount_begin - starting forced umount\n");
+	pr_debug("%s: starting forced umount\n", __func__);
 	if (!fsc)
 		return;
 	fsc->mount_state = CEPH_MOUNT_SHUTDOWN;
@@ -1001,7 +1001,7 @@ static int ceph_compare_super(struct super_block *sb, struct fs_context *fc)
 	struct ceph_options *opt = new->client->options;
 	struct ceph_fs_client *other = ceph_sb_to_client(sb);
 
-	pr_debug("ceph_compare_super %p\n", sb);
+	pr_debug("%s: %p\n", __func__, sb);
 
 	if (compare_mount_options(fsopt, opt, other)) {
 		pr_debug("monitor(s)/mount options don't match\n");
@@ -1052,7 +1052,7 @@ static int ceph_get_tree(struct fs_context *fc)
 		ceph_compare_super;
 	int err;
 
-	pr_debug("ceph_get_tree\n");
+	pr_debug("%s\n", __func__);
 
 	if (!fc->source)
 		return invalfc(fc, "No source");
@@ -1115,7 +1115,7 @@ static int ceph_get_tree(struct fs_context *fc)
 out:
 	destroy_fs_client(fsc);
 out_final:
-	pr_debug("ceph_get_tree fail %d\n", err);
+	pr_debug("%s: fail %d\n", __func__, err);
 	return err;
 }
 
fs/ceph/xattr.c +13 -12
index 503d1edeb28d..6cdf6866c745 100644
@@ -68,7 +68,7 @@ static ssize_t ceph_vxattrcb_layout(struct ceph_inode_info *ci, char *val,
 
 	pool_ns = ceph_try_get_string(ci->i_layout.pool_ns);
 
-	pr_debug("ceph_vxattrcb_layout %p\n", &ci->vfs_inode);
+	pr_debug("%s: %p\n", __func__, &ci->vfs_inode);
 	down_read(&osdc->lock);
 	pool_name = ceph_pg_pool_name_by_id(osdc->osdmap, pool);
 	if (pool_name) {
@@ -492,7 +492,7 @@ static int __set_xattr(struct ceph_inode_info *ci,
 		xattr->should_free_name = update_xattr;
 
 		ci->i_xattrs.count++;
-		pr_debug("__set_xattr count=%d\n", ci->i_xattrs.count);
+		pr_debug("%s: count=%d\n", __func__, ci->i_xattrs.count);
 	} else {
 		kfree(*newxattr);
 		*newxattr = NULL;
@@ -551,13 +551,13 @@ static struct ceph_inode_xattr *__get_xattr(struct ceph_inode_info *ci,
 		else if (c > 0)
 			p = &(*p)->rb_right;
 		else {
-			pr_debug("__get_xattr %s: found %.*s\n",
-				 name, xattr->val_len, xattr->val);
+			pr_debug("%s: %s: found %.*s\n",
+				 __func__, name, xattr->val_len, xattr->val);
 			return xattr;
 		}
 	}
 
-	pr_debug("__get_xattr %s: not found\n", name);
+	pr_debug("%s: %s: not found\n", __func__, name);
 
 	return NULL;
 }
@@ -602,7 +602,7 @@ static char *__copy_xattr_names(struct ceph_inode_info *ci,
 	struct ceph_inode_xattr *xattr = NULL;
 
 	p = rb_first(&ci->i_xattrs.index);
-	pr_debug("__copy_xattr_names count=%d\n", ci->i_xattrs.count);
+	pr_debug("%s: count=%d\n", __func__, ci->i_xattrs.count);
 
 	while (p) {
 		xattr = rb_entry(p, struct ceph_inode_xattr, node);
@@ -627,14 +627,14 @@ void __ceph_destroy_xattrs(struct ceph_inode_info *ci)
 
 	p = rb_first(&ci->i_xattrs.index);
 
-	pr_debug("__ceph_destroy_xattrs p=%p\n", p);
+	pr_debug("%s: p=%p\n", __func__, p);
 
 	while (p) {
 		xattr = rb_entry(p, struct ceph_inode_xattr, node);
 		tmp = p;
 		p = rb_next(tmp);
-		pr_debug("__ceph_destroy_xattrs next p=%p (%.*s)\n",
-			 p, xattr->name_len, xattr->name);
+		pr_debug("%s: next p=%p (%.*s)\n",
+			 __func__, p, xattr->name_len, xattr->name);
 		rb_erase(tmp, &ci->i_xattrs.index);
 
 		__free_xattr(xattr);
@@ -662,7 +662,8 @@ static int __build_xattrs(struct inode *inode)
 	int err = 0;
 	int i;
 
-	pr_debug("__build_xattrs() len=%d\n",
+	pr_debug("%s: len=%d\n",
+		 __func__,
 		 ci->i_xattrs.blob ? (int)ci->i_xattrs.blob->vec.iov_len : 0);
 
 	if (ci->i_xattrs.index_version >= ci->i_xattrs.version)
@@ -745,8 +746,8 @@ static int __get_required_blob_size(struct ceph_inode_info *ci, int name_size,
 	int size = 4 + ci->i_xattrs.count*(4 + 4) +
 			     ci->i_xattrs.names_size +
 			     ci->i_xattrs.vals_size;
-	pr_debug("__get_required_blob_size c=%d names.size=%d vals.size=%d\n",
-		 ci->i_xattrs.count, ci->i_xattrs.names_size,
+	pr_debug("%s: c=%d names.size=%d vals.size=%d\n",
+		 __func__, ci->i_xattrs.count, ci->i_xattrs.names_size,
 		 ci->i_xattrs.vals_size);
 
 	if (name_size)
Signature · 1 line
2.26.0
#3 lore raw

PATCH v2 3/6 net: ceph: Use generic debugging facility

In reply to Joe Perches

The dout macro duplicates the generic features of pr_debug with __FILE__ and __func__ output capability when using dynamic_debug.

Convert dout to pr_debug and remove the "pretty" print feature of dout.

Miscellanea:

o Realign arguments

---
 net/ceph/auth.c            |  21 +-
 net/ceph/auth_none.c       |   4 +-
 net/ceph/auth_x.c          |  85 ++++----
 net/ceph/buffer.c          |   6 +-
 net/ceph/ceph_common.c     |  18 +-
 net/ceph/cls_lock_client.c |  32 +--
 net/ceph/crypto.c          |   8 +-
 net/ceph/debugfs.c         |   4 +-
 net/ceph/messenger.c       | 329 +++++++++++++++----------------
 net/ceph/mon_client.c      |  99 +++++-----
 net/ceph/msgpool.c         |  14 +-
 net/ceph/osd_client.c      | 393 +++++++++++++++++++------------------
 net/ceph/osdmap.c          | 101 +++++-----
 net/ceph/pagevec.c         |  10 +-
 14 files changed, 575 insertions(+), 549 deletions(-)
net/ceph/auth.c +11 -10
index fbeee068ea14..326fc907428a 100644
@@ -41,7 +41,7 @@ struct ceph_auth_client *ceph_auth_init(const char *name, const struct ceph_cryp
 	struct ceph_auth_client *ac;
 	int ret;
 
-	dout("auth_init name '%s'\n", name);
+	pr_debug("auth_init name '%s'\n", name);
 
 	ret = -ENOMEM;
 	ac = kzalloc(sizeof(*ac), GFP_NOFS);
@@ -54,7 +54,7 @@ struct ceph_auth_client *ceph_auth_init(const char *name, const struct ceph_cryp
 		ac->name = name;
 	else
 		ac->name = CEPH_AUTH_NAME_DEFAULT;
-	dout("auth_init name %s\n", ac->name);
+	pr_debug("auth_init name %s\n", ac->name);
 	ac->key = key;
 	return ac;
 
@@ -64,7 +64,7 @@ struct ceph_auth_client *ceph_auth_init(const char *name, const struct ceph_cryp
 
 void ceph_auth_destroy(struct ceph_auth_client *ac)
 {
-	dout("auth_destroy %p\n", ac);
+	pr_debug("auth_destroy %p\n", ac);
 	if (ac->ops)
 		ac->ops->destroy(ac);
 	kfree(ac);
@@ -76,7 +76,7 @@ void ceph_auth_destroy(struct ceph_auth_client *ac)
 void ceph_auth_reset(struct ceph_auth_client *ac)
 {
 	mutex_lock(&ac->mutex);
-	dout("auth_reset %p\n", ac);
+	pr_debug("auth_reset %p\n", ac);
 	if (ac->ops && !ac->negotiating)
 		ac->ops->reset(ac);
 	ac->negotiating = true;
@@ -110,7 +110,7 @@ int ceph_auth_build_hello(struct ceph_auth_client *ac, void *buf, size_t len)
 	int ret;
 
 	mutex_lock(&ac->mutex);
-	dout("auth_build_hello\n");
+	pr_debug("auth_build_hello\n");
 	monhdr->have_version = 0;
 	monhdr->session_mon = cpu_to_le16(-1);
 	monhdr->session_mon_tid = 0;
@@ -165,7 +165,7 @@ static int ceph_build_auth_request(struct ceph_auth_client *ac,
 		       ac->ops->name);
 		goto out;
 	}
-	dout(" built request %d bytes\n", ret);
+	pr_debug("built request %d bytes\n", ret);
 	ceph_encode_32(&p, ret);
 	ret = p + ret - msg_buf;
 out:
@@ -191,7 +191,7 @@ int ceph_handle_auth_reply(struct ceph_auth_client *ac,
 	int ret = -EINVAL;
 
 	mutex_lock(&ac->mutex);
-	dout("handle_auth_reply %p %p\n", p, end);
+	pr_debug("handle_auth_reply %p %p\n", p, end);
 	ceph_decode_need(&p, end, sizeof(u32) * 3 + sizeof(u64), bad);
 	protocol = ceph_decode_32(&p);
 	result = ceph_decode_32(&p);
@@ -206,13 +206,14 @@ int ceph_handle_auth_reply(struct ceph_auth_client *ac,
 	if (p != end)
 		goto bad;
 
-	dout(" result %d '%.*s' gid %llu len %d\n", result, result_msg_len,
-	     result_msg, global_id, payload_len);
+	pr_debug("result %d '%.*s' gid %llu len %d\n",
+		 result, result_msg_len, result_msg, global_id, payload_len);
 
 	payload_end = payload + payload_len;
 
 	if (global_id && ac->global_id != global_id) {
-		dout(" set global_id %lld -> %lld\n", ac->global_id, global_id);
+		pr_debug("set global_id %lld -> %lld\n",
+			 ac->global_id, global_id);
 		ac->global_id = global_id;
 	}
 
net/ceph/auth_none.c +2 -2
index edb7042479ed..f4be840c5961 100644
@@ -53,7 +53,7 @@ static int ceph_auth_none_build_authorizer(struct ceph_auth_client *ac,
 
 	ceph_encode_64_safe(&p, end, ac->global_id, e_range);
 	au->buf_len = p - (void *)au->buf;
-	dout("%s built authorizer len %d\n", __func__, au->buf_len);
+	pr_debug("%s built authorizer len %d\n", __func__, au->buf_len);
 	return 0;
 
 e_range:
@@ -130,7 +130,7 @@ int ceph_auth_none_init(struct ceph_auth_client *ac)
 {
 	struct ceph_auth_none_info *xi;
 
-	dout("ceph_auth_none_init %p\n", ac);
+	pr_debug("ceph_auth_none_init %p\n", ac);
 	xi = kzalloc(sizeof(*xi), GFP_NOFS);
 	if (!xi)
 		return -ENOMEM;
net/ceph/auth_x.c +43 -42

236 lines not on this page · raw message

net/ceph/buffer.c +3 -3
index 5622763ad402..772288c725eb 100644
@@ -26,7 +26,7 @@ struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp)
 	kref_init(&b->kref);
 	b->alloc_len = len;
 	b->vec.iov_len = len;
-	dout("buffer_new %p\n", b);
+	pr_debug("buffer_new %p\n", b);
 	return b;
 }
 EXPORT_SYMBOL(ceph_buffer_new);
@@ -35,7 +35,7 @@ void ceph_buffer_release(struct kref *kref)
 {
 	struct ceph_buffer *b = container_of(kref, struct ceph_buffer, kref);
 
-	dout("buffer_release %p\n", b);
+	pr_debug("buffer_release %p\n", b);
 	kvfree(b->vec.iov_base);
 	kfree(b);
 }
@@ -47,7 +47,7 @@ int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end)
 
 	ceph_decode_need(p, end, sizeof(u32), bad);
 	len = ceph_decode_32(p);
-	dout("decode_buffer len %d\n", (int)len);
+	pr_debug("decode_buffer len %d\n", (int)len);
 	ceph_decode_need(p, end, len, bad);
 	*b = ceph_buffer_new(len, GFP_NOFS);
 	if (!*b)
net/ceph/ceph_common.c +9 -9
index 4e7edd707a14..1750e14115e6 100644
@@ -224,7 +224,7 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid)
 	int err = -EINVAL;
 	int d;
 
-	dout("parse_fsid '%s'\n", str);
+	pr_debug("parse_fsid '%s'\n", str);
 	tmp[2] = 0;
 	while (*str && i < 16) {
 		if (ispunct(*str)) {
@@ -244,7 +244,7 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid)
 
 	if (i == 16)
 		err = 0;
-	dout("parse_fsid ret %d got fsid %pU\n", err, fsid);
+	pr_debug("parse_fsid ret %d got fsid %pU\n", err, fsid);
 	return err;
 }
 
@@ -339,7 +339,7 @@ EXPORT_SYMBOL(ceph_alloc_options);
 
 void ceph_destroy_options(struct ceph_options *opt)
 {
-	dout("destroy_options %p\n", opt);
+	pr_debug("destroy_options %p\n", opt);
 	if (!opt)
 		return;
 
@@ -427,7 +427,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
 	struct p_log log = {.prefix = "libceph", .log = l};
 
 	token = __fs_parse(&log, ceph_parameters, param, &result);
-	dout("%s fs_parse '%s' token %d\n", __func__, param->key, token);
+	pr_debug("%s fs_parse '%s' token %d\n", __func__, param->key, token);
 	if (token < 0)
 		return token;
 
@@ -723,7 +723,7 @@ EXPORT_SYMBOL(ceph_create_client);
 
 void ceph_destroy_client(struct ceph_client *client)
 {
-	dout("destroy_client %p\n", client);
+	pr_debug("destroy_client %p\n", client);
 
 	atomic_set(&client->msgr.stopping, 1);
 
@@ -737,7 +737,7 @@ void ceph_destroy_client(struct ceph_client *client)
 	ceph_destroy_options(client->options);
 
 	kfree(client);
-	dout("destroy_client %p done\n", client);
+	pr_debug("destroy_client %p done\n", client);
 }
 EXPORT_SYMBOL(ceph_destroy_client);
 
@@ -776,7 +776,7 @@ int __ceph_open_session(struct ceph_client *client, unsigned long started)
 			return -ETIMEDOUT;
 
 		/* wait */
-		dout("mount waiting for mon_map\n");
+		pr_debug("mount waiting for mon_map\n");
 		err = wait_event_interruptible_timeout(client->auth_wq,
 			have_mon_and_osd_map(client) || (client->auth_err < 0),
 			ceph_timeout_jiffies(timeout));
@@ -799,7 +799,7 @@ int ceph_open_session(struct ceph_client *client)
 	int ret;
 	unsigned long started = jiffies;  /* note the start time */
 
-	dout("open_session start\n");
+	pr_debug("open_session start\n");
 	mutex_lock(&client->mount_mutex);
 
 	ret = __ceph_open_session(client, started);
@@ -861,7 +861,7 @@ static int __init init_ceph_lib(void)
 
 static void __exit exit_ceph_lib(void)
 {
-	dout("exit_ceph_lib\n");
+	pr_debug("exit_ceph_lib\n");
 	WARN_ON(!ceph_strings_empty());
 
 	ceph_osdc_cleanup();
net/ceph/cls_lock_client.c +16 -16
index 17447c19d937..6e6cfa1f32f1 100644
@@ -68,13 +68,13 @@ int ceph_cls_lock(struct ceph_osd_client *osdc,
 	p += sizeof(struct ceph_timespec);
 	ceph_encode_8(&p, flags);
 
-	dout("%s lock_name %s type %d cookie %s tag %s desc %s flags 0x%x\n",
-	     __func__, lock_name, type, cookie, tag, desc, flags);
+	pr_debug("%s lock_name %s type %d cookie %s tag %s desc %s flags 0x%x\n",
+		 __func__, lock_name, type, cookie, tag, desc, flags);
 	ret = ceph_osdc_call(osdc, oid, oloc, "lock", "lock",
 			     CEPH_OSD_FLAG_WRITE, lock_op_page,
 			     lock_op_buf_size, NULL, NULL);
 
-	dout("%s: status %d\n", __func__, ret);
+	pr_debug("%s: status %d\n", __func__, ret);
 	__free_page(lock_op_page);
 	return ret;
 }
@@ -117,12 +117,12 @@ int ceph_cls_unlock(struct ceph_osd_client *osdc,
 	ceph_encode_string(&p, end, lock_name, name_len);
 	ceph_encode_string(&p, end, cookie, cookie_len);
 
-	dout("%s lock_name %s cookie %s\n", __func__, lock_name, cookie);
+	pr_debug("%s lock_name %s cookie %s\n", __func__, lock_name, cookie);
 	ret = ceph_osdc_call(osdc, oid, oloc, "lock", "unlock",
 			     CEPH_OSD_FLAG_WRITE, unlock_op_page,
 			     unlock_op_buf_size, NULL, NULL);
 
-	dout("%s: status %d\n", __func__, ret);
+	pr_debug("%s: status %d\n", __func__, ret);
 	__free_page(unlock_op_page);
 	return ret;
 }
@@ -169,13 +169,13 @@ int ceph_cls_break_lock(struct ceph_osd_client *osdc,
 	ceph_encode_copy(&p, locker, sizeof(*locker));
 	ceph_encode_string(&p, end, cookie, cookie_len);
 
-	dout("%s lock_name %s cookie %s locker %s%llu\n", __func__, lock_name,
-	     cookie, ENTITY_NAME(*locker));
+	pr_debug("%s lock_name %s cookie %s locker %s%llu\n",
+		 __func__, lock_name, cookie, ENTITY_NAME(*locker));
 	ret = ceph_osdc_call(osdc, oid, oloc, "lock", "break_lock",
 			     CEPH_OSD_FLAG_WRITE, break_op_page,
 			     break_op_buf_size, NULL, NULL);
 
-	dout("%s: status %d\n", __func__, ret);
+	pr_debug("%s: status %d\n", __func__, ret);
 	__free_page(break_op_page);
 	return ret;
 }
@@ -220,13 +220,13 @@ int ceph_cls_set_cookie(struct ceph_osd_client *osdc,
 	ceph_encode_string(&p, end, tag, tag_len);
 	ceph_encode_string(&p, end, new_cookie, new_cookie_len);
 
-	dout("%s lock_name %s type %d old_cookie %s tag %s new_cookie %s\n",
-	     __func__, lock_name, type, old_cookie, tag, new_cookie);
+	pr_debug("%s lock_name %s type %d old_cookie %s tag %s new_cookie %s\n",
+		 __func__, lock_name, type, old_cookie, tag, new_cookie);
 	ret = ceph_osdc_call(osdc, oid, oloc, "lock", "set_cookie",
 			     CEPH_OSD_FLAG_WRITE, cookie_op_page,
 			     cookie_op_buf_size, NULL, NULL);
 
-	dout("%s: status %d\n", __func__, ret);
+	pr_debug("%s: status %d\n", __func__, ret);
 	__free_page(cookie_op_page);
 	return ret;
 }
@@ -273,9 +273,9 @@ static int decode_locker(void **p, void *end, struct ceph_locker *locker)
 	len = ceph_decode_32(p);
 	*p += len; /* skip description */
 
-	dout("%s %s%llu cookie %s addr %s\n", __func__,
-	     ENTITY_NAME(locker->id.name), locker->id.cookie,
-	     ceph_pr_addr(&locker->info.addr));
+	pr_debug("%s %s%llu cookie %s addr %s\n",
+		 __func__, ENTITY_NAME(locker->id.name), locker->id.cookie,
+		 ceph_pr_addr(&locker->info.addr));
 	return 0;
 }
 
@@ -361,12 +361,12 @@ int ceph_cls_lock_info(struct ceph_osd_client *osdc,
 			    get_info_op_buf_size - CEPH_ENCODING_START_BLK_LEN);
 	ceph_encode_string(&p, end, lock_name, name_len);
 
-	dout("%s lock_name %s\n", __func__, lock_name);
+	pr_debug("%s lock_name %s\n", __func__, lock_name);
 	ret = ceph_osdc_call(osdc, oid, oloc, "lock", "get_info",
 			     CEPH_OSD_FLAG_READ, get_info_op_page,
 			     get_info_op_buf_size, &reply_page, &reply_len);
 
-	dout("%s: status %d\n", __func__, ret);
+	pr_debug("%s: status %d\n", __func__, ret);
 	if (ret >= 0) {
 		p = page_address(reply_page);
 		end = p + reply_len;
net/ceph/crypto.c +4 -4
index 4f75df40fb12..c375023f8f71 100644
@@ -100,7 +100,7 @@ int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end)
 	return ret;
 
 bad:
-	dout("failed to decode crypto key\n");
+	pr_debug("failed to decode crypto key\n");
 	return -EINVAL;
 }
 
@@ -111,7 +111,7 @@ int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *inkey)
 	void *buf, *p;
 	int ret;
 
-	dout("crypto_key_unarmor %s\n", inkey);
+	pr_debug("crypto_key_unarmor %s\n", inkey);
 	buf = kmalloc(blen, GFP_NOFS);
 	if (!buf)
 		return -ENOMEM;
@@ -126,8 +126,8 @@ int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *inkey)
 	kfree(buf);
 	if (ret)
 		return ret;
-	dout("crypto_key_unarmor key %p type %d len %d\n", key,
-	     key->type, key->len);
+	pr_debug("crypto_key_unarmor key %p type %d len %d\n",
+		 key, key->type, key->len);
 	return 0;
 }
 
net/ceph/debugfs.c +2 -2
index 2110439f8a24..f07cfb595a1c 100644
@@ -411,7 +411,7 @@ void ceph_debugfs_client_init(struct ceph_client *client)
 	snprintf(name, sizeof(name), "%pU.client%lld", &client->fsid,
 		 client->monc.auth->global_id);
 
-	dout("ceph_debugfs_client_init %p %s\n", client, name);
+	pr_debug("ceph_debugfs_client_init %p %s\n", client, name);
 
 	client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir);
 
@@ -448,7 +448,7 @@ void ceph_debugfs_client_init(struct ceph_client *client)
 
 void ceph_debugfs_client_cleanup(struct ceph_client *client)
 {
-	dout("ceph_debugfs_client_cleanup %p\n", client);
+	pr_debug("ceph_debugfs_client_cleanup %p\n", client);
 	debugfs_remove(client->debugfs_options);
 	debugfs_remove(client->debugfs_osdmap);
 	debugfs_remove(client->debugfs_monmap);
net/ceph/messenger.c +165 -164

921 lines not on this page · raw message

net/ceph/mon_client.c +51 -48

299 lines not on this page · raw message

net/ceph/msgpool.c +7 -7
index e3ecb80cd182..4341c941d269 100644
@@ -17,9 +17,9 @@ static void *msgpool_alloc(gfp_t gfp_mask, void *arg)
 	msg = ceph_msg_new2(pool->type, pool->front_len, pool->max_data_items,
 			    gfp_mask, true);
 	if (!msg) {
-		dout("msgpool_alloc %s failed\n", pool->name);
+		pr_debug("msgpool_alloc %s failed\n", pool->name);
 	} else {
-		dout("msgpool_alloc %s %p\n", pool->name, msg);
+		pr_debug("msgpool_alloc %s %p\n", pool->name, msg);
 		msg->pool = pool;
 	}
 	return msg;
@@ -30,7 +30,7 @@ static void msgpool_free(void *element, void *arg)
 	struct ceph_msgpool *pool = arg;
 	struct ceph_msg *msg = element;
 
-	dout("msgpool_release %s %p\n", pool->name, msg);
+	pr_debug("msgpool_release %s %p\n", pool->name, msg);
 	msg->pool = NULL;
 	ceph_msg_put(msg);
 }
@@ -39,7 +39,7 @@ int ceph_msgpool_init(struct ceph_msgpool *pool, int type,
 		      int front_len, int max_data_items, int size,
 		      const char *name)
 {
-	dout("msgpool %s init\n", name);
+	pr_debug("msgpool %s init\n", name);
 	pool->type = type;
 	pool->front_len = front_len;
 	pool->max_data_items = max_data_items;
@@ -52,7 +52,7 @@ int ceph_msgpool_init(struct ceph_msgpool *pool, int type,
 
 void ceph_msgpool_destroy(struct ceph_msgpool *pool)
 {
-	dout("msgpool %s destroy\n", pool->name);
+	pr_debug("msgpool %s destroy\n", pool->name);
 	mempool_destroy(pool->pool);
 }
 
@@ -74,13 +74,13 @@ struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *pool, int front_len,
 	}
 
 	msg = mempool_alloc(pool->pool, GFP_NOFS);
-	dout("msgpool_get %s %p\n", pool->name, msg);
+	pr_debug("msgpool_get %s %p\n", pool->name, msg);
 	return msg;
 }
 
 void ceph_msgpool_put(struct ceph_msgpool *pool, struct ceph_msg *msg)
 {
-	dout("msgpool_put %s %p\n", pool->name, msg);
+	pr_debug("msgpool_put %s %p\n", pool->name, msg);
 
 	/* reset msg front_len; user may have changed it */
 	msg->front.iov_len = pool->front_len;
net/ceph/osd_client.c +206 -187

1,002 lines not on this page · raw message

net/ceph/osdmap.c +51 -50

177 lines not on this page · raw message

net/ceph/pagevec.c +5 -5
index 64305e7056a1..598a93254998 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.26.0

Part of the diff is not shown here. View the raw message.

#4 lore raw

PATCH v2 4/6 net: ceph: Remove embedded function names from pr_debug uses

In reply to Joe Perches

Use "%s: " ..., __func__ so function renaming changes the logging too.

---
 net/ceph/auth_none.c   |  2 +-
 net/ceph/auth_x.c      | 26 ++++++------
 net/ceph/ceph_common.c |  4 +-
 net/ceph/debugfs.c     |  2 +-
 net/ceph/messenger.c   | 91 +++++++++++++++++++++---------------------
 net/ceph/mon_client.c  |  8 ++--
 net/ceph/msgpool.c     |  4 +-
 net/ceph/osd_client.c  |  6 +--
 net/ceph/osdmap.c      | 30 +++++++-------
 9 files changed, 87 insertions(+), 86 deletions(-)
net/ceph/auth_none.c +1 -1
index f4be840c5961..d6e6e27e6899 100644
@@ -130,7 +130,7 @@ int ceph_auth_none_init(struct ceph_auth_client *ac)
 {
 	struct ceph_auth_none_info *xi;
 
-	pr_debug("ceph_auth_none_init %p\n", ac);
+	pr_debug("%s: %p\n", __func__, ac);
 	xi = kzalloc(sizeof(*xi), GFP_NOFS);
 	if (!xi)
 		return -ENOMEM;
net/ceph/auth_x.c +13 -13
index f83944ec10c3..312362515c28 100644
@@ -25,8 +25,8 @@ static int ceph_x_is_authenticated(struct ceph_auth_client *ac)
 	int need;
 
 	ceph_x_validate_tickets(ac, &need);
-	pr_debug("ceph_x_is_authenticated want=%d need=%d have=%d\n",
-		 ac->want_keys, need, xi->have_keys);
+	pr_debug("%s: want=%d need=%d have=%d\n",
+		 __func__, ac->want_keys, need, xi->have_keys);
 	return (ac->want_keys & xi->have_keys) == ac->want_keys;
 }
 
@@ -36,8 +36,8 @@ static int ceph_x_should_authenticate(struct ceph_auth_client *ac)
 	int need;
 
 	ceph_x_validate_tickets(ac, &need);
-	pr_debug("ceph_x_should_authenticate want=%d need=%d have=%d\n",
-		 ac->want_keys, need, xi->have_keys);
+	pr_debug("%s: want=%d need=%d have=%d\n",
+		 __func__, ac->want_keys, need, xi->have_keys);
 	return need != 0;
 }
 
@@ -146,7 +146,7 @@ static void remove_ticket_handler(struct ceph_auth_client *ac,
 {
 	struct ceph_x_info *xi = ac->private;
 
-	pr_debug("remove_ticket_handler %p %d\n", th, th->service);
+	pr_debug("%s: %p %d\n", __func__, th, th->service);
 	rb_erase(&th->node, &xi->ticket_handlers);
 	ceph_crypto_key_destroy(&th->session_key);
 	if (th->ticket_blob)
@@ -672,8 +672,8 @@ static int ceph_x_update_authorizer(
 
 	au = (struct ceph_x_authorizer *)auth->authorizer;
 	if (au->secret_id < th->secret_id) {
-		pr_debug("ceph_x_update_authorizer service %u secret %llu < %llu\n",
-			 au->service, au->secret_id, th->secret_id);
+		pr_debug("%s: service %u secret %llu < %llu\n",
+			 __func__, au->service, au->secret_id, th->secret_id);
 		return ceph_x_build_authorizer(ac, th, au);
 	}
 	return 0;
@@ -766,7 +766,7 @@ static void ceph_x_destroy(struct ceph_auth_client *ac)
 	struct ceph_x_info *xi = ac->private;
 	struct rb_node *p;
 
-	pr_debug("ceph_x_destroy %p\n", ac);
+	pr_debug("%s: %p\n", __func__, ac);
 	ceph_crypto_key_destroy(&xi->secret);
 
 	while ((p = rb_first(&xi->ticket_handlers)) != NULL) {
@@ -903,11 +903,11 @@ static int ceph_x_check_message_signature(struct ceph_auth_handshake *auth,
 	if (sig_check == msg->footer.sig)
 		return 0;
 	if (msg->footer.flags & CEPH_MSG_FOOTER_SIGNED)
-		pr_debug("ceph_x_check_message_signature %p has signature %llx expect %llx\n",
-			 msg, msg->footer.sig, sig_check);
+		pr_debug("%s: %p has signature %llx expect %llx\n",
+			 __func__, msg, msg->footer.sig, sig_check);
 	else
-		pr_debug("ceph_x_check_message_signature %p sender did not set CEPH_MSG_FOOTER_SIGNED\n",
-			 msg);
+		pr_debug("%s: %p sender did not set CEPH_MSG_FOOTER_SIGNED\n",
+			 __func__, msg);
 	return -EBADMSG;
 }
 
@@ -934,7 +934,7 @@ int ceph_x_init(struct ceph_auth_client *ac)
 	struct ceph_x_info *xi;
 	int ret;
 
-	pr_debug("ceph_x_init %p\n", ac);
+	pr_debug("%s: %p\n", __func__, ac);
 	ret = -ENOMEM;
 	xi = kzalloc(sizeof(*xi), GFP_NOFS);
 	if (!xi)
net/ceph/ceph_common.c +2 -2
index 1750e14115e6..e8af3bf2fdb5 100644
@@ -224,7 +224,7 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid)
 	int err = -EINVAL;
 	int d;
 
-	pr_debug("parse_fsid '%s'\n", str);
+	pr_debug("%s: '%s'\n", __func__, str);
 	tmp[2] = 0;
 	while (*str && i < 16) {
 		if (ispunct(*str)) {
@@ -244,7 +244,7 @@ static int parse_fsid(const char *str, struct ceph_fsid *fsid)
 
 	if (i == 16)
 		err = 0;
-	pr_debug("parse_fsid ret %d got fsid %pU\n", err, fsid);
+	pr_debug("%s: ret %d got fsid %pU\n", __func__, err, fsid);
 	return err;
 }
 
net/ceph/debugfs.c +1 -1
index f07cfb595a1c..4bb571f909ac 100644
@@ -411,7 +411,7 @@ void ceph_debugfs_client_init(struct ceph_client *client)
 	snprintf(name, sizeof(name), "%pU.client%lld", &client->fsid,
 		 client->monc.auth->global_id);
 
-	pr_debug("ceph_debugfs_client_init %p %s\n", client, name);
+	pr_debug("%s: %p %s\n", __func__, client, name);
 
 	client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir);
 
net/ceph/messenger.c +46 -45

275 lines not on this page · raw message

net/ceph/mon_client.c +4 -4
index 96aecc142f1c..b0e8563a2ca5 100644
@@ -241,7 +241,7 @@ static void __schedule_delayed(struct ceph_mon_client *monc)
 	else
 		delay = CEPH_MONC_PING_INTERVAL;
 
-	pr_debug("__schedule_delayed after %lu\n", delay);
+	pr_debug("%s: after %lu\n", __func__, delay);
 	mod_delayed_work(system_wq, &monc->delayed_work,
 			 round_jiffies_relative(delay));
 }
@@ -645,11 +645,11 @@ static struct ceph_msg *get_generic_reply(struct ceph_connection *con,
 	mutex_lock(&monc->mutex);
 	req = lookup_generic_request(&monc->generic_request_tree, tid);
 	if (!req) {
-		pr_debug("get_generic_reply %lld dne\n", tid);
+		pr_debug("%s: %lld dne\n", __func__, tid);
 		*skip = 1;
 		m = NULL;
 	} else {
-		pr_debug("get_generic_reply %lld got %p\n", tid, req->reply);
+		pr_debug("%s: %lld got %p\n", __func__, tid, req->reply);
 		*skip = 0;
 		m = ceph_msg_get(req->reply);
 		/*
@@ -978,7 +978,7 @@ static void delayed_work(struct work_struct *work)
 	struct ceph_mon_client *monc =
 		container_of(work, struct ceph_mon_client, delayed_work.work);
 
-	pr_debug("monc delayed_work\n");
+	pr_debug("%s: monc\n", __func__);
 	mutex_lock(&monc->mutex);
 	if (monc->hunting) {
 		pr_debug("%s continuing hunt\n", __func__);
net/ceph/msgpool.c +2 -2
index 4341c941d269..a198b869a14f 100644
@@ -17,9 +17,9 @@ static void *msgpool_alloc(gfp_t gfp_mask, void *arg)
 	msg = ceph_msg_new2(pool->type, pool->front_len, pool->max_data_items,
 			    gfp_mask, true);
 	if (!msg) {
-		pr_debug("msgpool_alloc %s failed\n", pool->name);
+		pr_debug("%s: %s failed\n", __func__, pool->name);
 	} else {
-		pr_debug("msgpool_alloc %s %p\n", pool->name, msg);
+		pr_debug("%s: %s %p\n", __func__, pool->name, msg);
 		msg->pool = pool;
 	}
 	return msg;
net/ceph/osd_client.c +3 -3
index b7bb5f2f5d61..20b5d0a853e1 100644
@@ -116,8 +116,8 @@ static int calc_layout(struct ceph_file_layout *layout, u64 off, u64 *plen,
 			 orig_len - *plen, off, *plen);
 	}
 
-	pr_debug("calc_layout objnum=%llx %llu~%llu\n",
-		 *objnum, *objoff, *objlen);
+	pr_debug("%s: objnum=%llx %llu~%llu\n",
+		 __func__, *objnum, *objoff, *objlen);
 	return 0;
 }
 
@@ -5515,7 +5515,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
 	}
 
 	m = ceph_msg_get(req->r_reply);
-	pr_debug("get_reply tid %lld %p\n", tid, m);
+	pr_debug("%s: tid %lld %p\n", __func__, tid, m);
 
 out_unlock_session:
 	mutex_unlock(&osd->lock);
net/ceph/osdmap.c +15 -15
index e47e16aeb008..dcdca28fb979 100644
@@ -67,7 +67,7 @@ static int crush_decode_list_bucket(void **p, void *end,
 				    struct crush_bucket_list *b)
 {
 	int j;
-	pr_debug("crush_decode_list_bucket %p to %p\n", *p, end);
+	pr_debug("%s: %p to %p\n", __func__, *p, end);
 	b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS);
 	if (b->item_weights == NULL)
 		return -ENOMEM;
@@ -88,7 +88,7 @@ static int crush_decode_tree_bucket(void **p, void *end,
 				    struct crush_bucket_tree *b)
 {
 	int j;
-	pr_debug("crush_decode_tree_bucket %p to %p\n", *p, end);
+	pr_debug("%s: %p to %p\n", __func__, *p, end);
 	ceph_decode_8_safe(p, end, b->num_nodes, bad);
 	b->node_weights = kcalloc(b->num_nodes, sizeof(u32), GFP_NOFS);
 	if (b->node_weights == NULL)
@@ -105,7 +105,7 @@ static int crush_decode_straw_bucket(void **p, void *end,
 				     struct crush_bucket_straw *b)
 {
 	int j;
-	pr_debug("crush_decode_straw_bucket %p to %p\n", *p, end);
+	pr_debug("%s: %p to %p\n", __func__, *p, end);
 	b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS);
 	if (b->item_weights == NULL)
 		return -ENOMEM;
@@ -126,7 +126,7 @@ static int crush_decode_straw2_bucket(void **p, void *end,
 				      struct crush_bucket_straw2 *b)
 {
 	int j;
-	pr_debug("crush_decode_straw2_bucket %p to %p\n", *p, end);
+	pr_debug("%s: %p to %p\n", __func__, *p, end);
 	b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS);
 	if (b->item_weights == NULL)
 		return -ENOMEM;
@@ -421,7 +421,7 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
 	void *start = pbyval;
 	u32 magic;
 
-	pr_debug("crush_decode %p to %p len %d\n", *p, end, (int)(end - *p));
+	pr_debug("%s: %p to %p len %d\n", __func__, *p, end, (int)(end - *p));
 
 	c = kzalloc(sizeof(*c), GFP_NOFS);
 	if (c == NULL)
@@ -466,8 +466,8 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
 			c->buckets[i] = NULL;
 			continue;
 		}
-		pr_debug("crush_decode bucket %d off %x %p to %p\n",
-			 i, (int)(*p - start), *p, end);
+		pr_debug("%s: bucket %d off %x %p to %p\n",
+			 __func__, i, (int)(*p - start), *p, end);
 
 		switch (alg) {
 		case CRUSH_BUCKET_UNIFORM:
@@ -501,8 +501,8 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
 		b->weight = ceph_decode_32(p);
 		b->size = ceph_decode_32(p);
 
-		pr_debug("crush_decode bucket size %d off %x %p to %p\n",
-			 b->size, (int)(*p - start), *p, end);
+		pr_debug("%s: bucket size %d off %x %p to %p\n",
+			 __func__, b->size, (int)(*p - start), *p, end);
 
 		b->items = kcalloc(b->size, sizeof(__s32), GFP_NOFS);
 		if (b->items == NULL)
@@ -554,14 +554,14 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
 
 		ceph_decode_32_safe(p, end, yes, bad);
 		if (!yes) {
-			pr_debug("crush_decode NO rule %d off %x %p to %p\n",
-				 i, (int)(*p - start), *p, end);
+			pr_debug("%s: NO rule %d off %x %p to %p\n",
+				 __func__, i, (int)(*p - start), *p, end);
 			c->rules[i] = NULL;
 			continue;
 		}
 
-		pr_debug("crush_decode rule %d off %x %p to %p\n",
-			 i, (int)(*p - start), *p, end);
+		pr_debug("%s: rule %d off %x %p to %p\n",
+			 __func__, i, (int)(*p - start), *p, end);
 
 		/* len */
 		ceph_decode_32_safe(p, end, yes, bad);
@@ -643,13 +643,13 @@ static struct crush_map *crush_decode(void *pbyval, void *end)
 
 done:
 	crush_finalize(c);
-	pr_debug("crush_decode success\n");
+	pr_debug("%s: success\n", __func__);
 	return c;
 
 badmem:
 	err = -ENOMEM;
 fail:
-	pr_debug("crush_decode fail %d\n", err);
+	pr_debug("%s: fail %d\n", __func__, err);
 	crush_destroy(c);
 	return ERR_PTR(err);
 
Signature · 1 line
2.26.0
#5 lore raw

PATCH v2 5/6 rbd: Use generic debugging facility

In reply to Joe Perches

The dout macro duplicates the generic features of pr_debug with __FILE__ and __func__ output capability when using dynamic_debug.

Convert dout to pr_debug and remove the "pretty" print feature of dout.

Miscellanea:

o Realign arguments

---
 drivers/block/rbd.c | 231 +++++++++++++++++++++++---------------------
 1 file changed, 120 insertions(+), 111 deletions(-)
drivers/block/rbd.c +120 -111
index d9c0e7d154f9..19696962c4f4 100644
@@ -758,7 +758,7 @@ static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts)
 	struct rbd_client *rbdc;
 	int ret = -ENOMEM;
 
-	dout("%s:\n", __func__);
+	pr_debug("%s:\n", __func__);
 	rbdc = kmalloc(sizeof(struct rbd_client), GFP_KERNEL);
 	if (!rbdc)
 		goto out_opt;
@@ -779,7 +779,7 @@ static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts)
 	list_add_tail(&rbdc->node, &rbd_client_list);
 	spin_unlock(&rbd_client_list_lock);
 
-	dout("%s: rbdc %p\n", __func__, rbdc);
+	pr_debug("%s: rbdc %p\n", __func__, rbdc);
 
 	return rbdc;
 out_client:
@@ -789,7 +789,7 @@ static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts)
 out_opt:
 	if (ceph_opts)
 		ceph_destroy_options(ceph_opts);
-	dout("%s: error %d\n", __func__, ret);
+	pr_debug("%s: error %d\n", __func__, ret);
 
 	return ERR_PTR(ret);
 }
@@ -926,7 +926,7 @@ static void rbd_client_release(struct kref *kref)
 {
 	struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref);
 
-	dout("%s: rbdc %p\n", __func__, rbdc);
+	pr_debug("%s: rbdc %p\n", __func__, rbdc);
 	spin_lock(&rbd_client_list_lock);
 	list_del(&rbdc->node);
 	spin_unlock(&rbd_client_list_lock);
@@ -1310,7 +1310,7 @@ static void zero_bvecs(struct ceph_bvec_iter *bvec_pos, u32 off, u32 bytes)
 static void rbd_obj_zero_range(struct rbd_obj_request *obj_req, u32 off,
 			       u32 bytes)
 {
-	dout("%s %p data buf %u~%u\n", __func__, obj_req, off, bytes);
+	pr_debug("%s %p data buf %u~%u\n", __func__, obj_req, off, bytes);
 
 	switch (obj_req->img_request->data_type) {
 	case OBJ_REQUEST_BIO:
@@ -1329,8 +1329,8 @@ static void rbd_obj_request_destroy(struct kref *kref);
 static void rbd_obj_request_put(struct rbd_obj_request *obj_request)
 {
 	rbd_assert(obj_request != NULL);
-	dout("%s: obj %p (was %d)\n", __func__, obj_request,
-		kref_read(&obj_request->kref));
+	pr_debug("%s: obj %p (was %d)\n",
+		 __func__, obj_request, kref_read(&obj_request->kref));
 	kref_put(&obj_request->kref, rbd_obj_request_destroy);
 }
 
@@ -1341,13 +1341,13 @@ static inline void rbd_img_obj_request_add(struct rbd_img_request *img_request,
 
 	/* Image request now owns object's original reference */
 	obj_request->img_request = img_request;
-	dout("%s: img %p obj %p\n", __func__, img_request, obj_request);
+	pr_debug("%s: img %p obj %p\n", __func__, img_request, obj_request);
 }
 
 static inline void rbd_img_obj_request_del(struct rbd_img_request *img_request,
 					struct rbd_obj_request *obj_request)
 {
-	dout("%s: img %p obj %p\n", __func__, img_request, obj_request);
+	pr_debug("%s: img %p obj %p\n", __func__, img_request, obj_request);
 	list_del(&obj_request->ex.oe_item);
 	rbd_assert(obj_request->img_request == img_request);
 	rbd_obj_request_put(obj_request);
@@ -1357,9 +1357,9 @@ static void rbd_osd_submit(struct ceph_osd_request *osd_req)
 {
 	struct rbd_obj_request *obj_req = osd_req->r_priv;
 
-	dout("%s osd_req %p for obj_req %p objno %llu %llu~%llu\n",
-	     __func__, osd_req, obj_req, obj_req->ex.oe_objno,
-	     obj_req->ex.oe_off, obj_req->ex.oe_len);
+	pr_debug("%s osd_req %p for obj_req %p objno %llu %llu~%llu\n",
+		 __func__, osd_req, obj_req, obj_req->ex.oe_objno,
+		 obj_req->ex.oe_off, obj_req->ex.oe_len);
 	ceph_osdc_start_request(osd_req->r_osdc, osd_req, false);
 }
 
@@ -1432,8 +1432,8 @@ static void rbd_osd_req_callback(struct ceph_osd_request *osd_req)
 	struct rbd_obj_request *obj_req = osd_req->r_priv;
 	int result;
 
-	dout("%s osd_req %p result %d for obj_req %p\n", __func__, osd_req,
-	     osd_req->r_result, obj_req);
+	pr_debug("%s osd_req %p result %d for obj_req %p\n",
+		 __func__, osd_req, osd_req->r_result, obj_req);
 
 	/*
 	 * Writes aren't allowed to return a data payload.  In some
@@ -1522,7 +1522,7 @@ static struct rbd_obj_request *rbd_obj_request_create(void)
 	mutex_init(&obj_request->state_mutex);
 	kref_init(&obj_request->kref);
 
-	dout("%s %p\n", __func__, obj_request);
+	pr_debug("%s %p\n", __func__, obj_request);
 	return obj_request;
 }
 
@@ -1534,7 +1534,7 @@ static void rbd_obj_request_destroy(struct kref *kref)
 
 	obj_request = container_of(kref, struct rbd_obj_request, kref);
 
-	dout("%s: obj %p\n", __func__, obj_request);
+	pr_debug("%s: obj %p\n", __func__, obj_request);
 
 	while (!list_empty(&obj_request->osd_reqs)) {
 		osd_req = list_first_entry(&obj_request->osd_reqs,
@@ -1661,7 +1661,7 @@ static void rbd_img_request_destroy(struct rbd_img_request *img_request)
 	struct rbd_obj_request *obj_request;
 	struct rbd_obj_request *next_obj_request;
 
-	dout("%s: img %p\n", __func__, img_request);
+	pr_debug("%s: img %p\n", __func__, img_request);
 
 	WARN_ON(!list_empty(&img_request->lock_item));
 	for_each_obj_request_safe(img_request, obj_request, next_obj_request)
@@ -2037,8 +2037,8 @@ static void rbd_object_map_callback(struct ceph_osd_request *osd_req)
 	struct rbd_obj_request *obj_req = osd_req->r_priv;
 	int result;
 
-	dout("%s osd_req %p result %d for obj_req %p\n", __func__, osd_req,
-	     osd_req->r_result, obj_req);
+	pr_debug("%s osd_req %p result %d for obj_req %p\n",
+		 __func__, osd_req, osd_req->r_result, obj_req);
 
 	result = rbd_object_map_update_finish(obj_req, osd_req);
 	rbd_obj_handle_request(obj_req, result);
@@ -2347,9 +2347,10 @@ static int rbd_obj_init_discard(struct rbd_obj_request *obj_req)
 		if (off >= next_off)
 			return 1;
 
-		dout("%s %p %llu~%llu -> %llu~%llu\n", __func__,
-		     obj_req, obj_req->ex.oe_off, obj_req->ex.oe_len,
-		     off, next_off - off);
+		pr_debug("%s %p %llu~%llu -> %llu~%llu\n",
+			 __func__, obj_req,
+			 obj_req->ex.oe_off, obj_req->ex.oe_len,
+			 off, next_off - off);
 		obj_req->ex.oe_off = off;
 		obj_req->ex.oe_len = next_off - off;
 	}
@@ -2661,7 +2662,7 @@ static void set_bio_pos(struct ceph_object_extent *ex, u32 bytes, void *arg)
 	    container_of(ex, struct rbd_obj_request, ex);
 	struct ceph_bio_iter *it = arg;
 
-	dout("%s objno %llu bytes %u\n", __func__, ex->oe_objno, bytes);
+	pr_debug("%s objno %llu bytes %u\n", __func__, ex->oe_objno, bytes);
 	obj_req->bio_pos = *it;
 	ceph_bio_iter_advance(it, bytes);
 }
@@ -2672,7 +2673,7 @@ static void count_bio_bvecs(struct ceph_object_extent *ex, u32 bytes, void *arg)
 	    container_of(ex, struct rbd_obj_request, ex);
 	struct ceph_bio_iter *it = arg;
 
-	dout("%s objno %llu bytes %u\n", __func__, ex->oe_objno, bytes);
+	pr_debug("%s objno %llu bytes %u\n", __func__, ex->oe_objno, bytes);
 	ceph_bio_iter_advance_step(it, bytes, ({
 		obj_req->bvec_count++;
 	}));
@@ -2685,7 +2686,7 @@ static void copy_bio_bvecs(struct ceph_object_extent *ex, u32 bytes, void *arg)
 	    container_of(ex, struct rbd_obj_request, ex);
 	struct ceph_bio_iter *it = arg;
 
-	dout("%s objno %llu bytes %u\n", __func__, ex->oe_objno, bytes);
+	pr_debug("%s objno %llu bytes %u\n", __func__, ex->oe_objno, bytes);
 	ceph_bio_iter_advance_step(it, bytes, ({
 		obj_req->bvec_pos.bvecs[obj_req->bvec_idx++] = bv;
 		obj_req->bvec_pos.iter.bi_size += bv.bv_len;
@@ -2808,8 +2809,8 @@ static bool rbd_obj_may_exist(struct rbd_obj_request *obj_req)
 		return true;
 	}
 
-	dout("%s %p objno %llu assuming dne\n", __func__, obj_req,
-	     obj_req->ex.oe_objno);
+	pr_debug("%s %p objno %llu assuming dne\n",
+		 __func__, obj_req, obj_req->ex.oe_objno);
 	return false;
 }
 
@@ -2854,8 +2855,8 @@ static int rbd_obj_read_from_parent(struct rbd_obj_request *obj_req)
 	rbd_img_capture_header(child_img_req);
 	up_read(&parent->header_rwsem);
 
-	dout("%s child_img_req %p for obj_req %p\n", __func__, child_img_req,
-	     obj_req);
+	pr_debug("%s child_img_req %p for obj_req %p\n",
+		 __func__, child_img_req, obj_req);
 
 	if (!rbd_img_is_write(img_req)) {
 		switch (img_req->data_type) {
@@ -2977,7 +2978,7 @@ static bool rbd_obj_write_is_noop(struct rbd_obj_request *obj_req)
 
 	if (!(obj_req->flags & RBD_OBJ_FLAG_MAY_EXIST) &&
 	    (obj_req->flags & RBD_OBJ_FLAG_NOOP_FOR_NONEXISTENT)) {
-		dout("%s %p noop for nonexistent\n", __func__, obj_req);
+		pr_debug("%s %p noop for nonexistent\n", __func__, obj_req);
 		return true;
 	}
 
@@ -3063,7 +3064,7 @@ static int rbd_obj_copyup_empty_snapc(struct rbd_obj_request *obj_req,
 	struct ceph_osd_request *osd_req;
 	int ret;
 
-	dout("%s obj_req %p bytes %u\n", __func__, obj_req, bytes);
+	pr_debug("%s obj_req %p bytes %u\n", __func__, obj_req, bytes);
 	rbd_assert(bytes > 0 && bytes != MODS_ONLY);
 
 	osd_req = __rbd_obj_add_osd_request(obj_req, &rbd_empty_snapc, 1);
@@ -3092,7 +3093,7 @@ static int rbd_obj_copyup_current_snapc(struct rbd_obj_request *obj_req,
 	int which = 0;
 	int ret;
 
-	dout("%s obj_req %p bytes %u\n", __func__, obj_req, bytes);
+	pr_debug("%s obj_req %p bytes %u\n", __func__, obj_req, bytes);
 
 	if (bytes != MODS_ONLY)
 		num_ops++; /* copyup */
@@ -3278,7 +3279,7 @@ static bool rbd_obj_advance_copyup(struct rbd_obj_request *obj_req, int *result)
 
 		if (is_zero_bvecs(obj_req->copyup_bvecs,
 				  rbd_obj_img_extents_bytes(obj_req))) {
-			dout("%s %p detected zeros\n", __func__, obj_req);
+			pr_debug("%s %p detected zeros\n", __func__, obj_req);
 			obj_req->flags |= RBD_OBJ_FLAG_COPYUP_ZEROS;
 		}
 
@@ -3530,7 +3531,7 @@ static int rbd_img_exclusive_lock(struct rbd_img_request *img_req)
 	 * Note the use of mod_delayed_work() in rbd_acquire_lock()
 	 * and cancel_delayed_work() in wake_lock_waiters().
 	 */
-	dout("%s rbd_dev %p queueing lock_dwork\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p queueing lock_dwork\n", __func__, rbd_dev);
 	queue_delayed_work(rbd_dev->task_wq, &rbd_dev->lock_dwork, 0);
 	return 0;
 }
@@ -3679,9 +3680,10 @@ static struct rbd_client_id rbd_get_cid(struct rbd_device *rbd_dev)
 static void rbd_set_owner_cid(struct rbd_device *rbd_dev,
 			      const struct rbd_client_id *cid)
 {
-	dout("%s rbd_dev %p %llu-%llu -> %llu-%llu\n", __func__, rbd_dev,
-	     rbd_dev->owner_cid.gid, rbd_dev->owner_cid.handle,
-	     cid->gid, cid->handle);
+	pr_debug("%s rbd_dev %p %llu-%llu -> %llu-%llu\n",
+		 __func__, rbd_dev,
+		 rbd_dev->owner_cid.gid, rbd_dev->owner_cid.handle,
+		 cid->gid, cid->handle);
 	rbd_dev->owner_cid = *cid; /* struct */
 }
 
@@ -3759,7 +3761,7 @@ static int __rbd_notify_op_lock(struct rbd_device *rbd_dev,
 	int buf_size = sizeof(buf);
 	void *p = buf;
 
-	dout("%s rbd_dev %p notify_op %d\n", __func__, rbd_dev, notify_op);
+	pr_debug("%s rbd_dev %p notify_op %d\n", __func__, rbd_dev, notify_op);
 
 	/* encode *LockPayload NotifyMessage (op + ClientId) */
 	ceph_start_encoding(&p, 2, 1, buf_size - CEPH_ENCODING_START_BLK_LEN);
@@ -3801,7 +3803,7 @@ static int rbd_request_lock(struct rbd_device *rbd_dev)
 	bool lock_owner_responded = false;
 	int ret;
 
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 
 	ret = __rbd_notify_op_lock(rbd_dev, RBD_NOTIFY_OP_REQUEST_LOCK,
 				   &reply_pages, &reply_len);
@@ -3870,7 +3872,7 @@ static void wake_lock_waiters(struct rbd_device *rbd_dev, int result)
 {
 	struct rbd_img_request *img_req;
 
-	dout("%s rbd_dev %p result %d\n", __func__, rbd_dev, result);
+	pr_debug("%s rbd_dev %p result %d\n", __func__, rbd_dev, result);
 	lockdep_assert_held_write(&rbd_dev->lock_rwsem);
 
 	cancel_delayed_work(&rbd_dev->lock_dwork);
@@ -3900,7 +3902,7 @@ static int get_lock_owner_info(struct rbd_device *rbd_dev,
 	char *lock_tag;
 	int ret;
 
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 
 	ret = ceph_cls_lock_info(osdc, &rbd_dev->header_oid,
 				 &rbd_dev->header_oloc, RBD_LOCK_NAME,
@@ -3909,7 +3911,8 @@ static int get_lock_owner_info(struct rbd_device *rbd_dev,
 		return ret;
 
 	if (*num_lockers == 0) {
-		dout("%s rbd_dev %p no lockers detected\n", __func__, rbd_dev);
+		pr_debug("%s rbd_dev %p no lockers detected\n",
+			 __func__, rbd_dev);
 		goto out;
 	}
 
@@ -3965,15 +3968,15 @@ static int find_watcher(struct rbd_device *rbd_dev,
 				.handle = cookie,
 			};
 
-			dout("%s rbd_dev %p found cid %llu-%llu\n", __func__,
-			     rbd_dev, cid.gid, cid.handle);
+			pr_debug("%s rbd_dev %p found cid %llu-%llu\n",
+				 __func__, rbd_dev, cid.gid, cid.handle);
 			rbd_set_owner_cid(rbd_dev, &cid);
 			ret = 1;
 			goto out;
 		}
 	}
 
-	dout("%s rbd_dev %p no watchers\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p no watchers\n", __func__, rbd_dev);
 	ret = 0;
 out:
 	kfree(watchers);
@@ -4058,8 +4061,8 @@ static int rbd_try_acquire_lock(struct rbd_device *rbd_dev)
 	int ret;
 
 	down_read(&rbd_dev->lock_rwsem);
-	dout("%s rbd_dev %p read lock_state %d\n", __func__, rbd_dev,
-	     rbd_dev->lock_state);
+	pr_debug("%s rbd_dev %p read lock_state %d\n",
+		 __func__, rbd_dev, rbd_dev->lock_state);
 	if (__rbd_is_lock_owner(rbd_dev)) {
 		up_read(&rbd_dev->lock_rwsem);
 		return 0;
@@ -4067,8 +4070,8 @@ static int rbd_try_acquire_lock(struct rbd_device *rbd_dev)
 
 	up_read(&rbd_dev->lock_rwsem);
 	down_write(&rbd_dev->lock_rwsem);
-	dout("%s rbd_dev %p write lock_state %d\n", __func__, rbd_dev,
-	     rbd_dev->lock_state);
+	pr_debug("%s rbd_dev %p write lock_state %d\n",
+		 __func__, rbd_dev, rbd_dev->lock_state);
 	if (__rbd_is_lock_owner(rbd_dev)) {
 		up_write(&rbd_dev->lock_rwsem);
 		return 0;
@@ -4113,11 +4116,12 @@ static void rbd_acquire_lock(struct work_struct *work)
 					    struct rbd_device, lock_dwork);
 	int ret;
 
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 again:
 	ret = rbd_try_acquire_lock(rbd_dev);
 	if (ret <= 0) {
-		dout("%s rbd_dev %p ret %d - done\n", __func__, rbd_dev, ret);
+		pr_debug("%s rbd_dev %p ret %d - done\n",
+			 __func__, rbd_dev, ret);
 		return;
 	}
 
@@ -4138,8 +4142,8 @@ static void rbd_acquire_lock(struct work_struct *work)
 		 * lock owner acked, but resend if we don't see them
 		 * release the lock
 		 */
-		dout("%s rbd_dev %p requeuing lock_dwork\n", __func__,
-		     rbd_dev);
+		pr_debug("%s rbd_dev %p requeuing lock_dwork\n",
+			 __func__, rbd_dev);
 		mod_delayed_work(rbd_dev->task_wq, &rbd_dev->lock_dwork,
 		    msecs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT * MSEC_PER_SEC));
 	}
@@ -4149,7 +4153,7 @@ static bool rbd_quiesce_lock(struct rbd_device *rbd_dev)
 {
 	bool need_wait;
 
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 	lockdep_assert_held_write(&rbd_dev->lock_rwsem);
 
 	if (rbd_dev->lock_state != RBD_LOCK_STATE_LOCKED)
@@ -4222,7 +4226,7 @@ static void maybe_kick_acquire(struct rbd_device *rbd_dev)
 {
 	bool have_requests;
 
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 	if (__rbd_is_lock_owner(rbd_dev))
 		return;
 
@@ -4230,7 +4234,8 @@ static void maybe_kick_acquire(struct rbd_device *rbd_dev)
 	have_requests = !list_empty(&rbd_dev->acquiring_list);
 	spin_unlock(&rbd_dev->lock_lists_lock);
 	if (have_requests || delayed_work_pending(&rbd_dev->lock_dwork)) {
-		dout("%s rbd_dev %p kicking lock_dwork\n", __func__, rbd_dev);
+		pr_debug("%s rbd_dev %p kicking lock_dwork\n",
+			 __func__, rbd_dev);
 		mod_delayed_work(rbd_dev->task_wq, &rbd_dev->lock_dwork, 0);
 	}
 }
@@ -4245,8 +4250,8 @@ static void rbd_handle_acquired_lock(struct rbd_device *rbd_dev, u8 struct_v,
 		cid.handle = ceph_decode_64(p);
 	}
 
-	dout("%s rbd_dev %p cid %llu-%llu\n", __func__, rbd_dev, cid.gid,
-	     cid.handle);
+	pr_debug("%s rbd_dev %p cid %llu-%llu\n",
+		 __func__, rbd_dev, cid.gid, cid.handle);
 	if (!rbd_cid_equal(&cid, &rbd_empty_cid)) {
 		down_write(&rbd_dev->lock_rwsem);
 		if (rbd_cid_equal(&cid, &rbd_dev->owner_cid)) {
@@ -4278,14 +4283,14 @@ static void rbd_handle_released_lock(struct rbd_device *rbd_dev, u8 struct_v,
 		cid.handle = ceph_decode_64(p);
 	}
 
-	dout("%s rbd_dev %p cid %llu-%llu\n", __func__, rbd_dev, cid.gid,
-	     cid.handle);
+	pr_debug("%s rbd_dev %p cid %llu-%llu\n",
+		 __func__, rbd_dev, cid.gid, cid.handle);
 	if (!rbd_cid_equal(&cid, &rbd_empty_cid)) {
 		down_write(&rbd_dev->lock_rwsem);
 		if (!rbd_cid_equal(&cid, &rbd_dev->owner_cid)) {
-			dout("%s rbd_dev %p unexpected owner, cid %llu-%llu != owner_cid %llu-%llu\n",
-			     __func__, rbd_dev, cid.gid, cid.handle,
-			     rbd_dev->owner_cid.gid, rbd_dev->owner_cid.handle);
+			pr_debug("%s rbd_dev %p unexpected owner, cid %llu-%llu != owner_cid %llu-%llu\n",
+				 __func__, rbd_dev, cid.gid, cid.handle,
+				 rbd_dev->owner_cid.gid, rbd_dev->owner_cid.handle);
 			up_write(&rbd_dev->lock_rwsem);
 			return;
 		}
@@ -4316,8 +4321,8 @@ static int rbd_handle_request_lock(struct rbd_device *rbd_dev, u8 struct_v,
 		cid.handle = ceph_decode_64(p);
 	}
 
-	dout("%s rbd_dev %p cid %llu-%llu\n", __func__, rbd_dev, cid.gid,
-	     cid.handle);
+	pr_debug("%s rbd_dev %p cid %llu-%llu\n",
+		 __func__, rbd_dev, cid.gid, cid.handle);
 	if (rbd_cid_equal(&cid, &my_cid))
 		return result;
 
@@ -4335,8 +4340,8 @@ static int rbd_handle_request_lock(struct rbd_device *rbd_dev, u8 struct_v,
 
 		if (rbd_dev->lock_state == RBD_LOCK_STATE_LOCKED) {
 			if (!rbd_dev->opts->exclusive) {
-				dout("%s rbd_dev %p queueing unlock_work\n",
-				     __func__, rbd_dev);
+				pr_debug("%s rbd_dev %p queueing unlock_work\n",
+					 __func__, rbd_dev);
 				queue_work(rbd_dev->task_wq,
 					   &rbd_dev->unlock_work);
 			} else {
@@ -4380,14 +4385,14 @@ static void __rbd_acknowledge_notify(struct rbd_device *rbd_dev,
 static void rbd_acknowledge_notify(struct rbd_device *rbd_dev, u64 notify_id,
 				   u64 cookie)
 {
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 	__rbd_acknowledge_notify(rbd_dev, notify_id, cookie, NULL);
 }
 
 static void rbd_acknowledge_notify_result(struct rbd_device *rbd_dev,
 					  u64 notify_id, u64 cookie, s32 result)
 {
-	dout("%s rbd_dev %p result %d\n", __func__, rbd_dev, result);
+	pr_debug("%s rbd_dev %p result %d\n", __func__, rbd_dev, result);
 	__rbd_acknowledge_notify(rbd_dev, notify_id, cookie, &result);
 }
 
@@ -4402,8 +4407,8 @@ static void rbd_watch_cb(void *arg, u64 notify_id, u64 cookie,
 	u32 notify_op;
 	int ret;
 
-	dout("%s rbd_dev %p cookie %llu notify_id %llu data_len %zu\n",
-	     __func__, rbd_dev, cookie, notify_id, data_len);
+	pr_debug("%s rbd_dev %p cookie %llu notify_id %llu data_len %zu\n",
+		 __func__, rbd_dev, cookie, notify_id, data_len);
 	if (data_len) {
 		ret = ceph_start_decoding(&p, end, 1, "NotifyMessage",
 					  &struct_v, &len);
@@ -4420,7 +4425,7 @@ static void rbd_watch_cb(void *arg, u64 notify_id, u64 cookie,
 		len = 0;
 	}
 
-	dout("%s rbd_dev %p notify_op %u\n", __func__, rbd_dev, notify_op);
+	pr_debug("%s rbd_dev %p notify_op %u\n", __func__, rbd_dev, notify_op);
 	switch (notify_op) {
 	case RBD_NOTIFY_OP_ACQUIRED_LOCK:
 		rbd_handle_acquired_lock(rbd_dev, struct_v, &p);
@@ -4486,7 +4491,7 @@ static int __rbd_register_watch(struct rbd_device *rbd_dev)
 	struct ceph_osd_linger_request *handle;
 
 	rbd_assert(!rbd_dev->watch_handle);
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 
 	handle = ceph_osdc_watch(osdc, &rbd_dev->header_oid,
 				 &rbd_dev->header_oloc, rbd_watch_cb,
@@ -4507,7 +4512,7 @@ static void __rbd_unregister_watch(struct rbd_device *rbd_dev)
 	int ret;
 
 	rbd_assert(rbd_dev->watch_handle);
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 
 	ret = ceph_osdc_unwatch(osdc, rbd_dev->watch_handle);
 	if (ret)
@@ -4536,7 +4541,7 @@ static int rbd_register_watch(struct rbd_device *rbd_dev)
 
 static void cancel_tasks_sync(struct rbd_device *rbd_dev)
 {
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 
 	cancel_work_sync(&rbd_dev->acquired_lock_work);
 	cancel_work_sync(&rbd_dev->released_lock_work);
@@ -4602,7 +4607,7 @@ static void rbd_reregister_watch(struct work_struct *work)
 					    struct rbd_device, watch_dwork);
 	int ret;
 
-	dout("%s rbd_dev %p\n", __func__, rbd_dev);
+	pr_debug("%s rbd_dev %p\n", __func__, rbd_dev);
 
 	mutex_lock(&rbd_dev->watch_mutex);
 	if (rbd_dev->watch_state != RBD_WATCH_STATE_ERROR) {
@@ -4713,7 +4718,7 @@ static void rbd_queue_workfn(struct work_struct *work)
 
 	/* Ignore/skip any zero-length requests */
 	if (!length) {
-		dout("%s: zero-length request\n", __func__);
+		pr_debug("%s: zero-length request\n", __func__);
 		result = 0;
 		goto err_img_request;
 	}
@@ -4732,8 +4737,9 @@ static void rbd_queue_workfn(struct work_struct *work)
 		goto err_img_request;
 	}
 
-	dout("%s rbd_dev %p img_req %p %s %llu~%llu\n", __func__, rbd_dev,
-	     img_request, obj_op_name(op_type), offset, length);
+	pr_debug("%s rbd_dev %p img_req %p %s %llu~%llu\n",
+		 __func__, rbd_dev, img_request,
+		 obj_op_name(op_type), offset, length);
 
 	if (op_type == OBJ_OP_DISCARD || op_type == OBJ_OP_ZEROOUT)
 		result = rbd_img_fill_nodata(img_request, offset, length);
@@ -4919,7 +4925,8 @@ static void rbd_dev_update_size(struct rbd_device *rbd_dev)
 	if (test_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags) &&
 	    !test_bit(RBD_DEV_FLAG_REMOVING, &rbd_dev->flags)) {
 		size = (sector_t)rbd_dev->mapping.size / SECTOR_SIZE;
-		dout("setting size to %llu sectors", (unsigned long long)size);
+		pr_debug("setting size to %llu sectors\n",
+			 (unsigned long long)size);
 		set_capacity(rbd_dev->disk, size);
 		revalidate_disk(rbd_dev->disk);
 	}
@@ -5454,7 +5461,8 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc,
 	/* we have a ref from do_rbd_add() */
 	__module_get(THIS_MODULE);
 
-	dout("%s rbd_dev %p dev_id %d\n", __func__, rbd_dev, rbd_dev->dev_id);
+	pr_debug("%s rbd_dev %p dev_id %d\n",
+		 __func__, rbd_dev, rbd_dev->dev_id);
 	return rbd_dev;
 
 fail_dev_id:
@@ -5489,7 +5497,7 @@ static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
 				  &rbd_dev->header_oloc, "get_size",
 				  &snapid, sizeof(snapid),
 				  &size_buf, sizeof(size_buf));
-	dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
+	pr_debug("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
 	if (ret < 0)
 		return ret;
 	if (ret < sizeof (size_buf))
@@ -5497,13 +5505,13 @@ static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
 
 	if (order) {
 		*order = size_buf.order;
-		dout("  order %u", (unsigned int)*order);
+		pr_debug("order %u\n", (unsigned int)*order);
 	}
 	*snap_size = le64_to_cpu(size_buf.size);
 
-	dout("  snap_id 0x%016llx snap_size = %llu\n",
-		(unsigned long long)snap_id,
-		(unsigned long long)*snap_size);
+	pr_debug("snap_id 0x%016llx snap_size = %llu\n",
+		 (unsigned long long)snap_id,
+		 (unsigned long long)*snap_size);
 
 	return 0;
 }
@@ -5531,7 +5539,7 @@ static int rbd_dev_v2_object_prefix(struct rbd_device *rbd_dev)
 	ret = rbd_obj_method_sync(rbd_dev, &rbd_dev->header_oid,
 				  &rbd_dev->header_oloc, "get_object_prefix",
 				  NULL, 0, reply_buf, size);
-	dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
+	pr_debug("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
 	if (ret < 0)
 		goto out;
 
@@ -5544,7 +5552,7 @@ static int rbd_dev_v2_object_prefix(struct rbd_device *rbd_dev)
 		ret = PTR_ERR(rbd_dev->header.object_prefix);
 		rbd_dev->header.object_prefix = NULL;
 	} else {
-		dout("  object_prefix = %s\n", rbd_dev->header.object_prefix);
+		pr_debug("object_prefix = %s\n", rbd_dev->header.object_prefix);
 	}
 out:
 	kfree(reply_buf);
@@ -5573,7 +5581,7 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
 				  &rbd_dev->header_oloc, "get_features",
 				  &features_in, sizeof(features_in),
 				  &features_buf, sizeof(features_buf));
-	dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
+	pr_debug("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
 	if (ret < 0)
 		return ret;
 	if (ret < sizeof (features_buf))
@@ -5588,10 +5596,10 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
 
 	*snap_features = le64_to_cpu(features_buf.features);
 
-	dout("  snap_id 0x%016llx features = 0x%016llx incompat = 0x%016llx\n",
-		(unsigned long long)snap_id,
-		(unsigned long long)*snap_features,
-		(unsigned long long)le64_to_cpu(features_buf.incompat));
+	pr_debug("snap_id 0x%016llx features = 0x%016llx incompat = 0x%016llx\n",
+		 (unsigned long long)snap_id,
+		 (unsigned long long)*snap_features,
+		 (unsigned long long)le64_to_cpu(features_buf.incompat));
 
 	return 0;
 }
@@ -5795,9 +5803,9 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev)
 	if (ret)
 		goto out_err;
 
-	dout("%s pool_id %llu pool_ns %s image_id %s snap_id %llu has_overlap %d overlap %llu\n",
-	     __func__, pii.pool_id, pii.pool_ns, pii.image_id, pii.snap_id,
-	     pii.has_overlap, pii.overlap);
+	pr_debug("%s pool_id %llu pool_ns %s image_id %s snap_id %llu has_overlap %d overlap %llu\n",
+		 __func__, pii.pool_id, pii.pool_ns, pii.image_id, pii.snap_id,
+		 pii.has_overlap, pii.overlap);
 
 	if (pii.pool_id == CEPH_NOPOOL || !pii.has_overlap) {
 		/*
@@ -5890,7 +5898,7 @@ static int rbd_dev_v2_striping_info(struct rbd_device *rbd_dev)
 	ret = rbd_obj_method_sync(rbd_dev, &rbd_dev->header_oid,
 				&rbd_dev->header_oloc, "get_stripe_unit_count",
 				NULL, 0, &striping_info_buf, size);
-	dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
+	pr_debug("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
 	if (ret < 0)
 		return ret;
 	if (ret < size)
@@ -5963,7 +5971,8 @@ static char *rbd_dev_image_name(struct rbd_device *rbd_dev)
 	if (IS_ERR(image_name))
 		image_name = NULL;
 	else
-		dout("%s: name is %s len is %zd\n", __func__, image_name, len);
+		pr_debug("%s: name is %s len is %zd\n",
+			 __func__, image_name, len);
 out:
 	kfree(reply_buf);
 	kfree(image_id);
@@ -6135,7 +6144,7 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
 	ret = rbd_obj_method_sync(rbd_dev, &rbd_dev->header_oid,
 				  &rbd_dev->header_oloc, "get_snapcontext",
 				  NULL, 0, reply_buf, size);
-	dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
+	pr_debug("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
 	if (ret < 0)
 		goto out;
 
@@ -6172,8 +6181,8 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev)
 	ceph_put_snap_context(rbd_dev->header.snapc);
 	rbd_dev->header.snapc = snapc;
 
-	dout("  snap context seq = %llu, snap_count = %u\n",
-		(unsigned long long)seq, (unsigned int)snap_count);
+	pr_debug("  snap context seq = %llu, snap_count = %u\n",
+		 (unsigned long long)seq, (unsigned int)snap_count);
 out:
 	kfree(reply_buf);
 
@@ -6200,7 +6209,7 @@ static const char *rbd_dev_v2_snap_name(struct rbd_device *rbd_dev,
 	ret = rbd_obj_method_sync(rbd_dev, &rbd_dev->header_oid,
 				  &rbd_dev->header_oloc, "get_snapshot_name",
 				  &snapid, sizeof(snapid), reply_buf, size);
-	dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
+	pr_debug("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
 	if (ret < 0) {
 		snap_name = ERR_PTR(ret);
 		goto out;
@@ -6212,8 +6221,8 @@ static const char *rbd_dev_v2_snap_name(struct rbd_device *rbd_dev,
 	if (IS_ERR(snap_name))
 		goto out;
 
-	dout("  snap_id 0x%016llx snap_name = %s\n",
-		(unsigned long long)snap_id, snap_name);
+	pr_debug("  snap_id 0x%016llx snap_name = %s\n",
+		 (unsigned long long)snap_id, snap_name);
 out:
 	kfree(reply_buf);
 
@@ -6320,7 +6329,7 @@ static int rbd_parse_param(struct fs_parameter *param,
 		return ret;
 
 	token = __fs_parse(&log, rbd_parameters, param, &result);
-	dout("%s fs_parse '%s' token %d\n", __func__, param->key, token);
+	pr_debug("%s fs_parse '%s' token %d\n", __func__, param->key, token);
 	if (token < 0) {
 		if (token == -ENOPARAM)
 			return inval_plog(&log, "Unknown parameter '%s'",
@@ -6409,7 +6418,7 @@ static int rbd_parse_options(char *options, struct rbd_parse_opts_ctx *pctx)
 	char *key;
 	int ret = 0;
 
-	dout("%s '%s'\n", __func__, options);
+	pr_debug("%s '%s'\n", __func__, options);
 	while ((key = strsep(&options, ",")) != NULL) {
 		if (*key) {
 			struct fs_parameter param = {
@@ -6692,7 +6701,7 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
 	if (ret)
 		return ret;
 
-	dout("rbd id object name is %s\n", oid.name);
+	pr_debug("rbd id object name is %s\n", oid.name);
 
 	/* Response will be an encoded string, which includes a length */
 	size = sizeof (__le32) + RBD_IMAGE_ID_LEN_MAX;
@@ -6707,7 +6716,7 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
 	ret = rbd_obj_method_sync(rbd_dev, &oid, &rbd_dev->header_oloc,
 				  "get_id", NULL, 0,
 				  response, size);
-	dout("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
+	pr_debug("%s: rbd_obj_method_sync returned %d\n", __func__, ret);
 	if (ret == -ENOENT) {
 		image_id = kstrdup("", GFP_KERNEL);
 		ret = image_id ? 0 : -ENOMEM;
@@ -6725,7 +6734,7 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
 
 	if (!ret) {
 		rbd_dev->spec->image_id = image_id;
-		dout("image_id is %s\n", image_id);
+		pr_debug("image_id is %s\n", image_id);
 	}
 out:
 	kfree(response);
@@ -7031,8 +7040,8 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
 	if (ret)
 		goto err_out_probe;
 
-	dout("discovered format %u image, header name is %s\n",
-		rbd_dev->image_format, rbd_dev->header_oid.name);
+	pr_debug("discovered format %u image, header name is %s\n",
+		 rbd_dev->image_format, rbd_dev->header_oid.name);
 	return 0;
 
 err_out_probe:
Signature · 1 line
2.26.0
#6 lore raw

PATCH v2 6/6 ceph_debug: Remove now unused dout macro definitions

In reply to Joe Perches

All the uses have be converted to pr_debug, so remove these.

---
 include/linux/ceph/ceph_debug.h | 30 ------------------------------
 1 file changed, 30 deletions(-)
include/linux/ceph/ceph_debug.h +0 -30
index d5a5da838caf..81c0d7195f1e 100644
@@ -6,34 +6,4 @@
 
 #include <linux/string.h>
 
-#ifdef CONFIG_CEPH_LIB_PRETTYDEBUG
-
-/*
- * wrap pr_debug to include a filename:lineno prefix on each line.
- * this incurs some overhead (kernel size and execution time) due to
- * the extra function call at each call site.
- */
-
-# if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
-#  define dout(fmt, ...)						\
-	pr_debug("%.*s %12.12s:%-4d : " fmt,				\
-		 8 - (int)sizeof(KBUILD_MODNAME), "    ",		\
-		 kbasename(__FILE__), __LINE__, ##__VA_ARGS__)
-# else
-/* faux printk call just to see any compiler warnings. */
-#  define dout(fmt, ...)	do {				\
-		if (0)						\
-			printk(KERN_DEBUG fmt, ##__VA_ARGS__);	\
-	} while (0)
-# endif
-
-#else
-
-/*
- * or, just wrap pr_debug
- */
-# define dout(fmt, ...)	pr_debug(" " fmt, ##__VA_ARGS__)
-
-#endif
-
 #endif
Signature · 1 line
2.26.0
maintainer
#7 lore raw

Re: [PATCH V2 6/6] ceph_debug: Remove now unused dout macro definitions

Quoted 48 lines · Joe Perches

All the uses have be converted to pr_debug, so remove these.

---
 include/linux/ceph/ceph_debug.h | 30 ------------------------------
 1 file changed, 30 deletions(-)
include/linux/ceph/ceph_debug.h +0 -31
index d5a5da838caf..81c0d7195f1e 100644
@@ -6,34 +6,4 @@
 
 #include <linux/string.h>
 
-#ifdef CONFIG_CEPH_LIB_PRETTYDEBUG
-
-/*
- * wrap pr_debug to include a filename:lineno prefix on each line.
- * this incurs some overhead (kernel size and execution time) due to
- * the extra function call at each call site.
- */
-
-# if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
-#  define dout(fmt, ...)                                               \
-       pr_debug("%.*s %12.12s:%-4d : " fmt,                            \
-                8 - (int)sizeof(KBUILD_MODNAME), "    ",               \
-                kbasename(__FILE__), __LINE__, ##__VA_ARGS__)
-# else
-/* faux printk call just to see any compiler warnings. */
-#  define dout(fmt, ...)       do {                            \
-               if (0)                                          \
-                       printk(KERN_DEBUG fmt, ##__VA_ARGS__);  \
-       } while (0)
-# endif
-
-#else
-
-/*
- * or, just wrap pr_debug
- */
-# define dout(fmt, ...)        pr_debug(" " fmt, ##__VA_ARGS__)
-
-#endif
-
 #endif
--
Quoted 2 lines

2.26.0

Hi Joe,

Yeah, roughly the same thing can be achieved with +flmp instead of just +p with PRETTYDEBUG, but PRETTYDEBUG formatting actually predates those flags and some of us still use bash scripts from back then. We also have a few guides and blog entries with just +p, but that's not a big deal.

I'd be fine with removing CONFIG_CEPH_LIB_PRETTYDEBUG since it's disabled by default and in all major distributions, but I'm not a fan of a wide-sweeping dout -> pr_debug change. We do extensive backporting to older kernels and these kind of changes are rather annoying. dout is shorter to type too ;)

I know that in some cases the function names are outdated or duplicated, but I prefer fixing them gradually, along with actual code changes in the area (i.e. similar to whitespace).

Thanks,

Ilya

#8 lore raw

Re: [PATCH V2 6/6] ceph_debug: Remove now unused dout macro definitions

Quoted 2 lines · Ilya Dryomov
Quoted 1 line · Joe Perches

All the uses have be converted to pr_debug, so remove these.

[]

Quoted 1 line

Hi Joe,

Hi Ilya.

Quoted 5 lines

Yeah, roughly the same thing can be achieved with +flmp instead of just +p with PRETTYDEBUG, but PRETTYDEBUG formatting actually predates those flags and some of us still use bash scripts from back then. We also have a few guides and blog entries with just +p, but that's not a big deal.

btw: I sent a patch adding a +F flag to emit
the kbasename(FILE) to dynamic debug output.

https://lore.kernel.org/lkml/[email protected]/