summaryrefslogtreecommitdiffstats
path: root/fs/ceph/decode.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-11-19 01:19:57 +0100
committerSage Weil <sage@newdream.net>2009-11-19 01:19:57 +0100
commit4e7a5dcd1bbab6560fbc8ada29a840e7a20ed7bc (patch)
treea77e9b4563022340361ca673ef2e1beebb538e2f /fs/ceph/decode.h
parentceph: handle errors during osd client init (diff)
downloadlinux-4e7a5dcd1bbab6560fbc8ada29a840e7a20ed7bc.tar.xz
linux-4e7a5dcd1bbab6560fbc8ada29a840e7a20ed7bc.zip
ceph: negotiate authentication protocol; implement AUTH_NONE protocol
When we open a monitor session, we send an initial AUTH message listing the auth protocols we support, our entity name, and (possibly) a previously assigned global_id. The monitor chooses a protocol and responds with an initial message. Initially implement AUTH_NONE, a dummy protocol that provides no security, but works within the new framework. It generates 'authorizers' that are used when connecting to (mds, osd) services that simply state our entity name and global_id. This is a wire protocol change. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/decode.h')
-rw-r--r--fs/ceph/decode.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ceph/decode.h b/fs/ceph/decode.h
index a382aecc55bb..10de84896244 100644
--- a/fs/ceph/decode.h
+++ b/fs/ceph/decode.h
@@ -98,6 +98,7 @@ static inline void ceph_encode_addr(struct ceph_entity_addr *a)
static inline void ceph_decode_addr(struct ceph_entity_addr *a)
{
a->in_addr.ss_family = ntohs(a->in_addr.ss_family);
+ WARN_ON(a->in_addr.ss_family == 512);
}
/*
@@ -123,6 +124,11 @@ static inline void ceph_encode_8(void **p, u8 v)
*(u8 *)*p = v;
(*p)++;
}
+static inline void ceph_encode_copy(void **p, const void *s, int len)
+{
+ memcpy(*p, s, len);
+ *p += len;
+}
/*
* filepath, string encoders