Whamcloud - gitweb
LUDOC-297 protocol: Update protocol document
[doc/protocol.git] / struct_lu_fid.txt
1
2 .Lustre FID
3 [[struct-lu-fid]]
4 ****
5 [source,c]
6 --------
7 struct lu_fid {
8         __u64 f_seq;
9         __u32 f_oid;
10         __u32 f_ver;
11 };
12 --------
13
14 A file identifier ('FID') is a 128-bit number that uniquely identifies a
15 resource on an MDT or OST. The FID for the resource on an MDT
16 identifies the file as a whole. The FID for a resource on an OST
17 identifiess the fragment of a file assigned to that OST.
18
19 The 'f_seq' field holds the sequence number, or SEQ, and is used in
20 conjunction with the 'FID location database' (FLDB) to
21 determine on which target the resource is located.  All resources with the
22 same 'f_seq' value will be on the same target. A target can have more
23 than one 'f_seq' value assigned to it.
24
25 The 'f_oid' field holds the unique 'object identifier' (OID) within the
26 sequence to identify a particular object.
27
28 The 'f_ver' value identifies which version of a resource is being
29 identified in the event that the resource is being updated, and
30 different hosts might be referring to different versions of the same
31 resource. It has never been used as of Lustre 2.8.
32 ****
33
34 .FID SEQ
35 [source,c]
36 ----
37 enum fid_seq {
38         FID_SEQ_OST_MDT0        = 0,
39         FID_SEQ_LLOG            = 1, /* unnamed llogs */
40         FID_SEQ_ECHO            = 2,
41         FID_SEQ_UNUSED_START    = 3,
42         FID_SEQ_UNUSED_END      = 9,
43         FID_SEQ_LLOG_NAME       = 10, /* named llogs */
44         FID_SEQ_RSVD            = 11,
45         FID_SEQ_IGIF            = 12,
46         FID_SEQ_IGIF_MAX        = 0x0ffffffffULL,
47         FID_SEQ_IDIF            = 0x100000000ULL,
48         FID_SEQ_IDIF_MAX        = 0x1ffffffffULL,
49         FID_SEQ_START           = 0x200000000ULL,
50         FID_SEQ_LOCAL_FILE      = 0x200000001ULL,
51         FID_SEQ_DOT_LUSTRE      = 0x200000002ULL,
52         FID_SEQ_LOCAL_NAME      = 0x200000003ULL,
53         FID_SEQ_SPECIAL         = 0x200000004ULL,
54         FID_SEQ_QUOTA           = 0x200000005ULL,
55         FID_SEQ_QUOTA_GLB       = 0x200000006ULL,
56         FID_SEQ_ROOT            = 0x200000007ULL,  /* Located on MDT0 */
57         FID_SEQ_LAYOUT_RBTREE   = 0x200000008ULL,
58         FID_SEQ_UPDATE_LOG      = 0x200000009ULL,
59         FID_SEQ_UPDATE_LOG_DIR  = 0x20000000aULL,
60         FID_SEQ_NORMAL          = 0x200000400ULL,
61         FID_SEQ_LOV_DEFAULT     = 0xffffffffffffffffULL
62 };
63 ----
64
65 ****
66 There are several reserved ranges of FID sequence values, to allow for
67 interoperability with older Lustre filesystems, to identify "well known"
68 objects for internal or external use, as well as for future expansion.
69
70 The 'FID_SEQ_OST_MDT0' (0x0) range is reserved for OST objects created
71 by MDT0 in non-DNE filesystems.  Since all such OST objects used an
72 'f_seq' value of zero these FIDs are not unique across the filesystem,
73 but the reservation of 'FID_SEQ_OST_MDT0' allows these FIDs to co-exist
74 with other FIDs in the same 128-bit identifier space.
75
76 The 'FID_SEQ_LLOG' (0x1) range is reserved for unnamed Lustre log (llog)
77 files, used only internally on the MDS since Lustre 2.4, but previously
78 exposed over the network.
79
80 The 'FID_SEQ_ECHO' (0x2) range is used for temporary objects for
81 testing purposes such as obdfiler-survey.
82
83 The 'FID_SEQ_LLOG_NAME' (0x10) range is used for named llog files such
84 as configuration logs and the ChangeLog.
85
86 The 'FID_SEQ_IGIF' (0xb-0xffffffff) range is reserved for 'inode and
87 generation in FID' (IGIF) inodes allocated by MDSes before Lustre 2.0.
88 This corresponds to the 4 billion maximum inode number that could be
89 allocated for such filesystems.  The 'f_oid' field for IGIF FIDs
90 contains the inode version number, and as such there is normally only
91 a single object for each 'f_seq' value.
92
93 The 'FID_SEQ_IDIF' (0x100000000-0x1fffffffff) range is reserved for
94 mapping OST objects that were created by MDT0 using 'FID_SEQ_OST_MDT0'
95 to filesystem-unique FIDs.  The second 16-bit field (bits 16-31) of the
96 'f_seq' field contains the OST index (0-65535).  The low 16-bit field
97 (bits 0-15) of 'f_seq' contains the high (bits 32-47) bits of the OST
98 object ID, and the 32-bit 'f_oid' field contains the low 32 bits of
99 the OST object ID.
100
101 The 'FID_SEQ_LOCAL_FILE' (0x200000001) range is reserved for "well
102 known" objects internal to the server and is not exposed to the network.
103
104 The 'FID_SEQ_DOT_LUSTRE' (0x200000002) range is reserved for files
105 under the hidden ".lustre" directory in the root of the filesystem.
106
107 The 'FID_SEQ_LOCAL_NAME' (0x200000003) range is reserved for objects
108 internal to the server that are allocated by name.
109
110 The 'FID_SEQ_NORMAL' (0x200000400+) range is used for normal object
111 identifiers.  These objects are visible in the namespace if allocated
112 by an MDT, or may be OST objects.
113 ****