Whamcloud - gitweb
land b1_5 onto HEAD
[fs/lustre-release.git] / lustre / include / lvfs.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  * lustre VFS/process permission interface
22  */
23
24 #ifndef __LVFS_H__
25 #define __LVFS_H__
26
27 #define LL_FID_NAMELEN (16 + 1 + 8 + 1)
28
29 #include <libcfs/kp30.h>
30 #if defined(__linux__)
31 #include <linux/lvfs.h>
32 #elif defined(__APPLE__)
33 #include <darwin/lvfs.h>
34 #elif defined(__WINNT__)
35 #include <winnt/lvfs.h>
36 #else
37 #error Unsupported operating system.
38 #endif
39
40 #include <lustre_ucache.h>
41
42
43 #ifdef LIBLUSTRE
44 #include <lvfs_user_fs.h>
45 #endif
46
47 /* lvfs_common.c */
48 struct dentry *lvfs_fid2dentry(struct lvfs_run_ctxt *, __u64, __u32, __u64 ,void *data);
49
50 void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx,
51                struct lvfs_ucred *cred);
52 void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx,
53               struct lvfs_ucred *cred);
54
55
56 static inline int ll_fid2str(char *str, __u64 id, __u32 generation)
57 {
58         return sprintf(str, "%llx:%08x", (unsigned long long)id, generation);
59 }
60
61 #endif