Rev 3 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | |
2 | #include <fs/types.h> |
||
3 | #include <fs/errno.h> |
||
4 | #include <fs/maccess.h> |
||
5 | #include <fs/mount.h> |
||
6 | |||
7 | #include "fsconst.h" |
||
8 | #include "fs.h" |
||
9 | |||
10 | #include "debug.h" |
||
11 | |||
12 | int k_mount(__dev_t device, |
||
13 | __uint8_t fsind, |
||
14 | char *where, |
||
15 | struct mount_opts *options) |
||
16 | { |
||
17 | declare_buffer(char,dname,MAXFILENAMELEN); |
||
18 | declare_buffer(struct mount_opts,opts,1); |
||
19 | int len; |
||
20 | int res; |
||
21 | |||
22 | call_to_fs(); |
||
23 | |||
24 | len=__verify_read_nolen((char*)where); |
||
25 | if ((!len)||(len>MAXFILENAMELEN)) return_from_fs(-EVERIFY); |
||
26 | __copy_from_user(dname,where,len+1); |
||
27 | |||
28 | if (options!=NULL) { |
||
29 | res=__verify_read(opts,sizeof(struct mount_opts)); |
||
30 | if (!res) return_from_fs(-EVERIFY); |
||
31 | __copy_from_user(opts,options,len+1); |
||
32 | |||
33 | return_from_fs(mount_device(device,fsind,dname,opts)); |
||
34 | } |
||
35 | |||
36 | return_from_fs(mount_device(device,fsind,dname,NULL)); |
||
37 | } |
||
38 |