1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/fid/fid_lib.c
38 * Miscellaneous fid functions.
40 * Author: Nikita Danilov <nikita@clusterfs.com>
41 * Author: Yury Umanets <umka@clusterfs.com>
45 # define EXPORT_SYMTAB
47 #define DEBUG_SUBSYSTEM S_FID
50 # include <libcfs/libcfs.h>
51 # include <linux/module.h>
52 #else /* __KERNEL__ */
53 # include <liblustre.h>
57 #include <lu_object.h>
58 #include <lustre_fid.h>
61 * A cluster-wide range from which fid-sequences are granted to servers and
66 * Normal FID: seq:64 [2^33,2^64-1] oid:32 ver:32
67 * IGIF : 0:32, ino:32 gen:32 0:32
68 * IDIF : 0:31, 1:1, ost-index:16, objd:48 0:32
71 * The first 0x400 sequences of normal FID are reserved for special purpose.
72 * FID_SEQ_START + 1 is for local file id generation.
73 * FID_SEQ_START + 2 is for .lustre directory and its objects
75 const struct lu_seq_range LUSTRE_SEQ_SPACE_RANGE = {
76 FID_SEQ_DISTRIBUTED_START,
79 EXPORT_SYMBOL(LUSTRE_SEQ_SPACE_RANGE);
81 /* Zero range, used for init and other purposes. */
82 const struct lu_seq_range LUSTRE_SEQ_ZERO_RANGE = {
86 EXPORT_SYMBOL(LUSTRE_SEQ_ZERO_RANGE);
88 /* Lustre Big Fs Lock fid. */
89 const struct lu_fid LUSTRE_BFL_FID = { .f_seq = 0x0000000000000003,
90 .f_oid = 0x0000000000000001,
91 .f_ver = 0x0000000000000000 };
92 EXPORT_SYMBOL(LUSTRE_BFL_FID);
94 /** Special fid for ".lustre" directory */
95 const struct lu_fid LU_DOT_LUSTRE_FID = { .f_seq = LU_DOT_LUSTRE_SEQ,
96 .f_oid = 0x0000000000000001,
97 .f_ver = 0x0000000000000000 };
98 EXPORT_SYMBOL(LU_DOT_LUSTRE_FID);
100 /** Special fid for "fid" special object in .lustre */
101 const struct lu_fid LU_OBF_FID = { .f_seq = LU_DOT_LUSTRE_SEQ,
102 .f_oid = 0x0000000000000002,
103 .f_ver = 0x0000000000000000 };
104 EXPORT_SYMBOL(LU_OBF_FID);