1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Lustre Light Super operations
6 * Copyright (c) 2006 Cluster File Systems, Inc.
8 * This file is part of Lustre, http://www.lustre.org.
10 * Lustre is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
14 * Lustre is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with Lustre; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #define DEBUG_SUBSYSTEM S_LLITE
26 #include <linux/module.h>
27 #include <linux/types.h>
28 #include <linux/random.h>
29 #include <linux/version.h>
31 #include <lustre_fid.h>
32 #include <lustre_lite.h>
33 #include <lustre_ha.h>
34 #include <lustre_ver.h>
35 #include <lustre_dlm.h>
36 #include <lustre_disk.h>
37 #include "llite_internal.h"
39 /* Build inode number on passed @fid */
40 ino_t ll_fid_build_ino(struct ll_sb_info *sbi,
46 if (fid_is_igif(fid)) {
47 ino = lu_igif_ino(fid);
52 * Very stupid and having many downsides inode allocation algorithm
55 ino = fid_flatten(fid);
57 if (unlikely(ino == 0))
58 /* the first result ino is 0xFFC001, so this is rarely used */
60 ino = ino | 0x80000000;