aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-17 19:03:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-17 19:03:12 -0500
commit57666509b70030a9483d13222bfec8eec5db07df (patch)
tree1e0021c2aabc2ce8832e8c816e2aa94b0b77a323 /include/linux
parent87c31b39abcb6fb6bd7d111200c9627a594bf6a9 (diff)
parent0aeff37abada9f8c08d2b10481a43d3ae406c823 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull ceph updates from Sage Weil: "The big item here is support for inline data for CephFS and for message signatures from Zheng. There are also several bug fixes, including interrupted flock request handling, 0-length xattrs, mksnap, cached readdir results, and a message version compat field. Finally there are several cleanups from Ilya, Dan, and Markus. Note that there is another series coming soon that fixes some bugs in the RBD 'lingering' requests, but it isn't quite ready yet" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (27 commits) ceph: fix setting empty extended attribute ceph: fix mksnap crash ceph: do_sync is never initialized libceph: fixup includes in pagelist.h ceph: support inline data feature ceph: flush inline version ceph: convert inline data to normal data before data write ceph: sync read inline data ceph: fetch inline data when getting Fcr cap refs ceph: use getattr request to fetch inline data ceph: add inline data to pagecache ceph: parse inline data in MClientReply and MClientCaps libceph: specify position of extent operation libceph: add CREATE osd operation support libceph: add SETXATTR/CMPXATTR osd operations support rbd: don't treat CEPH_OSD_OP_DELETE as extent op ceph: remove unused stringification macros libceph: require cephx message signature by default ceph: introduce global empty snap context ceph: message versioning fixes ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ceph/auth.h26
-rw-r--r--include/linux/ceph/buffer.h3
-rw-r--r--include/linux/ceph/ceph_features.h1
-rw-r--r--include/linux/ceph/ceph_fs.h10
-rw-r--r--include/linux/ceph/libceph.h2
-rw-r--r--include/linux/ceph/messenger.h9
-rw-r--r--include/linux/ceph/msgr.h11
-rw-r--r--include/linux/ceph/osd_client.h13
-rw-r--r--include/linux/ceph/pagelist.h4
9 files changed, 70 insertions, 9 deletions
diff --git a/include/linux/ceph/auth.h b/include/linux/ceph/auth.h
index 5f3386844134..260d78b587c4 100644
--- a/include/linux/ceph/auth.h
+++ b/include/linux/ceph/auth.h
@@ -13,6 +13,7 @@
13 13
14struct ceph_auth_client; 14struct ceph_auth_client;
15struct ceph_authorizer; 15struct ceph_authorizer;
16struct ceph_msg;
16 17
17struct ceph_auth_handshake { 18struct ceph_auth_handshake {
18 struct ceph_authorizer *authorizer; 19 struct ceph_authorizer *authorizer;
@@ -20,6 +21,10 @@ struct ceph_auth_handshake {
20 size_t authorizer_buf_len; 21 size_t authorizer_buf_len;
21 void *authorizer_reply_buf; 22 void *authorizer_reply_buf;
22 size_t authorizer_reply_buf_len; 23 size_t authorizer_reply_buf_len;
24 int (*sign_message)(struct ceph_auth_handshake *auth,
25 struct ceph_msg *msg);
26 int (*check_message_signature)(struct ceph_auth_handshake *auth,
27 struct ceph_msg *msg);
23}; 28};
24 29
25struct ceph_auth_client_ops { 30struct ceph_auth_client_ops {
@@ -66,6 +71,11 @@ struct ceph_auth_client_ops {
66 void (*reset)(struct ceph_auth_client *ac); 71 void (*reset)(struct ceph_auth_client *ac);
67 72
68 void (*destroy)(struct ceph_auth_client *ac); 73 void (*destroy)(struct ceph_auth_client *ac);
74
75 int (*sign_message)(struct ceph_auth_handshake *auth,
76 struct ceph_msg *msg);
77 int (*check_message_signature)(struct ceph_auth_handshake *auth,
78 struct ceph_msg *msg);
69}; 79};
70 80
71struct ceph_auth_client { 81struct ceph_auth_client {
@@ -113,4 +123,20 @@ extern int ceph_auth_verify_authorizer_reply(struct ceph_auth_client *ac,
113extern void ceph_auth_invalidate_authorizer(struct ceph_auth_client *ac, 123extern void ceph_auth_invalidate_authorizer(struct ceph_auth_client *ac,
114 int peer_type); 124 int peer_type);
115 125
126static inline int ceph_auth_sign_message(struct ceph_auth_handshake *auth,
127 struct ceph_msg *msg)
128{
129 if (auth->sign_message)
130 return auth->sign_message(auth, msg);
131 return 0;
132}
133
134static inline
135int ceph_auth_check_message_signature(struct ceph_auth_handshake *auth,
136 struct ceph_msg *msg)
137{
138 if (auth->check_message_signature)
139 return auth->check_message_signature(auth, msg);
140 return 0;
141}
116#endif 142#endif
diff --git a/include/linux/ceph/buffer.h b/include/linux/ceph/buffer.h
index 07ad423cc37f..07ca15e76100 100644
--- a/include/linux/ceph/buffer.h
+++ b/include/linux/ceph/buffer.h
@@ -10,8 +10,7 @@
10/* 10/*
11 * a simple reference counted buffer. 11 * a simple reference counted buffer.
12 * 12 *
13 * use kmalloc for small sizes (<= one page), vmalloc for larger 13 * use kmalloc for smaller sizes, vmalloc for larger sizes.
14 * sizes.
15 */ 14 */
16struct ceph_buffer { 15struct ceph_buffer {
17 struct kref kref; 16 struct kref kref;
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h
index d12659ce550d..71e05bbf8ceb 100644
--- a/include/linux/ceph/ceph_features.h
+++ b/include/linux/ceph/ceph_features.h
@@ -84,6 +84,7 @@ static inline u64 ceph_sanitize_features(u64 features)
84 CEPH_FEATURE_PGPOOL3 | \ 84 CEPH_FEATURE_PGPOOL3 | \
85 CEPH_FEATURE_OSDENC | \ 85 CEPH_FEATURE_OSDENC | \
86 CEPH_FEATURE_CRUSH_TUNABLES | \ 86 CEPH_FEATURE_CRUSH_TUNABLES | \
87 CEPH_FEATURE_MSG_AUTH | \
87 CEPH_FEATURE_CRUSH_TUNABLES2 | \ 88 CEPH_FEATURE_CRUSH_TUNABLES2 | \
88 CEPH_FEATURE_REPLY_CREATE_INODE | \ 89 CEPH_FEATURE_REPLY_CREATE_INODE | \
89 CEPH_FEATURE_OSDHASHPSPOOL | \ 90 CEPH_FEATURE_OSDHASHPSPOOL | \
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 3c97d5e9b951..c0dadaac26e3 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -522,8 +522,11 @@ struct ceph_mds_reply_dirfrag {
522 __le32 dist[]; 522 __le32 dist[];
523} __attribute__ ((packed)); 523} __attribute__ ((packed));
524 524
525#define CEPH_LOCK_FCNTL 1 525#define CEPH_LOCK_FCNTL 1
526#define CEPH_LOCK_FLOCK 2 526#define CEPH_LOCK_FLOCK 2
527#define CEPH_LOCK_FCNTL_INTR 3
528#define CEPH_LOCK_FLOCK_INTR 4
529
527 530
528#define CEPH_LOCK_SHARED 1 531#define CEPH_LOCK_SHARED 1
529#define CEPH_LOCK_EXCL 2 532#define CEPH_LOCK_EXCL 2
@@ -549,6 +552,7 @@ struct ceph_filelock {
549 552
550int ceph_flags_to_mode(int flags); 553int ceph_flags_to_mode(int flags);
551 554
555#define CEPH_INLINE_NONE ((__u64)-1)
552 556
553/* capability bits */ 557/* capability bits */
554#define CEPH_CAP_PIN 1 /* no specific capabilities beyond the pin */ 558#define CEPH_CAP_PIN 1 /* no specific capabilities beyond the pin */
@@ -613,6 +617,8 @@ int ceph_flags_to_mode(int flags);
613 CEPH_CAP_LINK_SHARED | \ 617 CEPH_CAP_LINK_SHARED | \
614 CEPH_CAP_FILE_SHARED | \ 618 CEPH_CAP_FILE_SHARED | \
615 CEPH_CAP_XATTR_SHARED) 619 CEPH_CAP_XATTR_SHARED)
620#define CEPH_STAT_CAP_INLINE_DATA (CEPH_CAP_FILE_SHARED | \
621 CEPH_CAP_FILE_RD)
616 622
617#define CEPH_CAP_ANY_SHARED (CEPH_CAP_AUTH_SHARED | \ 623#define CEPH_CAP_ANY_SHARED (CEPH_CAP_AUTH_SHARED | \
618 CEPH_CAP_LINK_SHARED | \ 624 CEPH_CAP_LINK_SHARED | \
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 07bc359b88ac..8b11a79ca1cb 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -29,6 +29,7 @@
29#define CEPH_OPT_NOSHARE (1<<1) /* don't share client with other sbs */ 29#define CEPH_OPT_NOSHARE (1<<1) /* don't share client with other sbs */
30#define CEPH_OPT_MYIP (1<<2) /* specified my ip */ 30#define CEPH_OPT_MYIP (1<<2) /* specified my ip */
31#define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */ 31#define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */
32#define CEPH_OPT_NOMSGAUTH (1<<4) /* not require cephx message signature */
32 33
33#define CEPH_OPT_DEFAULT (0) 34#define CEPH_OPT_DEFAULT (0)
34 35
@@ -184,7 +185,6 @@ extern bool libceph_compatible(void *data);
184extern const char *ceph_msg_type_name(int type); 185extern const char *ceph_msg_type_name(int type);
185extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); 186extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
186extern void *ceph_kvmalloc(size_t size, gfp_t flags); 187extern void *ceph_kvmalloc(size_t size, gfp_t flags);
187extern void ceph_kvfree(const void *ptr);
188 188
189extern struct ceph_options *ceph_parse_options(char *options, 189extern struct ceph_options *ceph_parse_options(char *options,
190 const char *dev_name, const char *dev_name_end, 190 const char *dev_name, const char *dev_name_end,
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 40ae58e3e9db..d9d396c16503 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -42,6 +42,10 @@ struct ceph_connection_operations {
42 struct ceph_msg * (*alloc_msg) (struct ceph_connection *con, 42 struct ceph_msg * (*alloc_msg) (struct ceph_connection *con,
43 struct ceph_msg_header *hdr, 43 struct ceph_msg_header *hdr,
44 int *skip); 44 int *skip);
45 int (*sign_message) (struct ceph_connection *con, struct ceph_msg *msg);
46
47 int (*check_message_signature) (struct ceph_connection *con,
48 struct ceph_msg *msg);
45}; 49};
46 50
47/* use format string %s%d */ 51/* use format string %s%d */
@@ -142,7 +146,10 @@ struct ceph_msg_data_cursor {
142 */ 146 */
143struct ceph_msg { 147struct ceph_msg {
144 struct ceph_msg_header hdr; /* header */ 148 struct ceph_msg_header hdr; /* header */
145 struct ceph_msg_footer footer; /* footer */ 149 union {
150 struct ceph_msg_footer footer; /* footer */
151 struct ceph_msg_footer_old old_footer; /* old format footer */
152 };
146 struct kvec front; /* unaligned blobs of message */ 153 struct kvec front; /* unaligned blobs of message */
147 struct ceph_buffer *middle; 154 struct ceph_buffer *middle;
148 155
diff --git a/include/linux/ceph/msgr.h b/include/linux/ceph/msgr.h
index 3d94a73b5f30..1c1887206ffa 100644
--- a/include/linux/ceph/msgr.h
+++ b/include/linux/ceph/msgr.h
@@ -152,7 +152,8 @@ struct ceph_msg_header {
152 receiver: mask against ~PAGE_MASK */ 152 receiver: mask against ~PAGE_MASK */
153 153
154 struct ceph_entity_name src; 154 struct ceph_entity_name src;
155 __le32 reserved; 155 __le16 compat_version;
156 __le16 reserved;
156 __le32 crc; /* header crc32c */ 157 __le32 crc; /* header crc32c */
157} __attribute__ ((packed)); 158} __attribute__ ((packed));
158 159
@@ -164,13 +165,21 @@ struct ceph_msg_header {
164/* 165/*
165 * follows data payload 166 * follows data payload
166 */ 167 */
168struct ceph_msg_footer_old {
169 __le32 front_crc, middle_crc, data_crc;
170 __u8 flags;
171} __attribute__ ((packed));
172
167struct ceph_msg_footer { 173struct ceph_msg_footer {
168 __le32 front_crc, middle_crc, data_crc; 174 __le32 front_crc, middle_crc, data_crc;
175 // sig holds the 64 bits of the digital signature for the message PLR
176 __le64 sig;
169 __u8 flags; 177 __u8 flags;
170} __attribute__ ((packed)); 178} __attribute__ ((packed));
171 179
172#define CEPH_MSG_FOOTER_COMPLETE (1<<0) /* msg wasn't aborted */ 180#define CEPH_MSG_FOOTER_COMPLETE (1<<0) /* msg wasn't aborted */
173#define CEPH_MSG_FOOTER_NOCRC (1<<1) /* no data crc */ 181#define CEPH_MSG_FOOTER_NOCRC (1<<1) /* no data crc */
182#define CEPH_MSG_FOOTER_SIGNED (1<<2) /* msg was signed */
174 183
175 184
176#endif 185#endif
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 03aeb27fcc69..5d86416d35f2 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -87,6 +87,13 @@ struct ceph_osd_req_op {
87 struct ceph_osd_data osd_data; 87 struct ceph_osd_data osd_data;
88 } extent; 88 } extent;
89 struct { 89 struct {
90 __le32 name_len;
91 __le32 value_len;
92 __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */
93 __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */
94 struct ceph_osd_data osd_data;
95 } xattr;
96 struct {
90 const char *class_name; 97 const char *class_name;
91 const char *method_name; 98 const char *method_name;
92 struct ceph_osd_data request_info; 99 struct ceph_osd_data request_info;
@@ -295,6 +302,9 @@ extern void osd_req_op_cls_response_data_pages(struct ceph_osd_request *,
295extern void osd_req_op_cls_init(struct ceph_osd_request *osd_req, 302extern void osd_req_op_cls_init(struct ceph_osd_request *osd_req,
296 unsigned int which, u16 opcode, 303 unsigned int which, u16 opcode,
297 const char *class, const char *method); 304 const char *class, const char *method);
305extern int osd_req_op_xattr_init(struct ceph_osd_request *osd_req, unsigned int which,
306 u16 opcode, const char *name, const void *value,
307 size_t size, u8 cmp_op, u8 cmp_mode);
298extern void osd_req_op_watch_init(struct ceph_osd_request *osd_req, 308extern void osd_req_op_watch_init(struct ceph_osd_request *osd_req,
299 unsigned int which, u16 opcode, 309 unsigned int which, u16 opcode,
300 u64 cookie, u64 version, int flag); 310 u64 cookie, u64 version, int flag);
@@ -318,7 +328,8 @@ extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *,
318 struct ceph_file_layout *layout, 328 struct ceph_file_layout *layout,
319 struct ceph_vino vino, 329 struct ceph_vino vino,
320 u64 offset, u64 *len, 330 u64 offset, u64 *len,
321 int num_ops, int opcode, int flags, 331 unsigned int which, int num_ops,
332 int opcode, int flags,
322 struct ceph_snap_context *snapc, 333 struct ceph_snap_context *snapc,
323 u32 truncate_seq, u64 truncate_size, 334 u32 truncate_seq, u64 truncate_size,
324 bool use_mempool); 335 bool use_mempool);
diff --git a/include/linux/ceph/pagelist.h b/include/linux/ceph/pagelist.h
index 5f871d84ddce..13d71fe18b0c 100644
--- a/include/linux/ceph/pagelist.h
+++ b/include/linux/ceph/pagelist.h
@@ -1,8 +1,10 @@
1#ifndef __FS_CEPH_PAGELIST_H 1#ifndef __FS_CEPH_PAGELIST_H
2#define __FS_CEPH_PAGELIST_H 2#define __FS_CEPH_PAGELIST_H
3 3
4#include <linux/list.h> 4#include <asm/byteorder.h>
5#include <linux/atomic.h> 5#include <linux/atomic.h>
6#include <linux/list.h>
7#include <linux/types.h>
6 8
7struct ceph_pagelist { 9struct ceph_pagelist {
8 struct list_head head; 10 struct list_head head;