diff options
Diffstat (limited to 'include/linux/ceph/ceph_fs.h')
-rw-r--r-- | include/linux/ceph/ceph_fs.h | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index 2ad7b860f062..25bfb0eff772 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -53,6 +53,29 @@ struct ceph_file_layout { | |||
53 | __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ | 53 | __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ |
54 | } __attribute__ ((packed)); | 54 | } __attribute__ ((packed)); |
55 | 55 | ||
56 | #define ceph_file_layout_su(l) ((__s32)le32_to_cpu((l).fl_stripe_unit)) | ||
57 | #define ceph_file_layout_stripe_count(l) \ | ||
58 | ((__s32)le32_to_cpu((l).fl_stripe_count)) | ||
59 | #define ceph_file_layout_object_size(l) ((__s32)le32_to_cpu((l).fl_object_size)) | ||
60 | #define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash)) | ||
61 | #define ceph_file_layout_object_su(l) \ | ||
62 | ((__s32)le32_to_cpu((l).fl_object_stripe_unit)) | ||
63 | #define ceph_file_layout_pg_pool(l) \ | ||
64 | ((__s32)le32_to_cpu((l).fl_pg_pool)) | ||
65 | |||
66 | static inline unsigned ceph_file_layout_stripe_width(struct ceph_file_layout *l) | ||
67 | { | ||
68 | return le32_to_cpu(l->fl_stripe_unit) * | ||
69 | le32_to_cpu(l->fl_stripe_count); | ||
70 | } | ||
71 | |||
72 | /* "period" == bytes before i start on a new set of objects */ | ||
73 | static inline unsigned ceph_file_layout_period(struct ceph_file_layout *l) | ||
74 | { | ||
75 | return le32_to_cpu(l->fl_object_size) * | ||
76 | le32_to_cpu(l->fl_stripe_count); | ||
77 | } | ||
78 | |||
56 | #define CEPH_MIN_STRIPE_UNIT 65536 | 79 | #define CEPH_MIN_STRIPE_UNIT 65536 |
57 | 80 | ||
58 | int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); | 81 | int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); |
@@ -282,6 +305,8 @@ enum { | |||
282 | CEPH_SESSION_RENEWCAPS, | 305 | CEPH_SESSION_RENEWCAPS, |
283 | CEPH_SESSION_STALE, | 306 | CEPH_SESSION_STALE, |
284 | CEPH_SESSION_RECALL_STATE, | 307 | CEPH_SESSION_RECALL_STATE, |
308 | CEPH_SESSION_FLUSHMSG, | ||
309 | CEPH_SESSION_FLUSHMSG_ACK, | ||
285 | }; | 310 | }; |
286 | 311 | ||
287 | extern const char *ceph_session_op_name(int op); | 312 | extern const char *ceph_session_op_name(int op); |
@@ -348,8 +373,9 @@ extern const char *ceph_mds_op_name(int op); | |||
348 | /* | 373 | /* |
349 | * Ceph setxattr request flags. | 374 | * Ceph setxattr request flags. |
350 | */ | 375 | */ |
351 | #define CEPH_XATTR_CREATE 1 | 376 | #define CEPH_XATTR_CREATE (1 << 0) |
352 | #define CEPH_XATTR_REPLACE 2 | 377 | #define CEPH_XATTR_REPLACE (1 << 1) |
378 | #define CEPH_XATTR_REMOVE (1 << 31) | ||
353 | 379 | ||
354 | union ceph_mds_request_args { | 380 | union ceph_mds_request_args { |
355 | struct { | 381 | struct { |
@@ -457,7 +483,8 @@ struct ceph_mds_reply_cap { | |||
457 | __u8 flags; /* CEPH_CAP_FLAG_* */ | 483 | __u8 flags; /* CEPH_CAP_FLAG_* */ |
458 | } __attribute__ ((packed)); | 484 | } __attribute__ ((packed)); |
459 | 485 | ||
460 | #define CEPH_CAP_FLAG_AUTH 1 /* cap is issued by auth mds */ | 486 | #define CEPH_CAP_FLAG_AUTH (1 << 0) /* cap is issued by auth mds */ |
487 | #define CEPH_CAP_FLAG_RELEASE (1 << 1) /* release the cap */ | ||
461 | 488 | ||
462 | /* inode record, for bundling with mds reply */ | 489 | /* inode record, for bundling with mds reply */ |
463 | struct ceph_mds_reply_inode { | 490 | struct ceph_mds_reply_inode { |
@@ -658,6 +685,14 @@ struct ceph_mds_caps { | |||
658 | __le32 time_warp_seq; | 685 | __le32 time_warp_seq; |
659 | } __attribute__ ((packed)); | 686 | } __attribute__ ((packed)); |
660 | 687 | ||
688 | struct ceph_mds_cap_peer { | ||
689 | __le64 cap_id; | ||
690 | __le32 seq; | ||
691 | __le32 mseq; | ||
692 | __le32 mds; | ||
693 | __u8 flags; | ||
694 | } __attribute__ ((packed)); | ||
695 | |||
661 | /* cap release msg head */ | 696 | /* cap release msg head */ |
662 | struct ceph_mds_cap_release { | 697 | struct ceph_mds_cap_release { |
663 | __le32 num; /* number of cap_items that follow */ | 698 | __le32 num; /* number of cap_items that follow */ |