From: Sage Weil <sage@newdream.net>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-scsi@vger.kernel.org
Cc: ceph-devel@vger.kernel.org, hch@lst.de,
akpm@linux-foundation.org, yehuda@hq.newdream.net,
Sage Weil <sage@newdream.net>
Subject: [PATCH 1/8] ceph-rbd: lookup pool in osdmap by name
Date: Fri, 13 Aug 2010 10:40:33 -0700 [thread overview]
Message-ID: <1281721240-26130-2-git-send-email-sage@newdream.net> (raw)
In-Reply-To: <1281721240-26130-1-git-send-email-sage@newdream.net>
From: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
---
fs/ceph/osdmap.c | 13 +++++++++++++
fs/ceph/osdmap.h | 2 ++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/fs/ceph/osdmap.c b/fs/ceph/osdmap.c
index e31f118..3ccd117 100644
--- a/fs/ceph/osdmap.c
+++ b/fs/ceph/osdmap.c
@@ -417,6 +417,19 @@ static struct ceph_pg_pool_info *__lookup_pg_pool(struct rb_root *root, int id)
return NULL;
}
+int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name)
+{
+ struct rb_node *rbp;
+
+ for (rbp = rb_first(&map->pg_pools); rbp; rbp = rb_next(rbp)) {
+ struct ceph_pg_pool_info *pi =
+ rb_entry(rbp, struct ceph_pg_pool_info, node);
+ if (pi->name && strcmp(pi->name, name) == 0)
+ return pi->id;
+ }
+ return -ENOENT;
+}
+
static void __remove_pg_pool(struct rb_root *root, struct ceph_pg_pool_info *pi)
{
rb_erase(&pi->node, root);
diff --git a/fs/ceph/osdmap.h b/fs/ceph/osdmap.h
index 970b547..a592b21 100644
--- a/fs/ceph/osdmap.h
+++ b/fs/ceph/osdmap.h
@@ -125,4 +125,6 @@ extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap,
struct ceph_pg pgid);
+extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);
+
#endif
--
1.7.0
next prev parent reply other threads:[~2010-08-13 17:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-13 17:40 [PATCH 0/8] rados block device and ceph refactor Sage Weil
2010-08-13 17:40 ` Sage Weil [this message]
2010-08-13 17:40 ` [PATCH 2/8] ceph-rbd: refactor osdc requests creation functions Sage Weil
2010-08-13 17:40 ` [PATCH 3/8] ceph-rbd: messenger and osdc changes for rbd Sage Weil
2010-08-13 17:40 ` [PATCH 4/8] ceph-rbd: enable creation of clients that don't need mds Sage Weil
2010-08-13 17:40 ` [PATCH 5/8] ceph-rbd: refactor mount related functions, add helpers Sage Weil
2010-08-13 17:40 ` [PATCH 6/8] ceph-rbd: osdc support for osd call and rollback operations Sage Weil
2010-08-13 17:40 ` [PATCH 8/8] rbd: introduce rados block device (rbd), based on libceph Sage Weil
2010-08-14 2:44 ` Randy Dunlap
2010-08-14 3:29 ` Sage Weil
2010-08-14 14:23 ` Randy Dunlap
2010-08-13 22:37 ` [PATCH 0/8] rados block device and ceph refactor Randy Dunlap
2010-08-13 23:11 ` Sage Weil
2010-08-14 2:32 ` Randy Dunlap
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=1281721240-26130-2-git-send-email-sage@newdream.net \
--to=sage@newdream.net \
--cc=akpm@linux-foundation.org \
--cc=ceph-devel@vger.kernel.org \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=yehuda@hq.newdream.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).