1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * This file is part of Lustre, http://www.lustre.org
6 * Lustre wire protocol definitions.
8 * All structs passing over the wire should be declared here (lov_mds_md
9 * being the lone exception). Structs must be properly aligned to put
10 * 64-bit values on an 8-byte boundary. Any structs being added here
11 * must also be added to utils/wirecheck.c and "make newwiretest" run
12 * to regenerate the utils/wiretest.c sources. This allows us to verify
13 * that wire structs have the proper alignment/size on all architectures.
15 * We assume all nodes are either little-endian or big-endian, and we
16 * always send messages in the sender's native format. The receiver
17 * detects the message format by checking the 'magic' field of the message
18 * (see lustre_msg_swabbed() below).
20 * Each wire type has corresponding 'lustre_swab_xxxtypexxx()' routines,
21 * implemented either here, inline (trivial implementations) or in
22 * ptlrpc/pack_generic.c. These 'swabbers' convert the type from "other"
23 * endian, in-place in the message buffer.
25 * A swabber takes a single pointer argument. The caller must already have
26 * verified that the length of the message buffer >= sizeof (type).
28 * For variable length types, a second 'lustre_swab_v_xxxtypexxx()' routine
29 * may be defined that swabs just the variable part, after the caller has
30 * verified that the message buffer is large enough.
33 #ifndef _LUSTRE_IDL_H_
34 #define _LUSTRE_IDL_H_
37 # include <asm/types.h>
38 # include <linux/types.h>
39 # include <linux/fs.h> /* to check for FMODE_EXEC, lest we redefine */
42 # include <sys/types.h>
44 # include <asm/types.h>
49 /* Defn's shared with user-space. */
50 #include <lustre/lustre_user.h>
53 * this file contains all data structures used in Lustre interfaces:
54 * - obdo and obd_request records
55 * - mds_request records
63 /* FOO_REQUEST_PORTAL is for incoming requests on the FOO
64 * FOO_REPLY_PORTAL is for incoming replies on the FOO
65 * FOO_BULK_PORTAL is for incoming bulk on the FOO
68 #define CONNMGR_REQUEST_PORTAL 1
69 #define CONNMGR_REPLY_PORTAL 2
70 //#define OSC_REQUEST_PORTAL 3
71 #define OSC_REPLY_PORTAL 4
72 //#define OSC_BULK_PORTAL 5
73 #define OST_REQUEST_PORTAL 6
74 #define OST_CREATE_PORTAL 7
75 #define OST_BULK_PORTAL 8
76 //#define MDC_REQUEST_PORTAL 9
77 #define MDC_REPLY_PORTAL 10
78 //#define MDC_BULK_PORTAL 11
79 #define MDS_REQUEST_PORTAL 12
80 //#define MDS_REPLY_PORTAL 13
81 #define MDS_BULK_PORTAL 14
82 #define LDLM_CB_REQUEST_PORTAL 15
83 #define LDLM_CB_REPLY_PORTAL 16
84 #define LDLM_CANCEL_REQUEST_PORTAL 17
85 #define LDLM_CANCEL_REPLY_PORTAL 18
86 #define PTLBD_REQUEST_PORTAL 19
87 #define PTLBD_REPLY_PORTAL 20
88 #define PTLBD_BULK_PORTAL 21
89 #define MDS_SETATTR_PORTAL 22
90 #define MDS_READPAGE_PORTAL 23
91 #define MGMT_REQUEST_PORTAL 24
92 #define MGMT_REPLY_PORTAL 25
93 #define MGMT_CLI_REQUEST_PORTAL 26
94 #define MGMT_CLI_REPLY_PORTAL 27
100 #define SVC_STOPPING 16
101 #define SVC_STOPPED 32
104 #define PTL_RPC_MSG_REQUEST 4711
105 #define PTL_RPC_MSG_ERR 4712
106 #define PTL_RPC_MSG_REPLY 4713
108 #define PTLRPC_MSG_MAGIC 0x0BD00BD0
111 #define PTLRPC_MSG_VERSION 0x00000003
112 #define LUSTRE_MDS_VERSION (0x00040000|PTLRPC_MSG_VERSION)
113 #define LUSTRE_OST_VERSION (0x00040000|PTLRPC_MSG_VERSION)
114 #define LUSTRE_DLM_VERSION (0x00040000|PTLRPC_MSG_VERSION)
116 struct lustre_handle {
119 #define DEAD_HANDLE_MAGIC 0xdeadbeefcafebabeULL
121 /* we depend on this structure to be 8-byte aligned */
122 /* this type is only endian-adjusted in lustre_unpack_msg() */
124 struct lustre_handle handle;
130 __u64 last_committed;
139 /* Flags that are operation-specific go in the top 16 bits. */
140 #define MSG_OP_FLAG_MASK 0xffff0000
141 #define MSG_OP_FLAG_SHIFT 16
143 /* Flags that apply to all requests are in the bottom 16 bits */
144 #define MSG_GEN_FLAG_MASK 0x0000ffff
145 #define MSG_LAST_REPLAY 1
149 static inline int lustre_msg_get_flags(struct lustre_msg *msg)
151 return (msg->flags & MSG_GEN_FLAG_MASK);
154 static inline void lustre_msg_add_flags(struct lustre_msg *msg, int flags)
156 msg->flags |= MSG_GEN_FLAG_MASK & flags;
159 static inline void lustre_msg_set_flags(struct lustre_msg *msg, int flags)
161 msg->flags &= ~MSG_GEN_FLAG_MASK;
162 lustre_msg_add_flags(msg, flags);
165 static inline void lustre_msg_clear_flags(struct lustre_msg *msg, int flags)
167 msg->flags &= ~(MSG_GEN_FLAG_MASK & flags);
170 static inline int lustre_msg_get_op_flags(struct lustre_msg *msg)
172 return (msg->flags >> MSG_OP_FLAG_SHIFT);
175 static inline void lustre_msg_add_op_flags(struct lustre_msg *msg, int flags)
177 msg->flags |= ((flags & MSG_GEN_FLAG_MASK) << MSG_OP_FLAG_SHIFT);
180 static inline void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags)
182 msg->flags &= ~MSG_OP_FLAG_MASK;
183 lustre_msg_add_op_flags(msg, flags);
187 * Flags for all connect opcodes (MDS_CONNECT, OST_CONNECT)
190 #define MSG_CONNECT_RECOVERING 0x1
191 #define MSG_CONNECT_RECONNECT 0x2
192 #define MSG_CONNECT_REPLAYABLE 0x4
193 //#define MSG_CONNECT_PEER 0x8
194 #define MSG_CONNECT_LIBCLIENT 0x10
197 * OST requests: OBDO & OBD request records
202 OST_REPLY = 0, /* reply ? */
222 #define OST_FIRST_OPC OST_REPLY
224 typedef uint64_t obd_id;
225 typedef uint64_t obd_gr;
226 typedef uint64_t obd_time;
227 typedef uint64_t obd_size;
228 typedef uint64_t obd_off;
229 typedef uint64_t obd_blocks;
230 typedef uint32_t obd_blksize;
231 typedef uint32_t obd_mode;
232 typedef uint32_t obd_uid;
233 typedef uint32_t obd_gid;
234 typedef uint32_t obd_flag;
235 typedef uint32_t obd_count;
237 #define OBD_FL_DELORPHAN (0x00000004) /* if set in o_flags delete orphans */
238 #define OBD_FL_RECREATE_OBJS (0x00000020) // recreate missing obj
239 #define OBD_FL_DEBUG_CHECK (0x00000040) /* echo client/server debug check */
241 #define OBD_INLINESZ 64
243 /* Note: 64-bit types are 64-bit aligned in structure */
251 obd_blocks o_blocks; /* brw: cli sent cached bytes */
253 obd_blksize o_blksize; /* optimal IO blocksize */
254 obd_mode o_mode; /* brw: cli sent cache remain */
258 obd_count o_nlink; /* brw: checksum */
259 obd_count o_generation;
260 obd_flag o_valid; /* hot fields in this obdo */
261 obd_count o_misc; /* brw: o_dropped */
262 __u32 o_easize; /* epoch in ost writes */
263 char o_inline[OBD_INLINESZ]; /* fid in ost writes */
266 #define o_dirty o_blocks
267 #define o_undirty o_mode
268 #define o_dropped o_misc
269 #define o_cksum o_nlink
271 extern void lustre_swab_obdo (struct obdo *o);
273 #define LOV_MAGIC_V1 0x0BD10BD0
274 #define LOV_MAGIC LOV_MAGIC_V1
276 #define LOV_PATTERN_RAID0 0x001 /* stripes are used round-robin */
277 #define LOV_PATTERN_RAID1 0x002 /* stripes are mirrors of each other */
278 #define LOV_PATTERN_FIRST 0x100 /* first stripe is not in round-robin */
280 #define lov_ost_data lov_ost_data_v1
281 struct lov_ost_data_v1 { /* per-stripe data structure (little-endian)*/
282 __u64 l_object_id; /* OST object ID */
283 __u64 l_object_gr; /* OST object group (creating MDS number) */
284 __u32 l_ost_gen; /* generation of this l_ost_idx */
285 __u32 l_ost_idx; /* OST index in LOV (lov_tgt_desc->tgts) */
288 #define lov_mds_md lov_mds_md_v1
289 struct lov_mds_md_v1 { /* LOV EA mds/wire data (little-endian) */
290 __u32 lmm_magic; /* magic number = LOV_MAGIC_V1 */
291 __u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
292 __u64 lmm_object_id; /* LOV object ID */
293 __u64 lmm_object_gr; /* LOV object group */
294 __u32 lmm_stripe_size; /* size of stripe in bytes */
295 __u32 lmm_stripe_count; /* num stripes in use for this object */
296 struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */
299 #define OBD_MD_FLALL (0xffffffff)
300 #define OBD_MD_FLID (0x00000001) /* object ID */
301 #define OBD_MD_FLATIME (0x00000002) /* access time */
302 #define OBD_MD_FLMTIME (0x00000004) /* data modification time */
303 #define OBD_MD_FLCTIME (0x00000008) /* change time */
304 #define OBD_MD_FLSIZE (0x00000010) /* size */
305 #define OBD_MD_FLBLOCKS (0x00000020) /* allocated blocks count */
306 #define OBD_MD_FLBLKSZ (0x00000040) /* block size */
307 #define OBD_MD_FLMODE (0x00000080) /* access bits (mode & ~S_IFMT) */
308 #define OBD_MD_FLTYPE (0x00000100) /* object type (mode & S_IFMT) */
309 #define OBD_MD_FLUID (0x00000200) /* user ID */
310 #define OBD_MD_FLGID (0x00000400) /* group ID */
311 #define OBD_MD_FLFLAGS (0x00000800) /* flags word */
312 #define OBD_MD_FLNLINK (0x00002000) /* link count */
313 #define OBD_MD_FLGENER (0x00004000) /* generation number */
314 #define OBD_MD_FLINLINE (0x00008000) /* inline data */
315 #define OBD_MD_FLRDEV (0x00010000) /* device number */
316 #define OBD_MD_FLEASIZE (0x00020000) /* extended attribute data */
317 #define OBD_MD_LINKNAME (0x00040000) /* symbolic link target */
318 #define OBD_MD_FLHANDLE (0x00080000) /* file handle */
319 #define OBD_MD_FLCKSUM (0x00100000) /* bulk data checksum */
320 #define OBD_MD_FLQOS (0x00200000) /* quality of service stats */
321 #define OBD_MD_FLOSCOPQ (0x00400000) /* osc opaque data */
322 #define OBD_MD_FLCOOKIE (0x00800000) /* log cancellation cookie */
323 #define OBD_MD_FLGROUP (0x01000000) /* group */
324 #define OBD_MD_FLIFID (0x02000000) /* ->ost write inline fid */
325 #define OBD_MD_FLEPOCH (0x04000000) /* ->ost write easize is epoch */
326 #define OBD_MD_FLGRANT (0x08000000) /* ost preallocation space grant */
327 #define OBD_MD_FLDIREA (0x10000000) /* dir's extended attribute data */
328 #define OBD_MD_FLNOTOBD (~(OBD_MD_FLBLOCKS | OBD_MD_LINKNAME|\
329 OBD_MD_FLEASIZE | OBD_MD_FLHANDLE | OBD_MD_FLCKSUM|\
330 OBD_MD_FLQOS | OBD_MD_FLOSCOPQ | OBD_MD_FLCOOKIE))
333 static inline struct lustre_handle *obdo_handle(struct obdo *oa)
335 return (struct lustre_handle *)oa->o_inline;
338 static inline struct llog_cookie *obdo_logcookie(struct obdo *oa)
340 return (struct llog_cookie *)(oa->o_inline +
341 sizeof(struct lustre_handle));
343 /* don't forget obdo_fid which is way down at the bottom so it can
344 * come after the definition of llog_cookie */
360 extern void lustre_swab_obd_statfs (struct obd_statfs *os);
362 /* ost_body.data values for OST_BRW */
364 #define OBD_BRW_READ 0x01
365 #define OBD_BRW_WRITE 0x02
366 #define OBD_BRW_RWMASK (OBD_BRW_READ | OBD_BRW_WRITE)
367 #define OBD_BRW_SYNC 0x08
368 #define OBD_BRW_CHECK 0x10
369 #define OBD_BRW_FROM_GRANT 0x20 /* the osc manages this under llite */
370 #define OBD_BRW_GRANTED 0x40 /* the ost manages this */
371 #define OBD_BRW_DROP 0x80 /* drop the page after IO */
373 #define OBD_OBJECT_EOF 0xffffffffffffffffULL
375 #define OST_MIN_PRECREATE 32
376 #define OST_MAX_PRECREATE 20000
385 extern void lustre_swab_obd_ioobj (struct obd_ioobj *ioo);
387 /* multiple of 8 bytes => can array */
388 struct niobuf_remote {
394 extern void lustre_swab_niobuf_remote (struct niobuf_remote *nbr);
396 /* request structure for OST's */
398 #define OST_REQ_HAS_OA1 0x1
404 extern void lustre_swab_ost_body (struct ost_body *b);
405 extern void lustre_swab_ost_last_id(obd_id *id);
407 /* lock value block communicated between the filter and llite */
417 extern void lustre_swab_ost_lvb(struct ost_lvb *);
426 MDS_GETATTR_NAME = 34,
437 MDS_DONE_WRITING = 45,
441 #define MDS_FIRST_OPC MDS_GETATTR
447 #define REINT_SETATTR 1
448 #define REINT_CREATE 2
450 #define REINT_UNLINK 4
451 #define REINT_RENAME 5
455 /* the disposition of the intent outlines what was executed */
456 #define DISP_IT_EXECD 0x01
457 #define DISP_LOOKUP_EXECD 0x02
458 #define DISP_LOOKUP_NEG 0x04
459 #define DISP_LOOKUP_POS 0x08
460 #define DISP_OPEN_CREATE 0x10
461 #define DISP_OPEN_OPEN 0x20
462 #define DISP_ENQ_COMPLETE 0x40
470 extern void lustre_swab_ll_fid (struct ll_fid *fid);
472 #define MDS_STATUS_CONN 1
473 #define MDS_STATUS_LOV 2
475 struct mds_status_req {
480 extern void lustre_swab_mds_status_req (struct mds_status_req *r);
482 #define MDS_BFLAG_UNCOMMITTED_WRITES 0x1
487 struct lustre_handle handle;
488 __u64 size; /* Offset, in the case of MDS_READPAGE */
489 __u64 blocks; /* XID, in the case of MDS_READPAGE */
491 __u32 ino; /* make this a __u64 */
502 __u32 flags; /* from vfs for pin/unpin, MDS_BFLAG for close */
504 __u32 nlink; /* #bytes to read in the case of MDS_READPAGE */
511 extern void lustre_swab_mds_body (struct mds_body *b);
514 struct mds_rec_setattr {
521 struct ll_fid sa_fid;
532 /* Remove this once we declare it in include/linux/fs.h (v21 kernel patch?) */
533 #ifndef ATTR_CTIME_SET
534 #define ATTR_CTIME_SET 0x2000
537 extern void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa);
540 #define FMODE_READ 00000001
541 #define FMODE_WRITE 00000002
544 #define FMODE_EXEC 00000004
546 #define MDS_OPEN_CREAT 00000100
547 #define MDS_OPEN_EXCL 00000200
548 #define MDS_OPEN_TRUNC 00001000
549 #define MDS_OPEN_APPEND 00002000
550 #define MDS_OPEN_SYNC 00010000
551 #define MDS_OPEN_DIRECTORY 00200000
553 #define MDS_OPEN_DELAY_CREATE 0100000000 /* delay initial object create */
554 #define MDS_OPEN_OWNEROVERRIDE 0200000000 /* NFSD rw-reopen ro file for owner */
555 #define MDS_OPEN_HAS_EA 010000000000 /* specify object create pattern */
556 #define MDS_OPEN_HAS_OBJS 020000000000 /* Just set the EA the obj exist */
558 struct mds_rec_create {
563 __u32 cr_flags; /* for use with open */
565 struct ll_fid cr_fid;
566 struct ll_fid cr_replayfid;
573 extern void lustre_swab_mds_rec_create (struct mds_rec_create *cr);
575 struct mds_rec_link {
582 struct ll_fid lk_fid1;
583 struct ll_fid lk_fid2;
587 extern void lustre_swab_mds_rec_link (struct mds_rec_link *lk);
589 struct mds_rec_unlink {
596 struct ll_fid ul_fid1;
597 struct ll_fid ul_fid2;
601 extern void lustre_swab_mds_rec_unlink (struct mds_rec_unlink *ul);
603 struct mds_rec_rename {
610 struct ll_fid rn_fid1;
611 struct ll_fid rn_fid2;
615 extern void lustre_swab_mds_rec_rename (struct mds_rec_rename *rn);
618 * LOV data structures
621 #define LOV_MAX_UUID_BUFFER_SIZE 8192
622 /* The size of the buffer the lov/mdc reserves for the
623 * array of UUIDs returned by the MDS. With the current
624 * protocol, this will limit the max number of OSTs per LOV */
627 __u32 ld_tgt_count; /* how many OBD's */
628 __u32 ld_active_tgt_count; /* how many active */
629 __u32 ld_default_stripe_count; /* how many objects are used */
630 __u32 ld_pattern; /* PATTERN_RAID0, PATTERN_RAID1 */
631 __u64 ld_default_stripe_size; /* in bytes */
632 __u64 ld_default_stripe_offset; /* in bytes */
633 struct obd_uuid ld_uuid;
636 extern void lustre_swab_lov_desc (struct lov_desc *ld);
641 /* opcodes -- MUST be distinct from OST/MDS opcodes */
646 LDLM_BL_CALLBACK = 104,
647 LDLM_CP_CALLBACK = 105,
648 LDLM_GL_CALLBACK = 106,
651 #define LDLM_FIRST_OPC LDLM_ENQUEUE
653 #define RES_NAME_SIZE 4
655 __u64 name[RES_NAME_SIZE];
658 extern void lustre_swab_ldlm_res_id (struct ldlm_res_id *id);
677 #define LDLM_MIN_TYPE LDLM_PLAIN
687 __u64 blocking_export;
692 /* it's important that the fields of the ldlm_extent structure match
693 * the first fields of the ldlm_flock structure because there is only
694 * one ldlm_swab routine to process the ldlm_policy_data_t union. if
695 * this ever changes we will need to swab the union differently based
696 * on the resource type. */
699 struct ldlm_extent l_extent;
700 struct ldlm_flock l_flock;
701 } ldlm_policy_data_t;
703 extern void lustre_swab_ldlm_policy_data (ldlm_policy_data_t *d);
709 extern void lustre_swab_ldlm_intent (struct ldlm_intent *i);
711 struct ldlm_resource_desc {
714 struct ldlm_res_id lr_name;
717 extern void lustre_swab_ldlm_resource_desc (struct ldlm_resource_desc *r);
719 struct ldlm_lock_desc {
720 struct ldlm_resource_desc l_resource;
721 ldlm_mode_t l_req_mode;
722 ldlm_mode_t l_granted_mode;
723 ldlm_policy_data_t l_policy_data;
726 extern void lustre_swab_ldlm_lock_desc (struct ldlm_lock_desc *l);
728 struct ldlm_request {
731 struct ldlm_lock_desc lock_desc;
732 struct lustre_handle lock_handle1;
733 struct lustre_handle lock_handle2;
736 extern void lustre_swab_ldlm_request (struct ldlm_request *rq);
741 struct ldlm_lock_desc lock_desc;
742 struct lustre_handle lock_handle;
743 __u64 lock_policy_res1;
744 __u64 lock_policy_res2;
747 extern void lustre_swab_ldlm_reply (struct ldlm_reply *r);
750 * ptlbd, portal block device requests
758 PTLBD_DISCONNECT = 205,
761 #define PTLBD_FIRST_OPC PTLBD_QUERY
771 extern void lustre_swab_ptlbd_op (struct ptlbd_op *op);
780 extern void lustre_swab_ptlbd_niob (struct ptlbd_niob *n);
787 extern void lustre_swab_ptlbd_rsp (struct ptlbd_rsp *r);
790 * Opcodes for management/monitoring node.
795 MGMT_EXCEPTION, /* node died, etc. */
798 #define MGMT_FIRST_OPC MGMT_CONNECT
801 * Opcodes for multiple servers.
809 #define OBD_FIRST_OPC OBD_PING
811 /* catalog of log objects */
813 /* Identifier for a single log object */
818 } __attribute__((packed));
820 /* Records written to the CATALOGS list */
821 #define CATLIST "CATALOGS"
823 struct llog_logid lci_logid;
824 __u32 lci_padding[3];
825 } __attribute__((packed));
827 /* Log data record types - there is no specific reason that these need to
828 * be related to the RPC opcodes, but no reason not to (may be handy later?)
831 OST_SZ_REC = 0x10600000 | (OST_SAN_WRITE << 8),
832 OST_RAID1_REC = 0x10600000 | ((OST_SAN_WRITE + 1) << 8),
833 MDS_UNLINK_REC = 0x10610000 | (MDS_REINT << 8) | REINT_UNLINK,
834 OBD_CFG_REC = 0x10620000,
835 PTL_CFG_REC = 0x10630000,
836 LLOG_GEN_REC = 0x10640000,
837 LLOG_HDR_MAGIC = 0x10645539,
838 LLOG_LOGID_MAGIC = 0x1064553b,
841 /* Log record header - stored in little endian order.
842 * Each record must start with this struct, end with a llog_rec_tail,
843 * and be a multiple of 256 bits in size.
845 struct llog_rec_hdr {
852 struct llog_rec_tail {
857 struct llog_logid_rec {
858 struct llog_rec_hdr lid_hdr;
859 struct llog_logid lid_id;
861 struct llog_rec_tail lid_tail;
862 } __attribute__((packed));
864 struct llog_create_rec {
865 struct llog_rec_hdr lcr_hdr;
866 struct ll_fid lcr_fid;
870 struct llog_rec_tail lcr_tail;
871 } __attribute__((packed));
873 struct llog_orphan_rec {
874 struct llog_rec_hdr lor_hdr;
878 struct llog_rec_tail lor_tail;
879 } __attribute__((packed));
881 struct llog_unlink_rec {
882 struct llog_rec_hdr lur_hdr;
886 struct llog_rec_tail lur_tail;
887 } __attribute__((packed));
889 struct llog_size_change_rec {
890 struct llog_rec_hdr lsc_hdr;
891 struct ll_fid lsc_fid;
894 struct llog_rec_tail lsc_tail;
895 } __attribute__((packed));
900 } __attribute__((packed));
902 struct llog_gen_rec {
903 struct llog_rec_hdr lgr_hdr;
904 struct llog_gen lgr_gen;
905 struct llog_rec_tail lgr_tail;
907 /* On-disk header structure of each log object, stored in little endian order */
908 #define LLOG_CHUNK_SIZE 8192
909 #define LLOG_HEADER_SIZE (96)
910 #define LLOG_BITMAP_BYTES (LLOG_CHUNK_SIZE - LLOG_HEADER_SIZE)
912 #define LLOG_MIN_REC_SIZE (24) /* round(llog_rec_hdr + llog_rec_tail) */
914 /* flags for the logs */
915 #define LLOG_F_ZAP_WHEN_EMPTY 0x1
916 #define LLOG_F_IS_CAT 0x2
917 #define LLOG_F_IS_PLAIN 0x4
919 struct llog_log_hdr {
920 struct llog_rec_hdr llh_hdr;
923 __u32 llh_bitmap_offset;
927 /* for a catalog the first plain slot is next to it */
928 struct obd_uuid llh_tgtuuid;
929 __u32 llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32) - 23];
930 __u32 llh_bitmap[LLOG_BITMAP_BYTES/sizeof(__u32)];
931 struct llog_rec_tail llh_tail;
932 } __attribute__((packed));
934 #define LLOG_BITMAP_SIZE(llh) ((llh->llh_hdr.lrh_len - \
935 llh->llh_bitmap_offset - \
936 sizeof(llh->llh_tail)) * 8)
938 /* log cookies are used to reference a specific log file and a record therein */
940 struct llog_logid lgc_lgl;
944 } __attribute__((packed));
948 LLOG_ORIGIN_HANDLE_CREATE = 501,
949 LLOG_ORIGIN_HANDLE_NEXT_BLOCK = 502,
950 LLOG_ORIGIN_HANDLE_READ_HEADER = 503,
951 LLOG_ORIGIN_HANDLE_WRITE_REC = 504,
952 LLOG_ORIGIN_HANDLE_CLOSE = 505,
953 LLOG_ORIGIN_CONNECT = 506,
954 LLOG_CATINFO = 507, /* for lfs catinfo */
958 struct llog_logid lgd_logid;
962 __u32 lgd_saved_index;
964 __u64 lgd_cur_offset;
965 } __attribute__((packed));
967 struct llogd_conn_body {
968 struct llog_gen lgdc_gen;
969 struct llog_logid lgdc_logid;
971 } __attribute__((packed));
973 extern void lustre_swab_llogd_body (struct llogd_body *d);
974 extern void lustre_swab_llog_hdr (struct llog_log_hdr *h);
975 extern void lustre_swab_llogd_conn_body (struct llogd_conn_body *d);
977 static inline struct ll_fid *obdo_fid(struct obdo *oa)
979 return (struct ll_fid *)(oa->o_inline + sizeof(struct lustre_handle) +
980 sizeof(struct llog_cookie));