All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cephfs: Add a function which print pg name using cephfs.
@ 2013-08-05  2:50 majianpeng
  0 siblings, 0 replies; only message in thread
From: majianpeng @ 2013-08-05  2:50 UTC (permalink / raw)
  To: sage; +Cc: ceph-devel

As 'cephfs map' print, it can print pgs.So add this function.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 src/cephfs.cc      | 9 +++++----
 src/client/ioctl.h | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/cephfs.cc b/src/cephfs.cc
index f25d02a..aaa6ad4 100644
--- a/src/cephfs.cc
+++ b/src/cephfs.cc
@@ -91,6 +91,7 @@ int main (int argc, char **argv) {
     cout << "location.object_no:    " << location.object_no << endl;
     cout << "location.object_size:  " << location.object_size << endl;
     cout << "location.object_name:  " << location.object_name << endl;
+    cout << "location.pg_name:      " << location.pg_name << endl;
     cout << "location.block_offset: " << location.block_offset << endl;
     cout << "location.block_size:   " << location.block_size << endl;
     cout << "location.osd:          " << location.osd << endl;
@@ -128,8 +129,8 @@ int main (int argc, char **argv) {
       return 1;
     }
 
-    printf("%15s  %24s  %12s  %12s  %s\n",
-	   "FILE OFFSET", "OBJECT", "OFFSET", "LENGTH", "OSD");
+    printf("%15s  %24s  %12s  %12s  %12s  %s\n",
+	   "FILE OFFSET", "OBJECT", "PG", "OFFSET", "LENGTH", "OSD");
 
     for (long long off = 0; off < st.st_size; off += layout.stripe_unit) {
       struct ceph_ioctl_dataloc location;
@@ -140,8 +141,8 @@ int main (int argc, char **argv) {
 	     << (err == -1 ? strerror(errno) : strerror(-err)) << endl;
 	return 1;
       }
-      printf("%15lld  %24s  %12lld  %12lld  %d\n",
-	     off, location.object_name, (long long)location.object_offset,
+      printf("%15lld  %24s  %12s  %12lld  %12lld  %3d\n",
+	     off, location.object_name, location.pg_name, (long long)location.object_offset,
 	     (long long)location.block_size, (int)location.osd);
     }
 
diff --git a/src/client/ioctl.h b/src/client/ioctl.h
index c15d334..963ee84 100644
--- a/src/client/ioctl.h
+++ b/src/client/ioctl.h
@@ -36,6 +36,7 @@ struct ceph_ioctl_dataloc {
 	__u64 object_no;             /* out: object # */
 	__u64 object_size;           /* out: object size */
 	char object_name[64];        /* out: object name */
+	char pg_name[32];	     /* out: pg name */
 	__u64 block_offset;          /* out: offset in block */
 	__u64 block_size;            /* out: block length */
 	__s64 osd;                   /* out: osd # */
-- 
1.8.3.rc1.44.gb387c77


Thanks!
Jianpeng Ma

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-05  2:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05  2:50 [PATCH] cephfs: Add a function which print pg name using cephfs majianpeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.