Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / liblustre / llite_fid.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Lustre Light Super operations
5  *
6  *  Copyright (c) 2006 Cluster File Systems, Inc.
7  *
8  *   This file is part of Lustre, http://www.lustre.org.
9  *
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.
13  *
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.
18  *
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.
22  */
23
24 #include <stdlib.h>
25 #include <string.h>
26 #include <assert.h>
27 #include <signal.h>
28 #include <sys/types.h>
29 #include <sys/stat.h>
30 #include <sys/queue.h>
31
32 #ifdef HAVE_XTIO_H
33 #include <xtio.h>
34 #endif
35 #include <sysio.h>
36 #include <fs.h>
37 #include <mount.h>
38 #include <inode.h>
39 #ifdef HAVE_FILE_H
40 #include <file.h>
41 #endif
42
43 /* both sys/queue.h (libsysio require it) and portals/lists.h have definition
44  * of 'LIST_HEAD'. undef it to suppress warnings
45  */
46 #undef LIST_HEAD
47 #include <lnet/lnetctl.h>     /* needed for parse_dump */
48
49 #include "lutil.h"
50 #include "llite_lib.h"
51 #include <lustre_ver.h>
52 #include <lustre_fid.h>
53
54 /* build inode number on passed @fid */
55 unsigned long llu_fid_build_ino(struct llu_sb_info *sbi,
56                                 struct lu_fid *fid)
57 {
58         unsigned long ino;
59         ENTRY;
60         ino = fid_flatten(fid);
61         RETURN(ino & 0x7fffffff);
62 }