From: majianpeng <majianpeng@gmail.com>
To: sage <sage@inktank.com>
Cc: ceph-devel <ceph-devel@vger.kernel.org>
Subject: [PATCH] cephfs: Add a function which print pg name using cephfs.
Date: Mon, 5 Aug 2013 10:50:40 +0800 [thread overview]
Message-ID: <201308051050384970885@gmail.com> (raw)
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
reply other threads:[~2013-08-05 2:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201308051050384970885@gmail.com \
--to=majianpeng@gmail.com \
--cc=ceph-devel@vger.kernel.org \
--cc=sage@inktank.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.