Subversion Repositories shark

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | 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
#include <fs/bdev.h>
7
 
8
#include "fsconst.h"
9
#include "debug.h"
10
#include "fs.h"
11
 
12
int k_fdevice(char *device_name)
13
{
14
  declare_buffer(char,dname,MAXFILENAMELEN);
15
  int len,ret;
16
 
17
  call_to_fs();
18
 
19
  len=__verify_read_nolen((char*)device_name);
20
  if ((!len)||(len>MAXFILENAMELEN)) return_from_fs(-EVERIFY);
21
  __copy_from_user(dname,device_name,len+1);
22
 
23
  ret=(int)bdev_find_byname(dname);
24
  if (ret<0) return_from_fs(-EINVAL);
25
 
26
  return_from_fs(ret);
27
}
28