Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | FUSE: Filesystem in Userspace |
| 3 | Copyright (C) 2001 Miklos Szeredi (mszeredi@inf.bme.hu) |
| 4 | |
| 5 | This program can be distributed under the terms of the GNU GPL. |
| 6 | See the file COPYING. |
| 7 | */ |
| 8 | |
| 9 | #include "fuse.h" |
| 10 | #include <glib.h> |
| 11 | #include <stdio.h> |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame] | 12 | #include <pthread.h> |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 13 | |
| 14 | #define FUSE_DEV "/proc/fs/fuse/dev" |
| 15 | |
| 16 | typedef unsigned long fino_t; |
| 17 | |
| 18 | struct node { |
| 19 | char *name; |
| 20 | fino_t parent; |
Miklos Szeredi | 5e18348 | 2001-10-31 14:52:35 +0000 | [diff] [blame] | 21 | int mode; |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame] | 22 | int rdev; |
| 23 | int version; |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | struct fuse { |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame] | 27 | int flags; |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 28 | char *dir; |
| 29 | int fd; |
| 30 | struct fuse_operations op; |
| 31 | GHashTable *nametab; |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame] | 32 | pthread_mutex_t lock; |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 33 | }; |
| 34 | |
Miklos Szeredi | a181e61 | 2001-11-06 12:03:23 +0000 | [diff] [blame] | 35 | struct fuse_dirhandle { |
Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame] | 36 | struct fuse *fuse; |
| 37 | fino_t dir; |
| 38 | FILE *fp; |
| 39 | }; |