Prevent -I/usr/include during Linux kernel module compilation.
[lufs.git] / kernel / Linux / 2.4 / lufs.h
1 /*
2  * lufs.h
3  * Copyright (C) 2002 Florin Malita <mali@go.ro>
4  *
5  * This file is part of LUFS, a free userspace filesystem implementation.
6  * See http://lufs.sourceforge.net/ for updates.
7  *
8  * LUFS is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * LUFS is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef _LUFS_H_
24 #define _LUFS_H_
25
26 #include <linux/list.h>
27 #include <linux/un.h>
28 #include <linux/spinlock.h>
29
30 #include "proto.h"
31
32 #undef TRACE
33 #undef WARN
34 #undef VERBOSE
35 #undef ERROR
36
37 #ifdef LUFS_DEBUG
38 #define TRACE(x...)     do { printk(KERN_INFO "(%s) - ", __func__); printk(x); } while(0)
39 #define WARN(x...)      do { printk(KERN_ERR "(%s) - ", __func__); printk(x); } while(0)
40 #else
41 #define TRACE(x...)     do {} while(0)
42 #define WARN(x...)      do {} while(0)
43 #endif
44
45 #ifdef LUFS_VERBOSE
46 #define VERBOSE(x...)   do { printk(KERN_INFO "(%s) - ", __func__); printk(x); } while(0)
47 #else
48 #define VERBOSE(x...)   do {} while(0)
49 #endif
50
51 #define ERROR(x...)     do { printk(KERN_ERR "(%s) - ", __func__); printk(x); } while(0)
52
53 #define GET_INFO(sb)    ((struct lufs_sb_info*)sb->u.generic_sbp)
54
55 #define LU_MAXPATHLEN   1024
56 #define LU_MAXTRIES     10
57 #define LU_MAXIOVEC     5
58 #define LU_NRSLOTS      3
59 #define LU_MAGIC        0xfade
60 #define LU_MAXAGE       HZ*5
61
62 #define LU_DEF_UID      2
63 #define LU_DEF_GID      2
64
65 #define LU_BLOCKSIZE    512
66 #define LU_BLOCKSIZEBITS        9
67
68 struct lufs_config{
69     __kernel_uid_t      uid;
70     __kernel_gid_t      gid;
71     __kernel_mode_t     fmode;
72     __kernel_mode_t     dmode;
73     unsigned            channels;
74     int                 own_fs;
75 };
76
77 struct lufs_sb_info{
78     struct list_head    slots;
79     struct lufs_config  config;
80     rwlock_t            lock;
81     char                server_socket[UNIX_PATH_MAX];
82     pid_t               server_pid;
83     char                root[UNIX_PATH_MAX];
84     unsigned            rootlen;
85 };
86
87 #endif