Blame |
Last modification |
View Log
| RSS feed
#include <fs/types.h>
#include <fs/errno.h>
#include <fs/maccess.h>
#include <fs/mount.h>
#include "fsconst.h"
#include "fs.h"
#include "debug.h"
int k_mount(__dev_t device,
__uint8_t fsind,
char *where,
struct mount_opts *options)
{
declare_buffer(char,dname,MAXFILENAMELEN);
declare_buffer(struct mount_opts,opts,1);
int len;
int res;
call_to_fs();
len=__verify_read_nolen((char*)where);
if ((!len)||(len>MAXFILENAMELEN)) return_from_fs(-EVERIFY);
__copy_from_user(dname,where,len+1);
if (options!=NULL) {
res=__verify_read(opts,sizeof(struct mount_opts));
if (!res) return_from_fs(-EVERIFY);
__copy_from_user(opts,options,len+1);
return_from_fs(mount_device(device,fsind,dname,opts));
}
return_from_fs(mount_device(device,fsind,dname,NULL));
}