Whamcloud - gitweb
land v0.9.1 on HEAD, in preparation for a 1.0.x branch
[fs/lustre-release.git] / lustre / include / linux / lustre_user.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  * Lustre public user-space interface definitions.
22  */
23
24 #ifndef _LUSTRE_USER_H
25 #define _LUSTRE_USER_H
26 #include <asm/types.h>
27
28 #define LL_IOC_GETFLAGS                 _IOR ('f', 151, long)
29 #define LL_IOC_SETFLAGS                 _IOW ('f', 152, long)
30 #define LL_IOC_CLRFLAGS                 _IOW ('f', 153, long)
31 #define LL_IOC_LOV_SETSTRIPE            _IOW ('f', 154, long)
32 #define LL_IOC_LOV_GETSTRIPE            _IOW ('f', 155, long)
33
34 #define O_LOV_DELAY_CREATE 0100000000  /* hopefully this does not conflict */
35
36 #define LL_FILE_IGNORE_LOCK             0x00000001
37
38 #define LOV_USER_MAGIC_V1 0x0BD10BD0
39 #define LOV_USER_MAGIC    LOV_USER_MAGIC_V1
40
41 #define LOV_PATTERN_RAID0 0x001
42 #define LOV_PATTERN_RAID1 0x002
43 #define LOV_PATTERN_FIRST 0x100
44
45 struct lov_user_ost_data_v1 {     /* per-stripe data structure */
46         __u64 l_object_id;        /* OST object ID */
47         __u64 l_object_gr;        /* OST object group (creating MDS number) */
48         __u32 l_ost_generation;   /* generation of this OST index */
49         __u16 l_ost_idx;          /* OST index in LOV */
50         __u16 l_reserved2;
51 } __attribute__((packed));
52
53 #define lov_user_md lov_user_md_v1
54 struct lov_user_md_v1 {           /* LOV EA user data (host-endian) */
55         __u32 lmm_magic;          /* magic number = LOV_USER_MAGIC_V1 */
56         __u32 lmm_pattern;        /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
57         __u64 lmm_object_id;      /* LOV object ID */
58         __u64 lmm_object_gr;      /* LOV object group */
59         __u32 lmm_stripe_size;    /* size of stripe in bytes */
60         __u16 lmm_stripe_count;   /* num stripes in use for this object */
61         __u16 lmm_stripe_offset;  /* starting stripe offset in lmm_objects */
62         struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */
63 } __attribute__((packed));
64
65 #endif /* _LUSTRE_USER_H */