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. Structs
9 * that are used in interfaces with userspace should go in lustre_user.h.
11 * All structs being declared here should be built from simple fixed-size
12 * types (__u8, __u16, __u32, __u64) or be built from other types or
13 * structs also declared in this file. Similarly, all flags and magic
14 * values in those structs should also be declared here. This ensures
15 * that the Lustre wire protocol is not influenced by external dependencies.
17 * The only other acceptable items in this file are VERY SIMPLE accessor
18 * functions to avoid callers grubbing inside the structures, and the
19 * prototypes of the swabber functions for each struct. Nothing that
20 * depends on external functions or definitions should be in here.
22 * Structs must be properly aligned to put 64-bit values on an 8-byte
23 * boundary. Any structs being added here must also be added to
24 * utils/wirecheck.c and "make newwiretest" run to regenerate the
25 * utils/wiretest.c sources. This allows us to verify that wire structs
26 * have the proper alignment/size on all architectures.
28 * DO NOT CHANGE any of the structs, flags, values declared here and used
29 * in released Lustre versions. Some structs may have padding fields that
30 * can be used. Some structs might allow addition at the end (verify this
31 * in the code to ensure that new/old clients that see this larger struct
32 * do not fail, otherwise you need to implement protocol compatibility).
34 * We assume all nodes are either little-endian or big-endian, and we
35 * always send messages in the sender's native format. The receiver
36 * detects the message format by checking the 'magic' field of the message
37 * (see lustre_msg_swabbed() below).
39 * Each wire type has corresponding 'lustre_swab_xxxtypexxx()' routines,
40 * implemented either here, inline (trivial implementations) or in
41 * ptlrpc/pack_generic.c. These 'swabbers' convert the type from "other"
42 * endian, in-place in the message buffer.
44 * A swabber takes a single pointer argument. The caller must already have
45 * verified that the length of the message buffer >= sizeof (type).
47 * For variable length types, a second 'lustre_swab_v_xxxtypexxx()' routine
48 * may be defined that swabs just the variable part, after the caller has
49 * verified that the message buffer is large enough.
52 #ifndef _LUSTRE_IDL_H_
53 #define _LUSTRE_IDL_H_
55 #if defined(__linux__)
56 #include <linux/lustre_types.h>
57 #elif defined(__APPLE__)
58 #include <darwin/lustre_types.h>
59 #elif defined(__WINNT__)
60 #include <winnt/lustre_types.h>
62 #error Unsupported operating system.
65 /* Defn's shared with user-space. */
66 #include <lustre/lustre_user.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_REQUEST_PORTAL 3
87 #define OSC_REPLY_PORTAL 4
88 //#define OSC_BULK_PORTAL 5
89 #define OST_IO_PORTAL 6
90 #define OST_CREATE_PORTAL 7
91 #define OST_BULK_PORTAL 8
92 //#define MDC_REQUEST_PORTAL 9
93 #define MDC_REPLY_PORTAL 10
94 //#define MDC_BULK_PORTAL 11
95 #define MDS_REQUEST_PORTAL 12
96 //#define MDS_REPLY_PORTAL 13
97 #define MDS_BULK_PORTAL 14
98 #define LDLM_CB_REQUEST_PORTAL 15
99 #define LDLM_CB_REPLY_PORTAL 16
100 #define LDLM_CANCEL_REQUEST_PORTAL 17
101 #define LDLM_CANCEL_REPLY_PORTAL 18
102 //#define PTLBD_REQUEST_PORTAL 19
103 //#define PTLBD_REPLY_PORTAL 20
104 //#define PTLBD_BULK_PORTAL 21
105 #define MDS_SETATTR_PORTAL 22
106 #define MDS_READPAGE_PORTAL 23
108 #define MGC_REPLY_PORTAL 25
109 #define MGS_REQUEST_PORTAL 26
110 #define MGS_REPLY_PORTAL 27
111 #define OST_REQUEST_PORTAL 28
116 #define SVC_RUNNING 8
117 #define SVC_STOPPING 16
118 #define SVC_STOPPED 32
121 #define PTL_RPC_MSG_REQUEST 4711
122 #define PTL_RPC_MSG_ERR 4712
123 #define PTL_RPC_MSG_REPLY 4713
125 /* DON'T use swabbed values of MAGIC as magic! */
126 #define LUSTRE_MSG_MAGIC_V1 0x0BD00BD0
127 #define LUSTRE_MSG_MAGIC_V2 0x0BD00BD3
129 #define LUSTRE_MSG_MAGIC_V1_SWABBED 0xD00BD00B
130 #define LUSTRE_MSG_MAGIC_V2_SWABBED 0xD30BD00B
132 #define LUSTRE_MSG_MAGIC LUSTRE_MSG_MAGIC_V2
134 #define PTLRPC_MSG_VERSION 0x00000003
135 #define LUSTRE_VERSION_MASK 0xffff0000
136 #define LUSTRE_OBD_VERSION 0x00010000
137 #define LUSTRE_MDS_VERSION 0x00020000
138 #define LUSTRE_OST_VERSION 0x00030000
139 #define LUSTRE_DLM_VERSION 0x00040000
140 #define LUSTRE_LOG_VERSION 0x00050000
141 #define LUSTRE_MGS_VERSION 0x00060000
143 struct lustre_handle {
146 #define DEAD_HANDLE_MAGIC 0xdeadbeefcafebabeULL
148 static inline int lustre_handle_is_used(struct lustre_handle *lh)
150 return lh->cookie != 0ull;
153 static inline int lustre_handle_equal(struct lustre_handle *lh1,
154 struct lustre_handle *lh2)
156 return lh1->cookie == lh2->cookie;
159 static inline void lustre_handle_copy(struct lustre_handle *tgt,
160 struct lustre_handle *src)
162 tgt->cookie = src->cookie;
165 /* we depend on this structure to be 8-byte aligned */
166 /* this type is only endian-adjusted in lustre_unpack_msg() */
167 struct lustre_msg_v1 {
168 struct lustre_handle lm_handle;
174 __u64 lm_last_committed;
183 #define lustre_msg lustre_msg_v2
184 /* we depend on this structure to be 8-byte aligned */
185 /* this type is only endian-adjusted in lustre_unpack_msg() */
186 struct lustre_msg_v2 {
198 /* without security, ptlrpc_body is put in the first buffer. */
200 struct lustre_handle pb_handle;
207 __u64 pb_last_committed;
219 extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
221 /* message body offset for lustre_msg_v2 */
222 /* ptlrpc body offset in all request/reply messages */
223 #define MSG_PTLRPC_BODY_OFF 0
225 /* normal request/reply message record offset */
226 #define REQ_REC_OFF 1
227 #define REPLY_REC_OFF 1
229 /* ldlm request message body offset */
230 #define DLM_LOCKREQ_OFF 1 /* lockreq offset */
231 #define DLM_REQ_REC_OFF 2 /* normal dlm request record offset */
233 /* ldlm intent lock message body offset */
234 #define DLM_INTENT_IT_OFF 2 /* intent lock it offset */
235 #define DLM_INTENT_REC_OFF 3 /* intent lock record offset */
237 /* ldlm reply message body offset */
238 #define DLM_LOCKREPLY_OFF 1 /* lockrep offset */
239 #define DLM_REPLY_REC_OFF 2 /* reply record offset */
241 /* Flags that are operation-specific go in the top 16 bits. */
242 #define MSG_OP_FLAG_MASK 0xffff0000
243 #define MSG_OP_FLAG_SHIFT 16
245 /* Flags that apply to all requests are in the bottom 16 bits */
246 #define MSG_GEN_FLAG_MASK 0x0000ffff
247 #define MSG_LAST_REPLAY 1
252 * Flags for all connect opcodes (MDS_CONNECT, OST_CONNECT)
255 #define MSG_CONNECT_RECOVERING 0x1
256 #define MSG_CONNECT_RECONNECT 0x2
257 #define MSG_CONNECT_REPLAYABLE 0x4
258 //#define MSG_CONNECT_PEER 0x8
259 #define MSG_CONNECT_LIBCLIENT 0x10
260 #define MSG_CONNECT_INITIAL 0x20
261 #define MSG_CONNECT_ASYNC 0x40
262 #define MSG_CONNECT_NEXT_VER 0x80 /* use next version of lustre_msg */
265 #define OBD_CONNECT_RDONLY 0x1ULL /* client allowed read-only access */
266 #define OBD_CONNECT_INDEX 0x2ULL /* connect to specific LOV idx */
267 #define OBD_CONNECT_GRANT 0x8ULL /* OSC acquires grant at connect */
268 #define OBD_CONNECT_SRVLOCK 0x10ULL /* server takes locks for client */
269 #define OBD_CONNECT_VERSION 0x20ULL /* Server supports versions in ocd */
270 #define OBD_CONNECT_REQPORTAL 0x40ULL /* Separate portal for non-IO reqs */
271 #define OBD_CONNECT_ACL 0x80ULL /* client uses access control lists */
272 #define OBD_CONNECT_XATTR 0x100ULL /* client using extended attributes*/
273 #define OBD_CONNECT_CROW 0x200ULL /* MDS+OST create objects on write */
274 #define OBD_CONNECT_TRUNCLOCK 0x400ULL /* locks on server for punch b=9528 */
275 #define OBD_CONNECT_TRANSNO 0x800ULL /* replay sends initial transno */
276 #define OBD_CONNECT_IBITS 0x1000ULL /* support for inodebits locks */
277 #define OBD_CONNECT_JOIN 0x2000ULL /* files can be concatenated */
278 #define OBD_CONNECT_ATTRFID 0x4000ULL /* Server supports GetAttr By Fid */
279 #define OBD_CONNECT_NODEVOH 0x8000ULL /* No open handle for special nodes */
280 #define OBD_CONNECT_LCL_CLIENT 0x10000ULL /* local 1.8 client */
281 #define OBD_CONNECT_RMT_CLIENT 0x20000ULL /* Remote 1.8 client */
282 #define OBD_CONNECT_BRW_SIZE 0x40000ULL /* Max bytes per rpc */
283 #define OBD_CONNECT_QUOTA64 0x80000ULL /* 64bit qunit_data.qd_count b=10707*/
284 #define OBD_CONNECT_FID_CAPA 0x100000ULL /* fid capability */
285 #define OBD_CONNECT_OSS_CAPA 0x200000ULL /* OSS capability */
286 /* also update obd_connect_names[] for lprocfs_rd_connect_flags()
287 * and lustre/utils/wirecheck.c */
289 #define MDS_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY | OBD_CONNECT_VERSION | \
290 OBD_CONNECT_ACL | OBD_CONNECT_XATTR | \
291 OBD_CONNECT_IBITS | OBD_CONNECT_JOIN | \
292 OBD_CONNECT_NODEVOH | OBD_CONNECT_ATTRFID)
293 #define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
294 OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
295 OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX | \
296 OBD_CONNECT_BRW_SIZE | OBD_CONNECT_QUOTA64)
297 #define ECHO_CONNECT_SUPPORTED (0)
298 #define MGS_CONNECT_SUPPORTED (OBD_CONNECT_VERSION)
300 #define MAX_QUOTA_COUNT32 ((0xffffffffULL >> QUOTABLOCK_BITS) << QUOTABLOCK_BITS)
302 #define OBD_OCD_VERSION(major,minor,patch,fix) (((major)<<24) + ((minor)<<16) +\
303 ((patch)<<8) + (fix))
304 #define OBD_OCD_VERSION_MAJOR(version) ((int)((version)>>24)&255)
305 #define OBD_OCD_VERSION_MINOR(version) ((int)((version)>>16)&255)
306 #define OBD_OCD_VERSION_PATCH(version) ((int)((version)>>8)&255)
307 #define OBD_OCD_VERSION_FIX(version) ((int)(version)&255)
309 /* This structure is used for both request and reply.
311 * If we eventually have separate connect data for different types, which we
312 * almost certainly will, then perhaps we stick a union in here. */
313 struct obd_connect_data {
314 __u64 ocd_connect_flags; /* OBD_CONNECT_* per above */
315 __u32 ocd_version; /* lustre release version number */
316 __u32 ocd_grant; /* initial cache grant amount (bytes) */
317 __u32 ocd_index; /* LOV index to connect to */
318 __u32 ocd_brw_size; /* Maximum BRW size in bytes */
319 __u64 ocd_ibits_known; /* inode bits this client understands */
320 __u32 ocd_nllu; /* non-local-lustre-user */
321 __u32 ocd_nllg; /* non-local-lustre-group */
322 __u64 padding1; /* also fix lustre_swab_connect */
323 __u64 padding2; /* also fix lustre_swab_connect */
324 __u64 padding3; /* also fix lustre_swab_connect */
325 __u64 padding4; /* also fix lustre_swab_connect */
328 extern void lustre_swab_connect(struct obd_connect_data *ocd);
331 * OST requests: OBDO & OBD request records
336 OST_REPLY = 0, /* reply ? */
350 /* OST_SAN_READ = 14, deprecated */
351 /* OST_SAN_WRITE = 15, deprecated */
358 #define OST_FIRST_OPC OST_REPLY
360 typedef uint64_t obd_id;
361 typedef uint64_t obd_gr;
362 typedef uint64_t obd_time;
363 typedef uint64_t obd_size;
364 typedef uint64_t obd_off;
365 typedef uint64_t obd_blocks;
366 typedef uint32_t obd_blksize;
367 typedef uint32_t obd_mode;
368 typedef uint32_t obd_uid;
369 typedef uint32_t obd_gid;
370 typedef uint32_t obd_flag;
371 typedef uint64_t obd_valid;
372 typedef uint32_t obd_count;
374 #define OBD_FL_INLINEDATA (0x00000001)
375 #define OBD_FL_OBDMDEXISTS (0x00000002)
376 #define OBD_FL_DELORPHAN (0x00000004) /* if set in o_flags delete orphans */
377 #define OBD_FL_NORPC (0x00000008) /* set in o_flags do in OSC not OST */
378 #define OBD_FL_IDONLY (0x00000010) /* set in o_flags only adjust obj id*/
379 #define OBD_FL_RECREATE_OBJS (0x00000020) /* recreate missing obj */
380 #define OBD_FL_DEBUG_CHECK (0x00000040) /* echo client/server debug check */
381 #define OBD_FL_NO_USRQUOTA (0x00000100) /* the object's owner is over quota */
382 #define OBD_FL_NO_GRPQUOTA (0x00000200) /* the object's group is over quota */
383 #define OBD_FL_CREATE_CROW (0x00000400) /* object should be create on write */
386 * set this to delegate DLM locking during obd_punch() to the OSTs. Only OSTs
387 * that declared OBD_CONNECT_TRUNCLOCK in their connect flags support this
390 #define OBD_FL_TRUNCLOCK (0x00000800)
392 /* this should be not smaller than sizeof(struct lustre_handle) + sizeof(struct
393 * llog_cookie) + sizeof(ll_fid). Nevertheless struct ll_fid is not longer
394 * stored in o_inline, we keep this just for case. */
395 #define OBD_INLINESZ 80
397 /* Note: 64-bit types are 64-bit aligned in structure */
399 obd_valid o_valid; /* hot fields in this obdo */
403 obd_size o_size; /* o_size-o_blocks == ost_lvb */
407 obd_blocks o_blocks; /* brw: cli sent cached bytes */
410 /* 32-bit fields start here: keep an even number of them via padding */
411 obd_blksize o_blksize; /* optimal IO blocksize */
412 obd_mode o_mode; /* brw: cli sent cache remain */
416 obd_count o_nlink; /* brw: checksum */
417 obd_count o_generation;
418 obd_count o_misc; /* brw: o_dropped */
419 __u32 o_easize; /* epoch in ost writes */
421 __u32 o_stripe_idx; /* holds stripe idx */
423 char o_inline[OBD_INLINESZ];
424 /* lustre_handle + llog_cookie */
427 #define o_dirty o_blocks
428 #define o_undirty o_mode
429 #define o_dropped o_misc
430 #define o_cksum o_nlink
432 extern void lustre_swab_obdo (struct obdo *o);
435 #define LOV_MAGIC_V1 0x0BD10BD0
436 #define LOV_MAGIC LOV_MAGIC_V1
437 #define LOV_MAGIC_JOIN 0x0BD20BD0
439 #define LOV_PATTERN_RAID0 0x001 /* stripes are used round-robin */
440 #define LOV_PATTERN_RAID1 0x002 /* stripes are mirrors of each other */
441 #define LOV_PATTERN_FIRST 0x100 /* first stripe is not in round-robin */
442 #define LOV_PATTERN_CMOBD 0x200
444 #define lov_ost_data lov_ost_data_v1
445 struct lov_ost_data_v1 { /* per-stripe data structure (little-endian)*/
446 __u64 l_object_id; /* OST object ID */
447 __u64 l_object_gr; /* OST object group (creating MDS number) */
448 __u32 l_ost_gen; /* generation of this l_ost_idx */
449 __u32 l_ost_idx; /* OST index in LOV (lov_tgt_desc->tgts) */
452 #define lov_mds_md lov_mds_md_v1
453 struct lov_mds_md_v1 { /* LOV EA mds/wire data (little-endian) */
454 __u32 lmm_magic; /* magic number = LOV_MAGIC_V1 */
455 __u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
456 __u64 lmm_object_id; /* LOV object ID */
457 __u64 lmm_object_gr; /* LOV object group */
458 __u32 lmm_stripe_size; /* size of stripe in bytes */
459 __u32 lmm_stripe_count; /* num stripes in use for this object */
460 struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */
463 #define OBD_MD_FLID (0x00000001ULL) /* object ID */
464 #define OBD_MD_FLATIME (0x00000002ULL) /* access time */
465 #define OBD_MD_FLMTIME (0x00000004ULL) /* data modification time */
466 #define OBD_MD_FLCTIME (0x00000008ULL) /* change time */
467 #define OBD_MD_FLSIZE (0x00000010ULL) /* size */
468 #define OBD_MD_FLBLOCKS (0x00000020ULL) /* allocated blocks count */
469 #define OBD_MD_FLBLKSZ (0x00000040ULL) /* block size */
470 #define OBD_MD_FLMODE (0x00000080ULL) /* access bits (mode & ~S_IFMT) */
471 #define OBD_MD_FLTYPE (0x00000100ULL) /* object type (mode & S_IFMT) */
472 #define OBD_MD_FLUID (0x00000200ULL) /* user ID */
473 #define OBD_MD_FLGID (0x00000400ULL) /* group ID */
474 #define OBD_MD_FLFLAGS (0x00000800ULL) /* flags word */
475 #define OBD_MD_FLNLINK (0x00002000ULL) /* link count */
476 #define OBD_MD_FLGENER (0x00004000ULL) /* generation number */
477 #define OBD_MD_FLINLINE (0x00008000ULL) /* inline data */
478 #define OBD_MD_FLRDEV (0x00010000ULL) /* device number */
479 #define OBD_MD_FLEASIZE (0x00020000ULL) /* extended attribute data */
480 #define OBD_MD_LINKNAME (0x00040000ULL) /* symbolic link target */
481 #define OBD_MD_FLHANDLE (0x00080000ULL) /* file handle */
482 #define OBD_MD_FLCKSUM (0x00100000ULL) /* bulk data checksum */
483 #define OBD_MD_FLQOS (0x00200000ULL) /* quality of service stats */
484 #define OBD_MD_FLOSCOPQ (0x00400000ULL) /* osc opaque data */
485 #define OBD_MD_FLCOOKIE (0x00800000ULL) /* log cancellation cookie */
486 #define OBD_MD_FLGROUP (0x01000000ULL) /* group */
487 #define OBD_MD_FLFID (0x02000000ULL) /* ->ost write inline fid */
488 #define OBD_MD_FLEPOCH (0x04000000ULL) /* ->ost write easize is epoch */
489 #define OBD_MD_FLGRANT (0x08000000ULL) /* ost preallocation space grant */
490 #define OBD_MD_FLDIREA (0x10000000ULL) /* dir's extended attribute data */
491 #define OBD_MD_FLUSRQUOTA (0x20000000ULL) /* over quota flags sent from ost */
492 #define OBD_MD_FLGRPQUOTA (0x40000000ULL) /* over quota flags sent from ost */
493 #define OBD_MD_FLMODEASIZE (0x80000000ULL) /* EA size will be changed */
495 #define OBD_MD_MDS (0x0000000100000000ULL) /* where an inode lives on */
496 #define OBD_MD_REINT (0x0000000200000000ULL) /* reintegrate oa */
498 #define OBD_MD_FLXATTR (0x0000001000000000ULL) /* xattr */
499 #define OBD_MD_FLXATTRLS (0x0000002000000000ULL) /* xattr list */
500 #define OBD_MD_FLXATTRRM (0x0000004000000000ULL) /* xattr remove */
501 #define OBD_MD_FLACL (0x0000008000000000ULL) /* ACL */
503 #define OBD_MD_FLGETATTR (OBD_MD_FLID | OBD_MD_FLATIME | OBD_MD_FLMTIME | \
504 OBD_MD_FLCTIME | OBD_MD_FLSIZE | OBD_MD_FLBLKSZ | \
505 OBD_MD_FLMODE | OBD_MD_FLTYPE | OBD_MD_FLUID | \
506 OBD_MD_FLGID | OBD_MD_FLFLAGS | OBD_MD_FLNLINK | \
507 OBD_MD_FLGENER | OBD_MD_FLRDEV | OBD_MD_FLGROUP)
509 static inline struct lustre_handle *obdo_handle(struct obdo *oa)
511 return (struct lustre_handle *)oa->o_inline;
514 static inline struct llog_cookie *obdo_logcookie(struct obdo *oa)
516 return (struct llog_cookie *)(oa->o_inline +
517 sizeof(struct lustre_handle));
519 /* don't forget obdo_fid which is way down at the bottom so it can
520 * come after the definition of llog_cookie */
533 __u32 os_state; /* positive error code on server */
545 extern void lustre_swab_obd_statfs (struct obd_statfs *os);
547 /* ost_body.data values for OST_BRW */
549 #define OBD_BRW_READ 0x01
550 #define OBD_BRW_WRITE 0x02
551 #define OBD_BRW_RWMASK (OBD_BRW_READ | OBD_BRW_WRITE)
552 #define OBD_BRW_SYNC 0x08
553 #define OBD_BRW_CHECK 0x10
554 #define OBD_BRW_FROM_GRANT 0x20 /* the osc manages this under llite */
555 #define OBD_BRW_GRANTED 0x40 /* the ost manages this */
556 #define OBD_BRW_DROP 0x80 /* drop the page after IO */
557 #define OBD_BRW_NOQUOTA 0x100
558 #define OBD_BRW_SRVLOCK 0x200 /* Client holds no lock over this page */
560 #define OBD_OBJECT_EOF 0xffffffffffffffffULL
562 #define OST_MIN_PRECREATE 32
563 #define OST_MAX_PRECREATE 20000
572 extern void lustre_swab_obd_ioobj (struct obd_ioobj *ioo);
574 /* multiple of 8 bytes => can array */
575 struct niobuf_remote {
581 extern void lustre_swab_niobuf_remote (struct niobuf_remote *nbr);
583 /* request structure for OST's */
589 extern void lustre_swab_ost_body (struct ost_body *b);
590 extern void lustre_swab_ost_last_id(obd_id *id);
592 /* lock value block communicated between the filter and llite */
602 extern void lustre_swab_ost_lvb(struct ost_lvb *);
611 MDS_GETATTR_NAME = 34,
622 MDS_DONE_WRITING = 45,
631 #define MDS_FIRST_OPC MDS_GETATTR
649 /* the disposition of the intent outlines what was executed */
650 #define DISP_IT_EXECD 0x00000001
651 #define DISP_LOOKUP_EXECD 0x00000002
652 #define DISP_LOOKUP_NEG 0x00000004
653 #define DISP_LOOKUP_POS 0x00000008
654 #define DISP_OPEN_CREATE 0x00000010
655 #define DISP_OPEN_OPEN 0x00000020
656 #define DISP_ENQ_COMPLETE 0x00400000
657 #define DISP_ENQ_OPEN_REF 0x00800000
658 #define DISP_ENQ_CREATE_REF 0x01000000
659 #define DISP_OPEN_LOCK 0x02000000
661 /* INODE LOCK PARTS */
662 #define MDS_INODELOCK_LOOKUP 0x000001 /* dentry, mode, owner, group */
663 #define MDS_INODELOCK_UPDATE 0x000002 /* size, links, timestamps */
664 #define MDS_INODELOCK_OPEN 0x000004 /* For opened files */
666 /* Do not forget to increase MDS_INODELOCK_MAXSHIFT when adding new bits */
667 #define MDS_INODELOCK_MAXSHIFT 2
668 /* This FULL lock is useful to take on unlink sort of operations */
669 #define MDS_INODELOCK_FULL ((1<<(MDS_INODELOCK_MAXSHIFT+1))-1)
672 __u64 id; /* holds object id */
673 __u32 generation; /* holds object generation */
675 __u32 f_type; /* holds object type or stripe idx when passing it to
676 * OST for saving into EA. */
679 extern void lustre_swab_ll_fid (struct ll_fid *fid);
681 #define MDS_STATUS_CONN 1
682 #define MDS_STATUS_LOV 2
684 struct mds_status_req {
689 extern void lustre_swab_mds_status_req (struct mds_status_req *r);
691 #define MDS_BFLAG_UNCOMMITTED_WRITES 0x1
692 #define MDS_BFLAG_EXT_FLAGS 0x80000000 /* == EXT3_RESERVED_FL */
694 /* these should be identical to their EXT3_*_FL counterparts, and are
695 * redefined here only to avoid dragging in ext3_fs.h */
696 #define MDS_SYNC_FL 0x00000008 /* Synchronous updates */
697 #define MDS_IMMUTABLE_FL 0x00000010 /* Immutable file */
698 #define MDS_APPEND_FL 0x00000020 /* writes to file may only append */
699 #define MDS_NOATIME_FL 0x00000080 /* do not update atime */
700 #define MDS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (dir only) */
703 /* If MDS_BFLAG_IOC_FLAGS is set it means we requested EXT3_*_FL inode flags
704 * and we need to decode these into local S_* flags in the inode. Otherwise
705 * we pass flags straight through (see bug 9486). */
706 static inline int ll_ext_to_inode_flags(int flags)
708 return (flags & MDS_BFLAG_EXT_FLAGS) ?
709 (((flags & MDS_SYNC_FL) ? S_SYNC : 0) |
710 ((flags & MDS_NOATIME_FL) ? S_NOATIME : 0) |
711 ((flags & MDS_APPEND_FL) ? S_APPEND : 0) |
712 #if defined(S_DIRSYNC)
713 ((flags & MDS_DIRSYNC_FL) ? S_DIRSYNC : 0) |
715 ((flags & MDS_IMMUTABLE_FL) ? S_IMMUTABLE : 0)) :
716 (flags & ~MDS_BFLAG_EXT_FLAGS);
719 /* If MDS_BFLAG_EXT_FLAGS is set it means we requested EXT3_*_FL inode flags
720 * and we pass these straight through. Otherwise we need to convert from
721 * S_* flags to their EXT3_*_FL equivalents (see bug 9486). */
722 static inline int ll_inode_to_ext_flags(int oflags, int iflags)
724 return (oflags & MDS_BFLAG_EXT_FLAGS) ? (oflags & ~MDS_BFLAG_EXT_FLAGS):
725 (((iflags & S_SYNC) ? MDS_SYNC_FL : 0) |
726 ((iflags & S_NOATIME) ? MDS_NOATIME_FL : 0) |
727 ((iflags & S_APPEND) ? MDS_APPEND_FL : 0) |
728 #if defined(S_DIRSYNC)
729 ((iflags & S_DIRSYNC) ? MDS_DIRSYNC_FL : 0) |
731 ((iflags & S_IMMUTABLE) ? MDS_IMMUTABLE_FL : 0));
738 struct lustre_handle handle;
740 __u64 size; /* Offset, in the case of MDS_READPAGE */
744 __u64 blocks; /* XID, in the case of MDS_READPAGE */
753 __u32 flags; /* from vfs for pin/unpin, MDS_BFLAG for close */
755 __u32 nlink; /* #bytes to read in the case of MDS_READPAGE */
761 __u32 max_cookiesize; /* also fix lustre_swab_mds_body */
762 __u32 padding_4; /* also fix lustre_swab_mds_body */
765 extern void lustre_swab_mds_body (struct mds_body *b);
767 #define Q_QUOTACHECK 0x800100
768 #define Q_INITQUOTA 0x800101 /* init slave limits */
769 #define Q_GETOINFO 0x800102 /* get obd quota info */
770 #define Q_GETOQUOTA 0x800103 /* get obd quotas */
772 #define Q_TYPESET(oqc, type) \
773 ((oqc)->qc_type == type || (oqc)->qc_type == UGQUOTA)
775 #define Q_GETOCMD(oqc) \
776 ((oqc)->qc_cmd == Q_GETOINFO || (oqc)->qc_cmd == Q_GETOQUOTA)
778 struct obd_quotactl {
783 struct obd_dqinfo qc_dqinfo;
784 struct obd_dqblk qc_dqblk;
787 extern void lustre_swab_obd_quotactl(struct obd_quotactl *q);
789 struct mds_rec_setattr {
796 struct ll_fid sa_fid;
805 __u32 sa_padding; /* also fix lustre_swab_mds_rec_setattr */
808 /* Remove this once we declare it in include/linux/fs.h (v21 kernel patch?) */
809 #ifndef ATTR_CTIME_SET
810 #define ATTR_CTIME_SET 0x2000
813 extern void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa);
816 #define FMODE_READ 00000001
817 #define FMODE_WRITE 00000002
819 #define MDS_FMODE_EXEC 00000004
820 #define MDS_OPEN_CREAT 00000100
821 #define MDS_OPEN_EXCL 00000200
822 #define MDS_OPEN_TRUNC 00001000
823 #define MDS_OPEN_APPEND 00002000
824 #define MDS_OPEN_SYNC 00010000
825 #define MDS_OPEN_DIRECTORY 00200000
827 #define MDS_OPEN_DELAY_CREATE 0100000000 /* delay initial object create */
828 #define MDS_OPEN_OWNEROVERRIDE 0200000000 /* NFSD rw-reopen ro file for owner */
829 #define MDS_OPEN_JOIN_FILE 0400000000 /* open for join file*/
830 #define MDS_OPEN_LOCK 04000000000 /* This open requires open lock */
831 #define MDS_OPEN_HAS_EA 010000000000 /* specify object create pattern */
832 #define MDS_OPEN_HAS_OBJS 020000000000 /* Just set the EA the obj exist */
834 struct mds_rec_create {
839 __u32 cr_flags; /* for use with open */
841 struct ll_fid cr_fid;
842 struct ll_fid cr_replayfid;
846 __u32 cr_padding_1; /* also fix lustre_swab_mds_rec_create */
847 __u32 cr_padding_2; /* also fix lustre_swab_mds_rec_create */
848 __u32 cr_padding_3; /* also fix lustre_swab_mds_rec_create */
849 __u32 cr_padding_4; /* also fix lustre_swab_mds_rec_create */
850 __u32 cr_padding_5; /* also fix lustre_swab_mds_rec_create */
853 extern void lustre_swab_mds_rec_create (struct mds_rec_create *cr);
855 struct mds_rec_join {
856 struct ll_fid jr_fid;
860 extern void lustre_swab_mds_rec_join (struct mds_rec_join *jr);
862 struct mds_rec_link {
869 struct ll_fid lk_fid1;
870 struct ll_fid lk_fid2;
872 __u32 lk_padding_1; /* also fix lustre_swab_mds_rec_link */
873 __u32 lk_padding_2; /* also fix lustre_swab_mds_rec_link */
874 __u32 lk_padding_3; /* also fix lustre_swab_mds_rec_link */
875 __u32 lk_padding_4; /* also fix lustre_swab_mds_rec_link */
878 extern void lustre_swab_mds_rec_link (struct mds_rec_link *lk);
880 struct mds_rec_unlink {
887 struct ll_fid ul_fid1;
888 struct ll_fid ul_fid2;
890 __u32 ul_padding_1; /* also fix lustre_swab_mds_rec_unlink */
891 __u32 ul_padding_2; /* also fix lustre_swab_mds_rec_unlink */
892 __u32 ul_padding_3; /* also fix lustre_swab_mds_rec_unlink */
893 __u32 ul_padding_4; /* also fix lustre_swab_mds_rec_unlink */
896 extern void lustre_swab_mds_rec_unlink (struct mds_rec_unlink *ul);
898 struct mds_rec_rename {
905 struct ll_fid rn_fid1;
906 struct ll_fid rn_fid2;
908 __u32 rn_padding_1; /* also fix lustre_swab_mds_rec_rename */
909 __u32 rn_padding_2; /* also fix lustre_swab_mds_rec_rename */
910 __u32 rn_padding_3; /* also fix lustre_swab_mds_rec_rename */
911 __u32 rn_padding_4; /* also fix lustre_swab_mds_rec_rename */
914 extern void lustre_swab_mds_rec_rename (struct mds_rec_rename *rn);
917 * LOV data structures
920 #define LOV_MIN_STRIPE_SIZE 65536 /* maximum PAGE_SIZE (ia64), power of 2 */
921 #define LOV_MAX_STRIPE_COUNT 160 /* until bug 4424 is fixed */
923 #define LOV_MAX_UUID_BUFFER_SIZE 8192
924 /* The size of the buffer the lov/mdc reserves for the
925 * array of UUIDs returned by the MDS. With the current
926 * protocol, this will limit the max number of OSTs per LOV */
928 #define LOV_DESC_MAGIC 0xB0CCDE5C
930 /* LOV settings descriptor (should only contain static info) */
932 __u32 ld_tgt_count; /* how many OBD's */
933 __u32 ld_active_tgt_count; /* how many active */
934 __u32 ld_default_stripe_count; /* how many objects are used */
935 __u32 ld_pattern; /* default PATTERN_RAID0 */
936 __u64 ld_default_stripe_size; /* in bytes */
937 __u64 ld_default_stripe_offset; /* in bytes */
938 __u32 ld_padding_0; /* unused */
939 __u32 ld_qos_maxage; /* in second */
940 __u32 ld_padding_1; /* also fix lustre_swab_lov_desc */
941 __u32 ld_padding_2; /* also fix lustre_swab_lov_desc */
942 struct obd_uuid ld_uuid;
945 #define ld_magic ld_active_tgt_count /* for swabbing from llogs */
947 extern void lustre_swab_lov_desc (struct lov_desc *ld);
952 /* opcodes -- MUST be distinct from OST/MDS opcodes */
957 LDLM_BL_CALLBACK = 104,
958 LDLM_CP_CALLBACK = 105,
959 LDLM_GL_CALLBACK = 106,
962 #define LDLM_FIRST_OPC LDLM_ENQUEUE
964 #define RES_NAME_SIZE 4
966 __u64 name[RES_NAME_SIZE];
969 extern void lustre_swab_ldlm_res_id (struct ldlm_res_id *id);
992 #define LDLM_MIN_TYPE LDLM_PLAIN
1000 struct ldlm_inodebits {
1007 __u64 blocking_export; /* not actually used over the wire */
1008 __u32 blocking_pid; /* not actually used over the wire */
1012 /* it's important that the fields of the ldlm_extent structure match
1013 * the first fields of the ldlm_flock structure because there is only
1014 * one ldlm_swab routine to process the ldlm_policy_data_t union. if
1015 * this ever changes we will need to swab the union differently based
1016 * on the resource type. */
1019 struct ldlm_extent l_extent;
1020 struct ldlm_flock l_flock;
1021 struct ldlm_inodebits l_inodebits;
1022 } ldlm_policy_data_t;
1024 extern void lustre_swab_ldlm_policy_data (ldlm_policy_data_t *d);
1026 struct ldlm_intent {
1030 extern void lustre_swab_ldlm_intent (struct ldlm_intent *i);
1032 struct ldlm_resource_desc {
1033 ldlm_type_t lr_type;
1034 __u32 lr_padding; /* also fix lustre_swab_ldlm_resource_desc */
1035 struct ldlm_res_id lr_name;
1038 extern void lustre_swab_ldlm_resource_desc (struct ldlm_resource_desc *r);
1040 struct ldlm_lock_desc {
1041 struct ldlm_resource_desc l_resource;
1042 ldlm_mode_t l_req_mode;
1043 ldlm_mode_t l_granted_mode;
1044 ldlm_policy_data_t l_policy_data;
1047 extern void lustre_swab_ldlm_lock_desc (struct ldlm_lock_desc *l);
1049 struct ldlm_request {
1051 __u32 lock_padding; /* also fix lustre_swab_ldlm_request */
1052 struct ldlm_lock_desc lock_desc;
1053 struct lustre_handle lock_handle1;
1054 struct lustre_handle lock_handle2;
1057 extern void lustre_swab_ldlm_request (struct ldlm_request *rq);
1061 __u32 lock_padding; /* also fix lustre_swab_ldlm_reply */
1062 struct ldlm_lock_desc lock_desc;
1063 struct lustre_handle lock_handle;
1064 __u64 lock_policy_res1;
1065 __u64 lock_policy_res2;
1068 extern void lustre_swab_ldlm_reply (struct ldlm_reply *r);
1072 * Opcodes for mountconf (mgs and mgc)
1077 MGS_EXCEPTION, /* node died, etc. */
1078 MGS_TARGET_REG, /* whenever target starts up */
1083 /* We pass this info to the MGS so it can write config logs */
1084 #define MTI_NAME_MAXLEN 64
1085 #define MTI_PARAM_MAXLEN 4096
1086 #define MTI_NIDS_MAX 32
1087 struct mgs_target_info {
1088 __u32 mti_lustre_ver;
1089 __u32 mti_stripe_index;
1090 __u32 mti_config_ver;
1092 __u32 mti_nid_count;
1093 __u32 padding; /* 64 bit align */
1094 char mti_fsname[MTI_NAME_MAXLEN];
1095 char mti_svname[MTI_NAME_MAXLEN];
1096 char mti_uuid[sizeof(struct obd_uuid)];
1097 __u64 mti_nids[MTI_NIDS_MAX]; /* host nids (lnet_nid_t)*/
1098 char mti_params[MTI_PARAM_MAXLEN];
1101 extern void lustre_swab_mgs_target_info(struct mgs_target_info *oinfo);
1103 /* Config marker flags (in config log) */
1104 #define CM_START 0x01
1106 #define CM_SKIP 0x04
1107 #define CM_UPGRADE146 0x08
1108 #define CM_EXCLUDE 0x10
1109 #define CM_START_SKIP (CM_START | CM_SKIP)
1112 __u32 cm_step; /* aka config version */
1114 __u32 cm_vers; /* lustre release version number */
1115 __u32 padding; /* 64 bit align */
1116 time_t cm_createtime; /*when this record was first created */
1117 time_t cm_canceltime; /*when this record is no longer valid*/
1118 char cm_tgtname[MTI_NAME_MAXLEN];
1119 char cm_comment[MTI_NAME_MAXLEN];
1123 * Opcodes for multiple servers.
1132 #define OBD_FIRST_OPC OBD_PING
1134 /* catalog of log objects */
1136 /* Identifier for a single log object */
1141 } __attribute__((packed));
1143 /* Records written to the CATALOGS list */
1144 #define CATLIST "CATALOGS"
1146 struct llog_logid lci_logid;
1150 } __attribute__((packed));
1152 /*join file lov mds md*/
1153 struct lov_mds_md_join {
1154 struct lov_mds_md lmmj_md;
1155 /*join private info*/
1156 struct llog_logid lmmj_array_id; /*array object id*/
1157 __u32 lmmj_extent_count; /*array extent count*/
1160 /* Log data record types - there is no specific reason that these need to
1161 * be related to the RPC opcodes, but no reason not to (may be handy later?)
1163 #define LLOG_OP_MAGIC 0x10600000
1164 #define LLOG_OP_MASK 0xfff00000
1167 LLOG_PAD_MAGIC = LLOG_OP_MAGIC | 0x00000,
1168 OST_SZ_REC = LLOG_OP_MAGIC | 0x00f00,
1169 OST_RAID1_REC = LLOG_OP_MAGIC | 0x01000,
1170 MDS_UNLINK_REC = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_UNLINK,
1171 MDS_SETATTR_REC = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_SETATTR,
1172 OBD_CFG_REC = LLOG_OP_MAGIC | 0x20000,
1173 PTL_CFG_REC = LLOG_OP_MAGIC | 0x30000, /* obsolete */
1174 LLOG_GEN_REC = LLOG_OP_MAGIC | 0x40000,
1175 LLOG_JOIN_REC = LLOG_OP_MAGIC | 0x50000,
1176 LLOG_HDR_MAGIC = LLOG_OP_MAGIC | 0x45539,
1177 LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b,
1181 * for now, continue to support old pad records which have 0 for their
1182 * type but still need to be swabbed for their length
1184 #define LLOG_REC_HDR_NEEDS_SWABBING(r) \
1185 (((r)->lrh_type & __swab32(LLOG_OP_MASK)) == \
1186 __swab32(LLOG_OP_MAGIC) || \
1187 (((r)->lrh_type == 0) && ((r)->lrh_len > LLOG_CHUNK_SIZE)))
1189 /* Log record header - stored in little endian order.
1190 * Each record must start with this struct, end with a llog_rec_tail,
1191 * and be a multiple of 256 bits in size.
1193 struct llog_rec_hdr {
1200 struct llog_rec_tail {
1205 struct llog_logid_rec {
1206 struct llog_rec_hdr lid_hdr;
1207 struct llog_logid lid_id;
1213 struct llog_rec_tail lid_tail;
1214 } __attribute__((packed));
1216 /* MDS extent description
1217 * It is for joined file extent info, each extent info for joined file
1218 * just like (start, end, lmm).
1220 struct mds_extent_desc {
1221 __u64 med_start; /* extent start */
1222 __u64 med_len; /* extent length */
1223 struct lov_mds_md med_lmm; /* extent's lmm */
1225 /*Joined file array extent log record*/
1226 struct llog_array_rec {
1227 struct llog_rec_hdr lmr_hdr;
1228 struct mds_extent_desc lmr_med;
1229 struct llog_rec_tail lmr_tail;
1232 struct llog_create_rec {
1233 struct llog_rec_hdr lcr_hdr;
1234 struct ll_fid lcr_fid;
1238 struct llog_rec_tail lcr_tail;
1239 } __attribute__((packed));
1241 struct llog_orphan_rec {
1242 struct llog_rec_hdr lor_hdr;
1246 struct llog_rec_tail lor_tail;
1247 } __attribute__((packed));
1249 struct llog_unlink_rec {
1250 struct llog_rec_hdr lur_hdr;
1254 struct llog_rec_tail lur_tail;
1255 } __attribute__((packed));
1257 struct llog_setattr_rec {
1258 struct llog_rec_hdr lsr_hdr;
1264 struct llog_rec_tail lsr_tail;
1265 } __attribute__((packed));
1267 struct llog_size_change_rec {
1268 struct llog_rec_hdr lsc_hdr;
1269 struct ll_fid lsc_fid;
1272 struct llog_rec_tail lsc_tail;
1273 } __attribute__((packed));
1278 } __attribute__((packed));
1280 struct llog_gen_rec {
1281 struct llog_rec_hdr lgr_hdr;
1282 struct llog_gen lgr_gen;
1283 struct llog_rec_tail lgr_tail;
1285 /* On-disk header structure of each log object, stored in little endian order */
1286 #define LLOG_CHUNK_SIZE 8192
1287 #define LLOG_HEADER_SIZE (96)
1288 #define LLOG_BITMAP_BYTES (LLOG_CHUNK_SIZE - LLOG_HEADER_SIZE)
1290 #define LLOG_MIN_REC_SIZE (24) /* round(llog_rec_hdr + llog_rec_tail) */
1292 /* flags for the logs */
1293 #define LLOG_F_ZAP_WHEN_EMPTY 0x1
1294 #define LLOG_F_IS_CAT 0x2
1295 #define LLOG_F_IS_PLAIN 0x4
1297 struct llog_log_hdr {
1298 struct llog_rec_hdr llh_hdr;
1299 __u64 llh_timestamp;
1301 __u32 llh_bitmap_offset;
1305 /* for a catalog the first plain slot is next to it */
1306 struct obd_uuid llh_tgtuuid;
1307 __u32 llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32) - 23];
1308 __u32 llh_bitmap[LLOG_BITMAP_BYTES/sizeof(__u32)];
1309 struct llog_rec_tail llh_tail;
1310 } __attribute__((packed));
1312 #define LLOG_BITMAP_SIZE(llh) ((llh->llh_hdr.lrh_len - \
1313 llh->llh_bitmap_offset - \
1314 sizeof(llh->llh_tail)) * 8)
1316 /* log cookies are used to reference a specific log file and a record therein */
1317 struct llog_cookie {
1318 struct llog_logid lgc_lgl;
1322 } __attribute__((packed));
1325 enum llogd_rpc_ops {
1326 LLOG_ORIGIN_HANDLE_CREATE = 501,
1327 LLOG_ORIGIN_HANDLE_NEXT_BLOCK = 502,
1328 LLOG_ORIGIN_HANDLE_READ_HEADER = 503,
1329 LLOG_ORIGIN_HANDLE_WRITE_REC = 504,
1330 LLOG_ORIGIN_HANDLE_CLOSE = 505,
1331 LLOG_ORIGIN_CONNECT = 506,
1332 LLOG_CATINFO = 507, /* for lfs catinfo */
1333 LLOG_ORIGIN_HANDLE_PREV_BLOCK = 508,
1334 LLOG_ORIGIN_HANDLE_DESTROY = 509, /* for destroy llog object*/
1338 struct llog_logid lgd_logid;
1340 __u32 lgd_llh_flags;
1342 __u32 lgd_saved_index;
1344 __u64 lgd_cur_offset;
1345 } __attribute__((packed));
1347 struct llogd_conn_body {
1348 struct llog_gen lgdc_gen;
1349 struct llog_logid lgdc_logid;
1350 __u32 lgdc_ctxt_idx;
1351 } __attribute__((packed));
1353 struct lov_user_ost_data_join { /* per-stripe data structure */
1354 __u64 l_extent_start; /* extent start*/
1355 __u64 l_extent_end; /* extent end*/
1356 __u64 l_object_id; /* OST object ID */
1357 __u64 l_object_gr; /* OST object group (creating MDS number) */
1358 __u32 l_ost_gen; /* generation of this OST index */
1359 __u32 l_ost_idx; /* OST index in LOV */
1360 } __attribute__((packed));
1362 struct lov_user_md_join { /* LOV EA user data (host-endian) */
1363 __u32 lmm_magic; /* magic number = LOV_MAGIC_JOIN */
1364 __u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
1365 __u64 lmm_object_id; /* LOV object ID */
1366 __u64 lmm_object_gr; /* LOV object group */
1367 __u32 lmm_stripe_size; /* size of stripe in bytes */
1368 __u32 lmm_stripe_count; /* num stripes in use for this object */
1369 __u32 lmm_extent_count; /* extent count of lmm*/
1370 __u64 lmm_tree_id; /* mds tree object id */
1371 __u64 lmm_tree_gen; /* mds tree object gen */
1372 struct llog_logid lmm_array_id; /* mds extent desc llog object id */
1373 struct lov_user_ost_data_join lmm_objects[0]; /* per-stripe data */
1374 } __attribute__((packed));
1376 extern void lustre_swab_lov_user_md(struct lov_user_md *lum);
1377 extern void lustre_swab_lov_user_md_objects(struct lov_user_md *lum);
1378 extern void lustre_swab_lov_user_md_join(struct lov_user_md_join *lumj);
1381 extern void lustre_swab_llogd_body (struct llogd_body *d);
1382 extern void lustre_swab_llog_hdr (struct llog_log_hdr *h);
1383 extern void lustre_swab_llogd_conn_body (struct llogd_conn_body *d);
1384 extern void lustre_swab_llog_rec(struct llog_rec_hdr *rec,
1385 struct llog_rec_tail *tail);
1388 extern void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg);
1390 /* quota. fixed by tianzy for bug10707 */
1391 #define QUOTA_IS_GRP 0X1UL /* 0 is user, 1 is group. Used by qd_flags*/
1392 #define QUOTA_IS_BLOCK 0x2UL /* 0 is inode, 1 is block. Used by qd_flags*/
1395 __u32 qd_id; /* ID appiles to (uid, gid) */
1396 __u32 qd_flags; /* Quota type (USRQUOTA, GRPQUOTA) occupy one bit;
1397 * Block quota or file quota occupy one bit */
1398 __u64 qd_count; /* acquire/release count (bytes for block quota) */
1401 struct qunit_data_old {
1402 __u32 qd_id; /* ID appiles to (uid, gid) */
1403 __u32 qd_type; /* Quota type (USRQUOTA, GRPQUOTA) */
1404 __u32 qd_count; /* acquire/release count (bytes for block quota) */
1405 __u32 qd_isblk; /* Block quota or file quota */
1408 extern void lustre_swab_qdata(struct qunit_data *d);
1409 extern void lustre_swab_qdata_old(struct qunit_data_old *d);
1410 extern struct qunit_data *lustre_quota_old_to_new(struct qunit_data_old *d);
1411 extern struct qunit_data_old *lustre_quota_new_to_old(struct qunit_data *d);
1418 #define JOIN_FILE_ALIGN 4096