Whamcloud - gitweb
2b3a3d9633a61ea21347671ed3f9ea3fb48a350c
[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 identifies the fragment of a file assigned to that OST.
18
19 The 'f_seq' field holds the sequence number, or SEQ (see below), and
20 is used in conjunction with the 'FID location database' (FLDB) to
21 determine on which target the resource is located.  All resources with
22 the same 'f_seq' value will be on the same target. A target can have
23 more than one 'f_seq' value assigned to it.
24
25 The 'f_oid' field holds the unique 'object identifier' (OID) to
26 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
67 (summarized in the list above), to allow for interoperability with
68 older Lustre filesystems, to identify "well known" objects for
69 internal or external use, as well as for future expansion.
70
71 The 'FID_SEQ_OST_MDT0' (0x0) range is reserved for OST objects created
72 by MDT0 in non-DNE filesystems.  Since all such OST objects used an
73 'f_seq' value of zero these FIDs are not unique across the filesystem,
74 but the reservation of 'FID_SEQ_OST_MDT0' allows these FIDs to co-exist
75 with other FIDs in the same 128-bit identifier space.
76
77 The 'FID_SEQ_LLOG' (0x1) range is reserved for unnamed Lustre log (llog)
78 files, used only internally on the MDS since Lustre 2.4, but previously
79 exposed over the network.
80
81 The 'FID_SEQ_ECHO' (0x2) range is used for temporary objects for
82 testing purposes such as obdfiler-survey.
83
84 The 'FID_SEQ_LLOG_NAME' (0x10) range is used for named llog files such
85 as configuration logs and the ChangeLog.
86
87 The 'FID_SEQ_IGIF' (0xb-0xffffffff) range is reserved for 'inode
88 generation in FID' (IGIF) inodes allocated by MDSs before Lustre 2.0.
89 This corresponds to the 4 billion maximum inode number that could be
90 allocated for such filesystems.  The 'f_oid' field for IGIF FIDs
91 contains the inode version number, and as such there is normally only
92 a single object for each 'f_seq' value.
93
94 The 'FID_SEQ_IDIF' (0x100000000-0x1fffffffff) range is reserved for
95 mapping OST objects that were created by MDT0 using 'FID_SEQ_OST_MDT0'
96 to filesystem-unique FIDs.  The second 16-bit field (bits 16-31) of the
97 'f_seq' field contains the OST index (0-65535).  The low 16-bit field
98 (bits 0-15) of 'f_seq' contains the high (bits 32-47) bits of the OST
99 object ID, and the 32-bit 'f_oid' field contains the low 32 bits of
100 the OST object ID.
101
102 The 'FID_SEQ_LOCAL_FILE' (0x200000001) range is reserved for "well
103 known" objects internal to the server and is not exposed to the network.
104
105 The 'FID_SEQ_DOT_LUSTRE' (0x200000002) range is reserved for files
106 under the hidden ".lustre" directory in the root of the filesystem.
107
108 The 'FID_SEQ_LOCAL_NAME' (0x200000003) range is reserved for objects
109 internal to the server that are allocated by name.
110
111 The 'FID_SEQ_NORMAL' (0x200000400+) range is used for normal object
112 identifiers.  These objects are visible in the namespace if allocated
113 by an MDT, or may be OST objects.
114 ****