Lines Matching refs:file

55 static loff_t mtdchar_lseek(struct file *file, loff_t offset, int orig)  in mtdchar_lseek()  argument
57 struct mtd_file_info *mfi = file->private_data; in mtdchar_lseek()
58 return fixed_size_llseek(file, offset, orig, mfi->mtd->size); in mtdchar_lseek()
61 static int mtdchar_open(struct inode *inode, struct file *file) in mtdchar_open() argument
72 if ((file->f_mode & FMODE_WRITE) && (minor & 1)) in mtdchar_open()
89 if ((file->f_mode & FMODE_WRITE) && !(mtd->flags & MTD_WRITEABLE)) { in mtdchar_open()
100 file->private_data = mfi; in mtdchar_open()
113 static int mtdchar_close(struct inode *inode, struct file *file) in mtdchar_close() argument
115 struct mtd_file_info *mfi = file->private_data; in mtdchar_close()
121 if ((file->f_mode & FMODE_WRITE)) in mtdchar_close()
125 file->private_data = NULL; in mtdchar_close()
149 static ssize_t mtdchar_read(struct file *file, char __user *buf, size_t count, in mtdchar_read() argument
152 struct mtd_file_info *mfi = file->private_data; in mtdchar_read()
235 static ssize_t mtdchar_write(struct file *file, const char __user *buf, size_t count, in mtdchar_write() argument
238 struct mtd_file_info *mfi = file->private_data; in mtdchar_write()
362 static int mtdchar_writeoob(struct file *file, struct mtd_info *mtd, in mtdchar_writeoob() argument
366 struct mtd_file_info *mfi = file->private_data; in mtdchar_writeoob()
371 if (!(file->f_mode & FMODE_WRITE)) in mtdchar_writeoob()
411 static int mtdchar_readoob(struct file *file, struct mtd_info *mtd, in mtdchar_readoob() argument
415 struct mtd_file_info *mfi = file->private_data; in mtdchar_readoob()
586 static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) in mtdchar_ioctl() argument
588 struct mtd_file_info *mfi = file->private_data; in mtdchar_ioctl()
654 if(!(file->f_mode & FMODE_WRITE)) in mtdchar_ioctl()
726 ret = mtdchar_writeoob(file, mtd, buf.start, buf.length, in mtdchar_ioctl()
740 ret = mtdchar_readoob(file, mtd, buf.start, buf.length, in mtdchar_ioctl()
753 ret = mtdchar_writeoob(file, mtd, buf.start, buf.length, in mtdchar_ioctl()
767 ret = mtdchar_readoob(file, mtd, buf.start, buf.length, in mtdchar_ioctl()
864 file->f_pos = 0; in mtdchar_ioctl()
959 file->f_pos = 0; in mtdchar_ioctl()
989 static long mtdchar_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) in mtdchar_unlocked_ioctl() argument
994 ret = mtdchar_ioctl(file, cmd, arg); in mtdchar_unlocked_ioctl()
1011 static long mtdchar_compat_ioctl(struct file *file, unsigned int cmd, in mtdchar_compat_ioctl() argument
1014 struct mtd_file_info *mfi = file->private_data; in mtdchar_compat_ioctl()
1030 ret = mtdchar_writeoob(file, mtd, buf.start, in mtdchar_compat_ioctl()
1045 ret = mtdchar_readoob(file, mtd, buf.start, in mtdchar_compat_ioctl()
1074 ret = mtdchar_ioctl(file, cmd, (unsigned long)argp); in mtdchar_compat_ioctl()
1090 static unsigned long mtdchar_get_unmapped_area(struct file *file, in mtdchar_get_unmapped_area() argument
1096 struct mtd_file_info *mfi = file->private_data; in mtdchar_get_unmapped_area()
1115 static unsigned mtdchar_mmap_capabilities(struct file *file) in mtdchar_mmap_capabilities() argument
1117 struct mtd_file_info *mfi = file->private_data; in mtdchar_mmap_capabilities()
1126 static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma) in mtdchar_mmap() argument
1129 struct mtd_file_info *mfi = file->private_data; in mtdchar_mmap()
1139 if (file->f_flags & O_DSYNC || map->phys >= __pa(high_memory)) in mtdchar_mmap()