Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / osd / osd_igif.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  lustre/osd/osd_igif.c
5  *  igif (compatibility fids) support
6  *
7  *  Copyright (c) 2006 Cluster File Systems, Inc.
8  *   Author: Nikita Danilov <nikita@clusterfs.com>
9  *
10  *   This file is part of the Lustre file system, http://www.lustre.org
11  *   Lustre is a trademark of Cluster File Systems, Inc.
12  *
13  *   You may have signed or agreed to another license before downloading
14  *   this software.  If so, you are bound by the terms and conditions
15  *   of that agreement, and the following does not apply to you.  See the
16  *   LICENSE file included with this distribution for more information.
17  *
18  *   If you did not agree to a different license, then this copy of Lustre
19  *   is open source software; you can redistribute it and/or modify it
20  *   under the terms of version 2 of the GNU General Public License as
21  *   published by the Free Software Foundation.
22  *
23  *   In either case, Lustre is distributed in the hope that it will be
24  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
25  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  *   license text for more details.
27  */
28
29 #ifndef EXPORT_SYMTAB
30 # define EXPORT_SYMTAB
31 #endif
32 #define DEBUG_SUBSYSTEM S_MDS
33
34 #include <linux/module.h>
35
36 /* LUSTRE_VERSION_CODE */
37 #include <lustre_ver.h>
38 /* fid stuff */
39 #include <lustre/lustre_idl.h>
40
41 /* struct osd_inode_id */
42 #include "osd_oi.h"
43 #include "osd_igif.h"
44
45 void lu_igif_to_id(const struct lu_fid *fid, struct osd_inode_id *id)
46 {
47         LASSERT(fid_is_igif(fid));
48         id->oii_ino = lu_igif_ino(fid);
49         id->oii_gen = lu_igif_gen(fid);
50 }
51
52 void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen)
53 {
54         fid->f_seq = ino;
55         fid->f_oid = gen;
56         fid->f_ver = 0;
57         LASSERT(fid_is_igif(fid));
58 }