Subversion Repositories shark

Rev

Rev 1063 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
 
1063 tullio 2
/*
3
 * This program is free software; you can redistribute it and/or modify
4
 * it under the terms of the GNU General Public License as published by
5
 * the Free Software Foundation; either version 2 of the License, or
6
 * (at your option) any later version.
7
 *
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 * GNU General Public License for more details.
12
 *
13
 * You should have received a copy of the GNU General Public License
14
 * along with this program; if not, write to the Free Software
15
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
 *
17
 */
18
 
2 pj 19
#include <fs/types.h>
20
#include <fs/errno.h>
21
#include <fs/maccess.h>
22
#include <fs/mount.h>
23
 
24
#include "fsconst.h"
25
#include "fs.h"
26
 
27
#include "debug.h"
28
 
29
int k_mount(__dev_t device,
30
            __uint8_t fsind,
31
            char *where,
32
            struct mount_opts *options)
33
{
34
  declare_buffer(char,dname,MAXFILENAMELEN);  
35
  declare_buffer(struct mount_opts,opts,1);
36
  int len;
37
  int res;
38
 
39
  call_to_fs();
40
 
41
  len=__verify_read_nolen((char*)where);
42
  if ((!len)||(len>MAXFILENAMELEN)) return_from_fs(-EVERIFY);
43
  __copy_from_user(dname,where,len+1);
44
 
45
  if (options!=NULL) {
46
    res=__verify_read(opts,sizeof(struct mount_opts));
47
    if (!res) return_from_fs(-EVERIFY);
48
    __copy_from_user(opts,options,len+1);
49
 
50
    return_from_fs(mount_device(device,fsind,dname,opts));
51
  }
52
 
53
  return_from_fs(mount_device(device,fsind,dname,NULL));
54
}
55