summaryrefslogtreecommitdiff
path: root/src/ceph-rbdnamer
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@dreamhost.com>2011-11-28 17:24:25 -0800
committerJosh Durgin <josh.durgin@dreamhost.com>2011-12-06 10:26:24 -0800
commit16a211bfee521bd0d26c957c15c07c129edfb138 (patch)
tree9f776d72eb6d45b80512412f2a1011bcae67df98 /src/ceph-rbdnamer
parent274f4890dc838e64eaad83df6c8c326549ac60c3 (diff)
downloadceph-16a211bfee521bd0d26c957c15c07c129edfb138.tar.gz
ceph-rbdnamer: include snapshot name if present
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Diffstat (limited to 'src/ceph-rbdnamer')
-rwxr-xr-xsrc/ceph-rbdnamer11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ceph-rbdnamer b/src/ceph-rbdnamer
index 4d58d39d69f..49350a7f0d0 100755
--- a/src/ceph-rbdnamer
+++ b/src/ceph-rbdnamer
@@ -1,5 +1,10 @@
#!/bin/sh
-echo -n `cat /sys/devices/rbd/$1/pool`
-echo -n " "
-echo -n `cat /sys/devices/rbd/$1/name`
+POOL=`cat /sys/devices/rbd/$1/pool`
+IMAGE=`cat /sys/devices/rbd/$1/name`
+SNAP=`cat /sys/devices/rbd/$1/current_snap`
+if [ "$SNAP" = "-" ]; then
+ echo -n "$POOL $IMAGE"
+else
+ echo -n "$POOL $IMAGE@$SNAP"
+fi