Subversion Repositories shark

Rev

Rev 3 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed


#include <fs/types.h>
#include <fs/errno.h>
#include <fs/maccess.h>
#include <fs/mount.h>
#include <fs/bdev.h>

#include "fsconst.h"
#include "debug.h"
#include "fs.h"

int k_fdevice(char *device_name)
{
  declare_buffer(char,dname,MAXFILENAMELEN);
  int len,ret;

  call_to_fs();
 
  len=__verify_read_nolen((char*)device_name);
  if ((!len)||(len>MAXFILENAMELEN)) return_from_fs(-EVERIFY);
  __copy_from_user(dname,device_name,len+1);

  ret=(int)bdev_find_byname(dname);
  if (ret<0) return_from_fs(-EINVAL);
 
  return_from_fs(ret);
}