http://prdownloads.sourceforge.net/lufs/lufs-0.9.7.tar.gz?download
[lufs.git] / lufsd / filesystem.h
1 /*
2  * filesystem.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 _FILESYSTEM_H_
24 #define _FILESYSTEM_H_
25
26 struct fs_operations{
27     void        *(*init)(struct list_head*, struct dir_cache*, struct credentials*, void**);
28     void        (*free)(void*);
29     int         (*mount)(void*);
30     void        (*umount)(void*);
31     int         (*readdir)(void*, char*, struct directory*);
32     int         (*stat)(void*, char*, struct lufs_fattr*);
33     int         (*mkdir)(void*, char*, int);
34     int         (*rmdir)(void*, char*);
35     int         (*create)(void*, char*, int);
36     int         (*unlink)(void*, char*);
37     int         (*rename)(void*, char*, char*);
38     int         (*open)(void*, char*, unsigned);
39     int         (*release)(void*, char*);
40     int         (*read)(void*, char*, long long, unsigned long, char*);
41     int         (*write)(void*, char*, long long, unsigned long, char*);
42     int         (*readlink)(void*, char*, char*, int);
43     int         (*link)(void*, char*, char*);
44     int         (*symlink)(void*, char*, char*);
45     int         (*setattr)(void*, char*, struct lufs_fattr*);
46 };
47
48 struct file_system{
49     struct message              fs_msg;
50     struct fs_operations        *fs_ops;
51     struct credentials          *fs_credentials;
52     struct list_head            *fs_config;
53     struct dir_cache            *fs_cache;
54     void                        *fs_context;
55     int                         fs_mounted;
56     char                        fs_buf[LU_MAXDATA];
57 };
58
59
60 void handle_fs(struct file_system*, int, pid_t);
61
62 #endif
63