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_
36 #ifdef HAVE_ASM_TYPES_H
37 #include <asm/types.h>
39 #include <lustre/types.h>
43 # include <linux/types.h>
44 # include <linux/fs.h> /* to check for FMODE_EXEC, dev_t, lest we redefine */
45 # ifdef CONFIG_FS_POSIX_ACL
46 # include <linux/xattr_acl.h>
50 # include <sys/types.h>
52 # include <inttypes.h>
58 #include <lnet/types.h> /* for lnet_nid_t */
60 /* Defn's shared with user-space. */
61 #include <lustre/lustre_user.h>
66 #include <libcfs/kp30.h>
69 * this file contains all data structures used in Lustre interfaces:
70 * - obdo and obd_request records
71 * - mds_request records
79 /* FOO_REQUEST_PORTAL is for incoming requests on the FOO
80 * FOO_REPLY_PORTAL is for incoming replies on the FOO
81 * FOO_BULK_PORTAL is for incoming bulk on the FOO
84 #define CONNMGR_REQUEST_PORTAL 1
85 #define CONNMGR_REPLY_PORTAL 2
86 #define OSC_REPLY_PORTAL 4
87 #define OST_IO_PORTAL 6
88 #define OST_CREATE_PORTAL 7
89 #define OST_BULK_PORTAL 8
90 #define MDC_REPLY_PORTAL 10
91 #define MDS_REQUEST_PORTAL 12
92 #define MDS_BULK_PORTAL 14
93 #define LDLM_CB_REQUEST_PORTAL 15
94 #define LDLM_CB_REPLY_PORTAL 16
95 #define LDLM_CANCEL_REQUEST_PORTAL 17
96 #define LDLM_CANCEL_REPLY_PORTAL 18
97 #define MDS_SETATTR_PORTAL 22
98 #define MDS_READPAGE_PORTAL 23
99 #define MGC_REPLY_PORTAL 25
100 #define MGS_REQUEST_PORTAL 26
101 #define MGS_REPLY_PORTAL 27
102 #define OST_REQUEST_PORTAL 28
103 #define MDS_FLD_PORTAL 29
108 #define SVC_RUNNING 8
109 #define SVC_STOPPING 16
110 #define SVC_STOPPED 32
113 #define PTL_RPC_MSG_REQUEST 4711
114 #define PTL_RPC_MSG_ERR 4712
115 #define PTL_RPC_MSG_REPLY 4713
117 #define PTLRPC_MSG_MAGIC 0x0BD00BD0
120 #define PTLRPC_MSG_VERSION 0x00000003
121 #define LUSTRE_VERSION_MASK 0xffff0000
122 #define LUSTRE_OBD_VERSION 0x00010000
123 #define LUSTRE_MDS_VERSION 0x00020000
124 #define LUSTRE_OST_VERSION 0x00030000
125 #define LUSTRE_DLM_VERSION 0x00040000
126 #define LUSTRE_LOG_VERSION 0x00050000
127 #define LUSTRE_MGS_VERSION 0x00060000
130 __u64 f_seq; /* holds fid sequence. Lustre should support 2 ^ 64
131 * objects, thus even if one sequence has one object we
132 * reach this value. */
133 __u32 f_oid; /* fid number within its sequence. */
134 __u32 f_ver; /* holds fid version. */
141 LUSTRE_ROOT_FID_SEQ = 1ULL, /* XXX: should go into mkfs. */
142 LUSTRE_ROOT_FID_OID = 2UL, /* XXX: should go into mkfs. */
144 /* maximal objects in sequence */
145 LUSTRE_FID_SEQ_WIDTH = 10000,
147 /* range of seqs for one MDS */
148 LUSTRE_SEQ_RANGE = 1000,
150 /* initial fid id value */
151 LUSTRE_FID_INIT_OID = 1UL,
153 /* shift of version component */
154 LUSTRE_FID_VER_SHIFT = (sizeof(((struct lu_fid *)0)->f_ver) * 8)
157 /* get object sequence */
158 static inline __u64 fid_seq(const struct lu_fid *fid)
164 static inline __u32 fid_oid(const struct lu_fid *fid)
169 /* get object version */
170 static inline __u32 fid_ver(const struct lu_fid *fid)
175 /* get complex object number (oid + version) */
176 static inline __u64 fid_num(const struct lu_fid *fid)
178 __u64 f_ver = fid_ver(fid);
179 f_ver = f_ver << LUSTRE_FID_VER_SHIFT;
180 return f_ver | fid_oid(fid);
183 static inline int fid_is_sane(const struct lu_fid *fid)
185 return fid != NULL && fid_seq(fid) != 0 && fid_oid(fid) != 0;
188 #define DFID3 "["LPU64"/%u:%u]"
195 extern void lustre_swab_lu_fid (struct lu_fid *fid);
197 static inline int lu_fid_eq(const struct lu_fid *f0,
198 const struct lu_fid *f1)
200 /* check that there is no alignment padding */
201 CLASSERT(sizeof *f0 ==
202 sizeof f0->f_seq + sizeof f0->f_oid + sizeof f0->f_ver);
203 return memcmp(f0, f1, sizeof *f0) == 0;
206 static inline void fid_cpu_to_le(struct lu_fid *fid)
208 fid->f_seq = cpu_to_le64(fid_seq(fid));
209 fid->f_oid = cpu_to_le32(fid_oid(fid));
210 fid->f_ver = cpu_to_le32(fid_ver(fid));
213 static inline void fid_le_to_cpu(struct lu_fid *fid)
215 fid->f_seq = le64_to_cpu(fid_seq(fid));
216 fid->f_oid = le32_to_cpu(fid_oid(fid));
217 fid->f_ver = le32_to_cpu(fid_ver(fid));
220 #define MEA_MAGIC_LAST_CHAR 0xb2221ca1
221 #define MEA_MAGIC_ALL_CHARS 0xb222a11c
223 struct lmv_stripe_md {
227 struct lu_fid mea_ids[0];
230 struct lustre_handle {
233 #define DEAD_HANDLE_MAGIC 0xdeadbeefcafebabeULL
235 static inline int lustre_handle_is_used(struct lustre_handle *lh)
237 return lh->cookie != 0ull;
240 static inline int lustre_handle_equal(struct lustre_handle *lh1,
241 struct lustre_handle *lh2)
243 return lh1->cookie == lh2->cookie;
246 static inline void lustre_handle_copy(struct lustre_handle *tgt,
247 struct lustre_handle *src)
249 tgt->cookie = src->cookie;
252 /* we depend on this structure to be 8-byte aligned */
253 /* this type is only endian-adjusted in lustre_unpack_msg() */
255 struct lustre_handle handle;
261 __u64 last_committed;
270 /* Flags that are operation-specific go in the top 16 bits. */
271 #define MSG_OP_FLAG_MASK 0xffff0000
272 #define MSG_OP_FLAG_SHIFT 16
274 /* Flags that apply to all requests are in the bottom 16 bits */
275 #define MSG_GEN_FLAG_MASK 0x0000ffff
276 #define MSG_LAST_REPLAY 1
280 static inline int lustre_msg_get_flags(struct lustre_msg *msg)
282 return (msg->flags & MSG_GEN_FLAG_MASK);
285 static inline void lustre_msg_add_flags(struct lustre_msg *msg, int flags)
287 msg->flags |= MSG_GEN_FLAG_MASK & flags;
290 static inline void lustre_msg_set_flags(struct lustre_msg *msg, int flags)
292 msg->flags &= ~MSG_GEN_FLAG_MASK;
293 lustre_msg_add_flags(msg, flags);
296 static inline void lustre_msg_clear_flags(struct lustre_msg *msg, int flags)
298 msg->flags &= ~(MSG_GEN_FLAG_MASK & flags);
301 static inline int lustre_msg_get_op_flags(struct lustre_msg *msg)
303 return (msg->flags >> MSG_OP_FLAG_SHIFT);
306 static inline void lustre_msg_add_op_flags(struct lustre_msg *msg, int flags)
308 msg->flags |= ((flags & MSG_GEN_FLAG_MASK) << MSG_OP_FLAG_SHIFT);
311 static inline void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags)
313 msg->flags &= ~MSG_OP_FLAG_MASK;
314 lustre_msg_add_op_flags(msg, flags);
318 * Flags for all connect opcodes (MDS_CONNECT, OST_CONNECT)
321 #define MSG_CONNECT_RECOVERING 0x1
322 #define MSG_CONNECT_RECONNECT 0x2
323 #define MSG_CONNECT_REPLAYABLE 0x4
324 //#define MSG_CONNECT_PEER 0x8
325 #define MSG_CONNECT_LIBCLIENT 0x10
326 #define MSG_CONNECT_INITIAL 0x20
327 #define MSG_CONNECT_ASYNC 0x40
330 #define OBD_CONNECT_RDONLY 0x1ULL /* client allowed read-only access */
331 #define OBD_CONNECT_INDEX 0x2ULL /* connect to specific LOV idx */
332 #define OBD_CONNECT_GRANT 0x8ULL /* OSC acquires grant at connect */
333 #define OBD_CONNECT_SRVLOCK 0x10ULL /* server takes locks for client */
334 #define OBD_CONNECT_VERSION 0x20ULL /* Server supports versions in ocd */
335 #define OBD_CONNECT_REQPORTAL 0x40ULL /* Separate portal for non-IO reqs */
336 #define OBD_CONNECT_ACL 0x80ULL /* client using access control lists */
337 #define OBD_CONNECT_XATTR 0x100ULL /* client using extended attributes*/
338 #define OBD_CONNECT_CROW 0x200ULL /* MDS+OST do object create-on-write */
339 #define OBD_CONNECT_TRUNCLOCK 0x400ULL /* server gets locks for punch b=9528 */
340 #define OBD_CONNECT_TRANSNO 0x800ULL /* replay is sending initial transno */
341 #define OBD_CONNECT_IBITS 0x1000ULL /* support for inodebits locks */
342 #define OBD_CONNECT_JOIN 0x2000ULL /* files can be concatenated */
343 #define OBD_CONNECT_REAL 0x4000ULL /* show MD stack that real connect is
345 #define OBD_CONNECT_EMPTY 0x80000000ULL /* fake: these are empty connect flags*/
346 /* also update obd_connect_names[] for lprocfs_rd_connect_flags() */
348 #define MDS_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY | OBD_CONNECT_VERSION | \
349 OBD_CONNECT_ACL | OBD_CONNECT_XATTR | \
350 OBD_CONNECT_IBITS | OBD_CONNECT_JOIN)
351 #define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
352 OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
353 OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX)
354 #define ECHO_CONNECT_SUPPORTED (0)
355 #define MGS_CONNECT_SUPPORTED (OBD_CONNECT_VERSION)
357 #define MDT_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY | OBD_CONNECT_VERSION | \
358 OBD_CONNECT_ACL | OBD_CONNECT_XATTR | \
359 OBD_CONNECT_IBITS | OBD_CONNECT_JOIN)
361 #define OBD_OCD_VERSION(major,minor,patch,fix) (((major)<<24) + ((minor)<<16) +\
362 ((patch)<<8) + (fix))
363 #define OBD_OCD_VERSION_MAJOR(version) ((int)((version)>>24)&255)
364 #define OBD_OCD_VERSION_MINOR(version) ((int)((version)>>16)&255)
365 #define OBD_OCD_VERSION_PATCH(version) ((int)((version)>>8)&255)
366 #define OBD_OCD_VERSION_FIX(version) ((int)(version)&255)
369 * OST requests: OBDO & OBD request records
374 OST_REPLY = 0, /* reply ? */
396 #define OST_FIRST_OPC OST_REPLY
398 typedef uint64_t obd_id;
399 typedef uint64_t obd_gr;
400 typedef uint64_t obd_time;
401 typedef uint64_t obd_size;
402 typedef uint64_t obd_off;
403 typedef uint64_t obd_blocks;
404 typedef uint32_t obd_blksize;
405 typedef uint32_t obd_mode;
406 typedef uint32_t obd_uid;
407 typedef uint32_t obd_gid;
408 typedef uint32_t obd_flag;
409 typedef uint64_t obd_valid;
410 typedef uint32_t obd_count;
412 #define OBD_FL_INLINEDATA (0x00000001)
413 #define OBD_FL_OBDMDEXISTS (0x00000002)
414 #define OBD_FL_DELORPHAN (0x00000004) /* if set in o_flags delete orphans */
415 #define OBD_FL_NORPC (0x00000008) /* set in o_flags do in OSC not OST */
416 #define OBD_FL_IDONLY (0x00000010) /* set in o_flags only adjust obj id*/
417 #define OBD_FL_RECREATE_OBJS (0x00000020) /* recreate missing obj */
418 #define OBD_FL_DEBUG_CHECK (0x00000040) /* echo client/server debug check */
419 #define OBD_FL_NO_USRQUOTA (0x00000100) /* the object's owner is over quota */
420 #define OBD_FL_NO_GRPQUOTA (0x00000200) /* the object's group is over quota */
421 #define OBD_FL_CREATE_CROW (0x00000400) /* object should be create on write */
424 * set this to delegate DLM locking during obd_punch() to the OSTs. Only OSTs
425 * that declared OBD_CONNECT_TRUNCLOCK in their connect flags support this
428 #define OBD_FL_TRUNCLOCK (0x00000800)
430 /* this should be not smaller than sizeof(struct lustre_handle) + sizeof(struct
431 * llog_cookie) + sizeof(lu_fid). Nevertheless struct lu_fid is not longer
432 * stored in o_inline, we keep this just for case. */
433 #define OBD_INLINESZ 80
435 /* Note: 64-bit types are 64-bit aligned in structure */
437 obd_valid o_valid; /* hot fields in this obdo */
441 obd_size o_size; /* o_size-o_blocks == ost_lvb */
445 obd_blocks o_blocks; /* brw: cli sent cached bytes */
448 /* 32-bit fields start here: keep an even number of them via padding */
449 obd_blksize o_blksize; /* optimal IO blocksize */
450 obd_mode o_mode; /* brw: cli sent cache remain */
454 obd_count o_nlink; /* brw: checksum */
455 obd_count o_generation;
456 obd_count o_misc; /* brw: o_dropped */
457 __u32 o_easize; /* epoch in ost writes */
459 __u32 o_stripe_idx; /* holds stripe idx */
461 char o_inline[OBD_INLINESZ]; /* fid in ost writes */
464 #define o_dirty o_blocks
465 #define o_undirty o_mode
466 #define o_dropped o_misc
467 #define o_cksum o_nlink
469 extern void lustre_swab_obdo (struct obdo *o);
478 struct lmv_stripe_md *mea1;
479 struct lmv_stripe_md *mea2;
482 /* part of obdo fields for md stack */
492 #define MDS_MODE_DONT_LOCK (1 << 30)
493 #define MDS_MODE_REPLAY (1 << 31)
495 #define LOV_MAGIC_V1 0x0BD10BD0
496 #define LOV_MAGIC LOV_MAGIC_V1
497 #define LOV_MAGIC_JOIN 0x0BD20BD0
499 #define LOV_PATTERN_RAID0 0x001 /* stripes are used round-robin */
500 #define LOV_PATTERN_RAID1 0x002 /* stripes are mirrors of each other */
501 #define LOV_PATTERN_FIRST 0x100 /* first stripe is not in round-robin */
502 #define LOV_PATTERN_CMOBD 0x200
504 #define lov_ost_data lov_ost_data_v1
505 struct lov_ost_data_v1 { /* per-stripe data structure (little-endian)*/
506 __u64 l_object_id; /* OST object ID */
507 __u64 l_object_gr; /* OST object group (creating MDS number) */
508 __u32 l_ost_gen; /* generation of this l_ost_idx */
509 __u32 l_ost_idx; /* OST index in LOV (lov_tgt_desc->tgts) */
512 #define lov_mds_md lov_mds_md_v1
513 struct lov_mds_md_v1 { /* LOV EA mds/wire data (little-endian) */
514 __u32 lmm_magic; /* magic number = LOV_MAGIC_V1 */
515 __u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
516 __u64 lmm_object_id; /* LOV object ID */
517 __u64 lmm_object_gr; /* LOV object group */
518 __u32 lmm_stripe_size; /* size of stripe in bytes */
519 __u32 lmm_stripe_count; /* num stripes in use for this object */
520 struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */
523 #define OBD_MD_FLID (0x0000000000000001ULL) /* object ID */
524 #define OBD_MD_FLATIME (0x0000000000000002ULL) /* access time */
525 #define OBD_MD_FLMTIME (0x0000000000000004ULL) /* data modification time */
526 #define OBD_MD_FLCTIME (0x0000000000000008ULL) /* change time */
527 #define OBD_MD_FLSIZE (0x0000000000000010ULL) /* size */
528 #define OBD_MD_FLBLOCKS (0x0000000000000020ULL) /* allocated blocks count */
529 #define OBD_MD_FLBLKSZ (0x0000000000000040ULL) /* block size */
530 #define OBD_MD_FLMODE (0x0000000000000080ULL) /* access bits (mode & ~S_IFMT) */
531 #define OBD_MD_FLTYPE (0x0000000000000100ULL) /* object type (mode & S_IFMT) */
532 #define OBD_MD_FLUID (0x0000000000000200ULL) /* user ID */
533 #define OBD_MD_FLGID (0x0000000000000400ULL) /* group ID */
534 #define OBD_MD_FLFLAGS (0x0000000000000800ULL) /* flags word */
535 #define OBD_MD_FLNLINK (0x0000000000002000ULL) /* link count */
536 #define OBD_MD_FLGENER (0x0000000000004000ULL) /* generation number */
537 #define OBD_MD_FLINLINE (0x0000000000008000ULL) /* inline data */
538 #define OBD_MD_FLRDEV (0x0000000000010000ULL) /* device number */
539 #define OBD_MD_FLEASIZE (0x0000000000020000ULL) /* extended attribute data */
540 #define OBD_MD_LINKNAME (0x0000000000040000ULL) /* symbolic link target */
541 #define OBD_MD_FLHANDLE (0x0000000000080000ULL) /* file handle */
542 #define OBD_MD_FLCKSUM (0x0000000000100000ULL) /* bulk data checksum */
543 #define OBD_MD_FLQOS (0x0000000000200000ULL) /* quality of service stats */
544 #define OBD_MD_FLOSCOPQ (0x0000000000400000ULL) /* osc opaque data */
545 #define OBD_MD_FLCOOKIE (0x0000000000800000ULL) /* log cancellation cookie */
546 #define OBD_MD_FLGROUP (0x0000000001000000ULL) /* group */
547 #define OBD_MD_FLFID (0x0000000002000000ULL) /* ->ost write inline fid */
548 #define OBD_MD_FLEPOCH (0x0000000004000000ULL) /* ->ost write easize is epoch */
549 #define OBD_MD_FLGRANT (0x0000000008000000ULL) /* ost preallocation space grant */
550 #define OBD_MD_FLDIREA (0x0000000010000000ULL) /* dir's extended attribute data */
551 #define OBD_MD_FLUSRQUOTA (0x0000000020000000ULL) /* over quota flags sent from ost */
552 #define OBD_MD_FLGRPQUOTA (0x0000000040000000ULL) /* over quota flags sent from ost */
553 #define OBD_MD_FLMODEASIZE (0x0000000080000000ULL) /* EA size will be changed */
554 #define OBD_MD_MDS (0x0000000100000000ULL) /* where an inode lives on */
555 #define OBD_MD_REINT (0x0000000200000000ULL) /* reintegrate oa */
556 #define OBD_MD_MEA (0x0000000400000000ULL) /* CMD EA */
558 #define OBD_MD_FLXATTR (0x0000001000000000ULL) /* xattr */
559 #define OBD_MD_FLXATTRLS (0x0000002000000000ULL) /* xattr list */
560 #define OBD_MD_FLXATTRRM (0x0000004000000000ULL) /* xattr remove */
561 #define OBD_MD_FLACL (0x0000008000000000ULL) /* ACL */
563 #define OBD_MD_FLGETATTR (OBD_MD_FLID | OBD_MD_FLATIME | OBD_MD_FLMTIME | \
564 OBD_MD_FLCTIME | OBD_MD_FLSIZE | OBD_MD_FLBLKSZ | \
565 OBD_MD_FLMODE | OBD_MD_FLTYPE | OBD_MD_FLUID | \
566 OBD_MD_FLGID | OBD_MD_FLFLAGS | OBD_MD_FLNLINK | \
567 OBD_MD_FLGENER | OBD_MD_FLRDEV | OBD_MD_FLGROUP)
569 static inline struct lustre_handle *obdo_handle(struct obdo *oa)
571 return (struct lustre_handle *)oa->o_inline;
574 static inline struct llog_cookie *obdo_logcookie(struct obdo *oa)
576 return (struct llog_cookie *)(oa->o_inline +
577 sizeof(struct lustre_handle));
579 /* don't forget obdo_fid which is way down at the bottom so it can
580 * come after the definition of llog_cookie */
593 __u32 os_state; /* positive error code on server */
605 extern void lustre_swab_obd_statfs (struct obd_statfs *os);
607 /* ost_body.data values for OST_BRW */
609 #define OBD_BRW_READ 0x01
610 #define OBD_BRW_WRITE 0x02
611 #define OBD_BRW_RWMASK (OBD_BRW_READ | OBD_BRW_WRITE)
612 #define OBD_BRW_SYNC 0x08
613 #define OBD_BRW_CHECK 0x10
614 #define OBD_BRW_FROM_GRANT 0x20 /* the osc manages this under llite */
615 #define OBD_BRW_GRANTED 0x40 /* the ost manages this */
616 #define OBD_BRW_DROP 0x80 /* drop the page after IO */
617 #define OBD_BRW_NOQUOTA 0x100
618 #define OBD_BRW_SRVLOCK 0x200 /* Client holds no lock over this page */
620 #define OBD_OBJECT_EOF 0xffffffffffffffffULL
622 #define OST_MIN_PRECREATE 32
623 #define OST_MAX_PRECREATE 20000
632 extern void lustre_swab_obd_ioobj (struct obd_ioobj *ioo);
634 /* multiple of 8 bytes => can array */
635 struct niobuf_remote {
641 extern void lustre_swab_niobuf_remote (struct niobuf_remote *nbr);
643 /* request structure for OST's */
649 extern void lustre_swab_ost_body (struct ost_body *b);
650 extern void lustre_swab_ost_last_id(obd_id *id);
651 extern void lustre_swab_generic_32s(__u32 *val);
653 /* lock value block communicated between the filter and llite */
663 extern void lustre_swab_ost_lvb(struct ost_lvb *);
669 /* FIXME: this is different from HEAD, adjust it
671 #define MDS_REQ_REC_OFF 0
673 #define MDS_REQ_INTENT_LOCKREQ_OFF 0
674 #define MDS_REQ_INTENT_IT_OFF 1
675 #define MDS_REQ_INTENT_REC_OFF 2
680 MDS_GETATTR_NAME = 34,
691 MDS_DONE_WRITING = 45,
700 #define MDS_FIRST_OPC MDS_GETATTR
716 } mds_reint_t,mdt_reint_t;
718 /* the disposition of the intent outlines what was executed */
719 #define DISP_IT_EXECD 0x01
720 #define DISP_LOOKUP_EXECD 0x02
721 #define DISP_LOOKUP_NEG 0x04
722 #define DISP_LOOKUP_POS 0x08
723 #define DISP_OPEN_CREATE 0x10
724 #define DISP_OPEN_OPEN 0x20
725 #define DISP_ENQ_COMPLETE 0x40
727 /* INODE LOCK PARTS */
728 #define MDS_INODELOCK_LOOKUP 0x000001 /* dentry, mode, owner, group */
729 #define MDS_INODELOCK_UPDATE 0x000002 /* size, links, timestamps */
730 #define MDS_INODELOCK_OPEN 0x000004 /* For opened files */
732 /* Do not forget to increase MDS_INODELOCK_MAXSHIFT when adding new bits */
733 #define MDS_INODELOCK_MAXSHIFT 2
734 /* This FULL lock is useful to take on unlink sort of operations */
735 #define MDS_INODELOCK_FULL ((1<<(MDS_INODELOCK_MAXSHIFT+1))-1)
737 #define LUSTRE_CONFIG_SET 0
738 #define LUSTRE_CONFIG_GET 1
740 #define LUSTRE_CONFIG_METASEQ "metaseq"
741 #define LUSTRE_CONFIG_TRANSNO "transno"
743 /* temporary stuff for compatibility */
745 __u64 id; /* holds object id */
746 __u32 generation; /* holds object generation */
748 __u32 f_type; /* holds object type or stripe idx when passing it to
749 * OST for saving into EA. */
753 extern void lustre_swab_ll_fid (struct ll_fid *fid);
754 /* This structure is used for both request and reply.
756 * If we eventually have separate connect data for different types, which we
757 * almost certainly will, then perhaps we stick a union in here. */
758 struct obd_connect_data {
759 __u64 ocd_connect_flags; /* OBD_CONNECT_* per above */
760 __u32 ocd_version; /* lustre release version number */
761 __u32 ocd_grant; /* initial cache grant amount (bytes) */
762 __u32 ocd_index; /* LOV index to connect to */
764 __u64 ocd_ibits_known; /* inode bits this client understands */
765 __u64 ocd_seq; /* sequence info for client */
766 __u64 padding2; /* also fix lustre_swab_connect */
767 __u64 padding3; /* also fix lustre_swab_connect */
768 __u64 padding4; /* also fix lustre_swab_connect */
769 __u64 padding5; /* also fix lustre_swab_connect */
772 extern void lustre_swab_connect(struct obd_connect_data *ocd);
774 #define MDS_STATUS_CONN 1
775 #define MDS_STATUS_LOV 2
777 struct mds_status_req {
782 extern void lustre_swab_mds_status_req (struct mds_status_req *r);
784 #define MDS_BFLAG_UNCOMMITTED_WRITES 0x1
789 struct lustre_handle handle;
791 __u64 size; /* Offset, in the case of MDS_READPAGE */
795 __u64 blocks; /* XID, in the case of MDS_READPAGE */
803 __u32 flags; /* from vfs for pin/unpin, MDS_BFLAG for close */
805 __u32 nlink; /* #bytes to read in the case of MDS_READPAGE */
810 __u32 max_cookiesize; /* also fix lustre_swab_mdt_body */
816 struct lustre_handle handle;
818 __u64 size; /* Offset, in the case of MDS_READPAGE */
822 __u64 blocks; /* XID, in the case of MDS_READPAGE */
831 __u32 flags; /* from vfs for pin/unpin, MDS_BFLAG for close */
833 __u32 nlink; /* #bytes to read in the case of MDS_READPAGE */
839 __u32 max_cookiesize; /* also fix lustre_swab_mds_body */
840 __u32 padding_4; /* also fix lustre_swab_mds_body */
843 extern void lustre_swab_mds_body (struct mds_body *b);
844 extern void lustre_swab_mdt_body (struct mdt_body *b);
847 struct mdt_body *body;
848 struct lov_stripe_md *lsm;
849 struct lmv_stripe_md *mea;
850 #ifdef CONFIG_FS_POSIX_ACL
851 struct posix_acl *posix_acl;
855 #define Q_QUOTACHECK 0x800100
856 #define Q_INITQUOTA 0x800101 /* init slave limits */
857 #define Q_GETOINFO 0x800102 /* get obd quota info */
858 #define Q_GETOQUOTA 0x800103 /* get obd quotas */
860 #define Q_TYPESET(oqc, type) \
861 ((oqc)->qc_type == type || (oqc)->qc_type == UGQUOTA)
863 #define Q_GETOCMD(oqc) \
864 ((oqc)->qc_cmd == Q_GETOINFO || (oqc)->qc_cmd == Q_GETOQUOTA)
866 struct obd_quotactl {
871 struct obd_dqinfo qc_dqinfo;
872 struct obd_dqblk qc_dqblk;
875 extern void lustre_swab_obd_quotactl(struct obd_quotactl *q);
877 struct mds_rec_setattr {
884 struct ll_fid sa_fid;
893 __u32 sa_padding; /* also fix lustre_swab_mds_rec_setattr */
896 extern void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa);
898 struct mdt_rec_setattr {
905 struct lu_fid sa_fid;
914 __u32 sa_padding; /* also fix lustre_swab_mds_rec_setattr */
917 extern void lustre_swab_mdt_rec_setattr (struct mdt_rec_setattr *sa);
919 /* Remove this once we declare it in include/linux/fs.h (v21 kernel patch?) */
920 #ifndef ATTR_CTIME_SET
921 #define ATTR_CTIME_SET 0x2000
925 #define FMODE_READ 00000001
926 #define FMODE_WRITE 00000002
928 #define MDS_FMODE_EXEC 00000004
929 #define MDS_OPEN_CREAT 00000100
930 #define MDS_OPEN_EXCL 00000200
931 #define MDS_OPEN_TRUNC 00001000
932 #define MDS_OPEN_APPEND 00002000
933 #define MDS_OPEN_SYNC 00010000
934 #define MDS_OPEN_DIRECTORY 00200000
936 #define MDS_OPEN_DELAY_CREATE 0100000000 /* delay initial object create */
937 #define MDS_OPEN_OWNEROVERRIDE 0200000000 /* NFSD rw-reopen ro file for owner */
938 #define MDS_OPEN_JOIN_FILE 0400000000 /* open for join file*/
939 #define MDS_OPEN_HAS_EA 010000000000 /* specify object create pattern */
940 #define MDS_OPEN_HAS_OBJS 020000000000 /* Just set the EA the obj exist */
942 struct mds_rec_join {
943 struct ll_fid jr_fid;
947 extern void lustre_swab_mds_rec_join (struct mds_rec_join *jr);
949 struct mdt_rec_join {
950 struct lu_fid jr_fid;
954 extern void lustre_swab_mdt_rec_join (struct mdt_rec_join *jr);
956 struct mds_rec_create {
961 __u32 cr_flags; /* for use with open */
963 struct ll_fid cr_fid;
964 struct ll_fid cr_replayfid;
968 __u32 cr_padding_1; /* also fix lustre_swab_mds_rec_create */
969 __u32 cr_padding_2; /* also fix lustre_swab_mds_rec_create */
970 __u32 cr_padding_3; /* also fix lustre_swab_mds_rec_create */
971 __u32 cr_padding_4; /* also fix lustre_swab_mds_rec_create */
972 __u32 cr_padding_5; /* also fix lustre_swab_mds_rec_create */
975 extern void lustre_swab_mds_rec_create (struct mds_rec_create *cr);
977 struct mdt_rec_create {
982 __u32 cr_flags; /* for use with open */
984 struct lu_fid cr_fid1;
985 struct lu_fid cr_fid2;
989 __u32 cr_padding_1; /* also fix lustre_swab_mds_rec_create */
990 __u32 cr_padding_2; /* also fix lustre_swab_mds_rec_create */
991 __u32 cr_padding_3; /* also fix lustre_swab_mds_rec_create */
992 __u32 cr_padding_4; /* also fix lustre_swab_mds_rec_create */
993 __u32 cr_padding_5; /* also fix lustre_swab_mds_rec_create */
996 extern void lustre_swab_mdt_rec_create (struct mdt_rec_create *cr);
998 struct mds_rec_link {
1005 struct ll_fid lk_fid1;
1006 struct ll_fid lk_fid2;
1008 __u32 lk_padding_1; /* also fix lustre_swab_mds_rec_link */
1009 __u32 lk_padding_2; /* also fix lustre_swab_mds_rec_link */
1010 __u32 lk_padding_3; /* also fix lustre_swab_mds_rec_link */
1011 __u32 lk_padding_4; /* also fix lustre_swab_mds_rec_link */
1014 extern void lustre_swab_mds_rec_link (struct mds_rec_link *lk);
1016 struct mdt_rec_link {
1023 struct lu_fid lk_fid1;
1024 struct lu_fid lk_fid2;
1026 __u32 lk_padding_1; /* also fix lustre_swab_mds_rec_link */
1027 __u32 lk_padding_2; /* also fix lustre_swab_mds_rec_link */
1028 __u32 lk_padding_3; /* also fix lustre_swab_mds_rec_link */
1029 __u32 lk_padding_4; /* also fix lustre_swab_mds_rec_link */
1032 extern void lustre_swab_mdt_rec_link (struct mdt_rec_link *lk);
1034 struct mds_rec_unlink {
1041 struct ll_fid ul_fid1;
1042 struct ll_fid ul_fid2;
1044 __u32 ul_padding_1; /* also fix lustre_swab_mds_rec_unlink */
1045 __u32 ul_padding_2; /* also fix lustre_swab_mds_rec_unlink */
1046 __u32 ul_padding_3; /* also fix lustre_swab_mds_rec_unlink */
1047 __u32 ul_padding_4; /* also fix lustre_swab_mds_rec_unlink */
1050 extern void lustre_swab_mds_rec_unlink (struct mds_rec_unlink *ul);
1052 struct mdt_rec_unlink {
1059 struct lu_fid ul_fid1;
1060 struct lu_fid ul_fid2;
1062 __u32 ul_padding_1; /* also fix lustre_swab_mds_rec_unlink */
1063 __u32 ul_padding_2; /* also fix lustre_swab_mds_rec_unlink */
1064 __u32 ul_padding_3; /* also fix lustre_swab_mds_rec_unlink */
1065 __u32 ul_padding_4; /* also fix lustre_swab_mds_rec_unlink */
1068 extern void lustre_swab_mdt_rec_unlink (struct mdt_rec_unlink *ul);
1070 struct mds_rec_rename {
1077 struct ll_fid rn_fid1;
1078 struct ll_fid rn_fid2;
1080 __u32 rn_padding_1; /* also fix lustre_swab_mds_rec_rename */
1081 __u32 rn_padding_2; /* also fix lustre_swab_mds_rec_rename */
1082 __u32 rn_padding_3; /* also fix lustre_swab_mds_rec_rename */
1083 __u32 rn_padding_4; /* also fix lustre_swab_mds_rec_rename */
1086 extern void lustre_swab_mds_rec_rename (struct mds_rec_rename *rn);
1088 struct mdt_rec_rename {
1095 struct lu_fid rn_fid1;
1096 struct lu_fid rn_fid2;
1098 __u32 rn_padding_1; /* also fix lustre_swab_mds_rec_rename */
1099 __u32 rn_padding_2; /* also fix lustre_swab_mds_rec_rename */
1100 __u32 rn_padding_3; /* also fix lustre_swab_mds_rec_rename */
1101 __u32 rn_padding_4; /* also fix lustre_swab_mds_rec_rename */
1104 extern void lustre_swab_mdt_rec_rename (struct mdt_rec_rename *rn);
1107 * LOV data structures
1110 #define LOV_MIN_STRIPE_SIZE 65536 /* maximum PAGE_SIZE (ia64), power of 2 */
1111 #define LOV_MAX_STRIPE_COUNT 160 /* until bug 4424 is fixed */
1113 #define LOV_MAX_UUID_BUFFER_SIZE 8192
1114 /* The size of the buffer the lov/mdc reserves for the
1115 * array of UUIDs returned by the MDS. With the current
1116 * protocol, this will limit the max number of OSTs per LOV */
1118 #define LOV_DESC_MAGIC 0xB0CCDE5C
1121 __u32 ld_tgt_count; /* how many OBD's */
1122 __u32 ld_active_tgt_count; /* how many active */
1123 __u32 ld_default_stripe_count; /* how many objects are used */
1124 __u32 ld_pattern; /* PATTERN_RAID0, PATTERN_RAID1 */
1125 __u64 ld_default_stripe_size; /* in bytes */
1126 __u64 ld_default_stripe_offset; /* in bytes */
1127 __u32 ld_padding_1; /* also fix lustre_swab_lov_desc */
1128 __u32 ld_padding_2; /* also fix lustre_swab_lov_desc */
1129 __u32 ld_padding_3; /* also fix lustre_swab_lov_desc */
1130 __u32 ld_padding_4; /* also fix lustre_swab_lov_desc */
1131 struct obd_uuid ld_uuid;
1134 #define ld_magic ld_active_tgt_count /* for swabbing from llogs */
1136 /*begin adding MDT by huanghua@clusterfs.com*/
1138 __u32 ld_tgt_count; /* how many MDS's */
1139 __u32 ld_active_tgt_count; /* how many active */
1140 struct obd_uuid ld_uuid;
1143 extern void lustre_swab_lmv_desc (struct lmv_desc *ld);
1144 /*end adding MDT by huanghua@clusterfs.com*/
1150 extern void lustre_swab_md_fld (struct md_fld *mf);
1151 extern void lustre_swab_lov_desc (struct lov_desc *ld);
1156 /* opcodes -- MUST be distinct from OST/MDS opcodes */
1161 LDLM_BL_CALLBACK = 104,
1162 LDLM_CP_CALLBACK = 105,
1163 LDLM_GL_CALLBACK = 106,
1166 #define LDLM_FIRST_OPC LDLM_ENQUEUE
1168 #define RES_NAME_SIZE 4
1169 struct ldlm_res_id {
1170 __u64 name[RES_NAME_SIZE];
1173 extern void lustre_swab_ldlm_res_id (struct ldlm_res_id *id);
1196 #define LDLM_MIN_TYPE LDLM_PLAIN
1198 struct ldlm_extent {
1204 struct ldlm_inodebits {
1211 __u64 blocking_export; /* not actually used over the wire */
1212 __u32 blocking_pid; /* not actually used over the wire */
1216 /* it's important that the fields of the ldlm_extent structure match
1217 * the first fields of the ldlm_flock structure because there is only
1218 * one ldlm_swab routine to process the ldlm_policy_data_t union. if
1219 * this ever changes we will need to swab the union differently based
1220 * on the resource type. */
1223 struct ldlm_extent l_extent;
1224 struct ldlm_flock l_flock;
1225 struct ldlm_inodebits l_inodebits;
1226 } ldlm_policy_data_t;
1228 extern void lustre_swab_ldlm_policy_data (ldlm_policy_data_t *d);
1230 struct ldlm_intent {
1234 extern void lustre_swab_ldlm_intent (struct ldlm_intent *i);
1236 struct ldlm_resource_desc {
1237 ldlm_type_t lr_type;
1238 __u32 lr_padding; /* also fix lustre_swab_ldlm_resource_desc */
1239 struct ldlm_res_id lr_name;
1242 extern void lustre_swab_ldlm_resource_desc (struct ldlm_resource_desc *r);
1244 struct ldlm_lock_desc {
1245 struct ldlm_resource_desc l_resource;
1246 ldlm_mode_t l_req_mode;
1247 ldlm_mode_t l_granted_mode;
1248 ldlm_policy_data_t l_policy_data;
1251 extern void lustre_swab_ldlm_lock_desc (struct ldlm_lock_desc *l);
1253 struct ldlm_request {
1255 __u32 lock_padding; /* also fix lustre_swab_ldlm_request */
1256 struct ldlm_lock_desc lock_desc;
1257 struct lustre_handle lock_handle1;
1258 struct lustre_handle lock_handle2;
1261 extern void lustre_swab_ldlm_request (struct ldlm_request *rq);
1265 __u32 lock_padding; /* also fix lustre_swab_ldlm_reply */
1266 struct ldlm_lock_desc lock_desc;
1267 struct lustre_handle lock_handle;
1268 __u64 lock_policy_res1;
1269 __u64 lock_policy_res2;
1272 extern void lustre_swab_ldlm_reply (struct ldlm_reply *r);
1276 * Opcodes for mountconf (mgs and mgc)
1281 MGS_EXCEPTION, /* node died, etc. */
1282 MGS_TARGET_REG, /* whenever target starts up */
1287 #define MTI_NAME_MAXLEN 64
1288 #define MTI_UUID_MAXLEN MTI_NAME_MAXLEN + 5
1289 /* each host can have multiple nids, and multiple failover hosts, and I don't
1290 want to run out of room... */
1291 #define MTI_NIDS_MAX 64 /* match lustre_disk.h */
1293 struct mgs_target_info {
1294 char mti_fsname[MTI_NAME_MAXLEN];
1295 char mti_svname[MTI_NAME_MAXLEN];
1296 char mti_uuid[sizeof(struct obd_uuid)];
1297 lnet_nid_t mti_nids[MTI_NIDS_MAX]; /* host nids */
1298 lnet_nid_t mti_failnids[MTI_NIDS_MAX]; /* partner nids */
1299 __u16 mti_failnodes[8]; /* last nid index of each partner */
1300 __u32 mti_stripe_index;
1301 __u32 mti_nid_count;
1302 __u32 mti_failnid_count;
1303 __u32 mti_config_ver;
1305 char mti_params[2048];
1308 extern void lustre_swab_mgs_target_info(struct mgs_target_info *oinfo);
1310 #define CM_START 0x01
1312 #define CM_SKIP 0x04
1313 #define CM_UPGRADE146 0x08
1314 #define CM_START_SKIP (CM_START | CM_SKIP)
1317 __u32 cm_step; /* aka config version */
1319 time_t cm_createtime; /*when this record was first created */
1320 time_t cm_canceltime; /*when this record is no longer valid*/
1322 char cm_comment[40];
1326 * Opcodes for multiple servers.
1335 #define OBD_FIRST_OPC OBD_PING
1337 /* catalog of log objects */
1339 /* Records written to the CATALOGS list */
1340 #define CATLIST "CATALOGS"
1342 struct llog_logid lci_logid;
1346 } __attribute__((packed));
1349 /*join file lov mds md*/
1350 struct lov_mds_md_join {
1351 struct lov_mds_md lmmj_md;
1352 /*join private info*/
1353 struct llog_logid lmmj_array_id; /*array object id*/
1354 __u32 lmmj_extent_count; /*array extent count*/
1357 /* Log data record types - there is no specific reason that these need to
1358 * be related to the RPC opcodes, but no reason not to (may be handy later?)
1360 #define LLOG_OP_MAGIC 0x10600000
1361 #define LLOG_OP_MASK 0xfff00000
1364 LLOG_PAD_MAGIC = LLOG_OP_MAGIC | 0,
1365 OST_SZ_REC = LLOG_OP_MAGIC | (OST_SAN_WRITE << 8),
1366 OST_RAID1_REC = LLOG_OP_MAGIC | ((OST_SAN_WRITE + 1) << 8),
1367 MDS_UNLINK_REC = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_UNLINK,
1368 MDS_SETATTR_REC = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_SETATTR,
1369 OBD_CFG_REC = LLOG_OP_MAGIC | 0x20000,
1370 PTL_CFG_REC = LLOG_OP_MAGIC | 0x30000, /* obsolete */
1371 LLOG_GEN_REC = LLOG_OP_MAGIC | 0x40000,
1372 LLOG_JOIN_REC = LLOG_OP_MAGIC | 0x50000,
1373 LLOG_HDR_MAGIC = LLOG_OP_MAGIC | 0x45539,
1374 LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b,
1378 * for now, continue to support old pad records which have 0 for their
1379 * type but still need to be swabbed for their length
1381 #define LLOG_REC_HDR_NEEDS_SWABBING(r) \
1382 (((r)->lrh_type & __swab32(LLOG_OP_MASK)) == \
1383 __swab32(LLOG_OP_MAGIC) || \
1384 (((r)->lrh_type == 0) && ((r)->lrh_len > LLOG_CHUNK_SIZE)))
1386 /* Log record header - stored in little endian order.
1387 * Each record must start with this struct, end with a llog_rec_tail,
1388 * and be a multiple of 256 bits in size.
1390 struct llog_rec_hdr {
1397 struct llog_rec_tail {
1402 struct llog_logid_rec {
1403 struct llog_rec_hdr lid_hdr;
1404 struct llog_logid lid_id;
1410 struct llog_rec_tail lid_tail;
1411 } __attribute__((packed));
1413 /* MDS extent description
1414 * It is for joined file extent info, each extent info for joined file
1415 * just like (start, end, lmm).
1417 struct mds_extent_desc {
1418 __u64 med_start; /* extent start */
1419 __u64 med_len; /* extent length */
1420 struct lov_mds_md med_lmm; /* extent's lmm */
1422 /*Joined file array extent log record*/
1423 struct llog_array_rec {
1424 struct llog_rec_hdr lmr_hdr;
1425 struct mds_extent_desc lmr_med;
1426 struct llog_rec_tail lmr_tail;
1429 struct llog_create_rec {
1430 struct llog_rec_hdr lcr_hdr;
1431 struct ll_fid lcr_fid;
1435 struct llog_rec_tail lcr_tail;
1436 } __attribute__((packed));
1438 struct llog_orphan_rec {
1439 struct llog_rec_hdr lor_hdr;
1443 struct llog_rec_tail lor_tail;
1444 } __attribute__((packed));
1446 struct llog_unlink_rec {
1447 struct llog_rec_hdr lur_hdr;
1451 struct llog_rec_tail lur_tail;
1452 } __attribute__((packed));
1454 struct llog_setattr_rec {
1455 struct llog_rec_hdr lsr_hdr;
1461 struct llog_rec_tail lsr_tail;
1462 } __attribute__((packed));
1464 struct llog_size_change_rec {
1465 struct llog_rec_hdr lsc_hdr;
1466 struct ll_fid lsc_fid;
1469 struct llog_rec_tail lsc_tail;
1470 } __attribute__((packed));
1475 } __attribute__((packed));
1477 struct llog_gen_rec {
1478 struct llog_rec_hdr lgr_hdr;
1479 struct llog_gen lgr_gen;
1480 struct llog_rec_tail lgr_tail;
1482 /* On-disk header structure of each log object, stored in little endian order */
1483 #define LLOG_CHUNK_SIZE 8192
1484 #define LLOG_HEADER_SIZE (96)
1485 #define LLOG_BITMAP_BYTES (LLOG_CHUNK_SIZE - LLOG_HEADER_SIZE)
1487 #define LLOG_MIN_REC_SIZE (24) /* round(llog_rec_hdr + llog_rec_tail) */
1489 /* flags for the logs */
1490 #define LLOG_F_ZAP_WHEN_EMPTY 0x1
1491 #define LLOG_F_IS_CAT 0x2
1492 #define LLOG_F_IS_PLAIN 0x4
1494 struct llog_log_hdr {
1495 struct llog_rec_hdr llh_hdr;
1496 __u64 llh_timestamp;
1498 __u32 llh_bitmap_offset;
1502 /* for a catalog the first plain slot is next to it */
1503 struct obd_uuid llh_tgtuuid;
1504 __u32 llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32) - 23];
1505 __u32 llh_bitmap[LLOG_BITMAP_BYTES/sizeof(__u32)];
1506 struct llog_rec_tail llh_tail;
1507 } __attribute__((packed));
1509 #define LLOG_BITMAP_SIZE(llh) ((llh->llh_hdr.lrh_len - \
1510 llh->llh_bitmap_offset - \
1511 sizeof(llh->llh_tail)) * 8)
1513 /* log cookies are used to reference a specific log file and a record therein */
1514 struct llog_cookie {
1515 struct llog_logid lgc_lgl;
1519 } __attribute__((packed));
1522 enum llogd_rpc_ops {
1523 LLOG_ORIGIN_HANDLE_CREATE = 501,
1524 LLOG_ORIGIN_HANDLE_NEXT_BLOCK = 502,
1525 LLOG_ORIGIN_HANDLE_READ_HEADER = 503,
1526 LLOG_ORIGIN_HANDLE_WRITE_REC = 504,
1527 LLOG_ORIGIN_HANDLE_CLOSE = 505,
1528 LLOG_ORIGIN_CONNECT = 506,
1529 LLOG_CATINFO = 507, /* for lfs catinfo */
1530 LLOG_ORIGIN_HANDLE_PREV_BLOCK = 508,
1531 LLOG_ORIGIN_HANDLE_DESTROY = 509, /* for destroy llog object*/
1538 FLD_FIRST_OPC = FLD_QUERY
1542 struct llog_logid lgd_logid;
1544 __u32 lgd_llh_flags;
1546 __u32 lgd_saved_index;
1548 __u64 lgd_cur_offset;
1549 } __attribute__((packed));
1551 struct llogd_conn_body {
1552 struct llog_gen lgdc_gen;
1553 struct llog_logid lgdc_logid;
1554 __u32 lgdc_ctxt_idx;
1555 } __attribute__((packed));
1557 extern void lustre_swab_lov_user_md(struct lov_user_md *lum);
1558 extern void lustre_swab_lov_user_md_objects(struct lov_user_md *lum);
1559 extern void lustre_swab_lov_user_md_join(struct lov_user_md_join *lumj);
1562 extern void lustre_swab_llogd_body (struct llogd_body *d);
1563 extern void lustre_swab_llog_hdr (struct llog_log_hdr *h);
1564 extern void lustre_swab_llogd_conn_body (struct llogd_conn_body *d);
1565 extern void lustre_swab_llog_rec(struct llog_rec_hdr *rec,
1566 struct llog_rec_tail *tail);
1569 extern void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg);
1573 __u32 qd_id; /* ID appiles to (uid, gid) */
1574 __u32 qd_type; /* Quota type (USRQUOTA, GRPQUOTA) */
1575 __u32 qd_count; /* acquire/release count (bytes for block quota) */
1576 __u32 qd_isblk; /* Block quota or file quota */
1578 extern void lustre_swab_qdata(struct qunit_data *d);
1585 #define JOIN_FILE_ALIGN 4096