blob: 6c640aece9e364385d57ad62215a4b8d2fdbae69
1 | /* |
2 | FUSE: Filesystem in Userspace |
3 | Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> |
4 | |
5 | This program can be distributed under the terms of the GNU LGPLv2. |
6 | See the file COPYING.LIB. |
7 | */ |
8 | |
9 | #include "config.h" |
10 | #include "fuse_i.h" |
11 | #include "fuse_lowlevel.h" |
12 | |
13 | struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args) |
14 | { |
15 | struct fuse_chan *ch; |
16 | int fd; |
17 | |
18 | fd = fuse_kern_mount(mountpoint, args); |
19 | if (fd == -1) |
20 | return NULL; |
21 | |
22 | ch = fuse_kern_chan_new(fd); |
23 | if (!ch) |
24 | fuse_kern_unmount(mountpoint, fd); |
25 | |
26 | return ch; |
27 | } |
28 | |
29 | void fuse_unmount(const char *mountpoint, struct fuse_chan *ch) |
30 | { |
31 | int fd = ch ? fuse_chan_fd(ch) : -1; |
32 | fuse_kern_unmount(mountpoint, fd); |
33 | fuse_chan_destroy(ch); |
34 | } |
35 | |
36 | int fuse_version(void) |
37 | { |
38 | return FUSE_VERSION; |
39 | } |
40 | |
41 |