Lines Matching refs:filp
225 static int sg_allow_access(struct file *filp, unsigned char *cmd) in sg_allow_access() argument
227 struct sg_fd *sfp = filp->private_data; in sg_allow_access()
232 return blk_verify_command(cmd, filp->f_mode & FMODE_WRITE); in sg_allow_access()
273 sg_open(struct inode *inode, struct file *filp) in sg_open() argument
276 int flags = filp->f_flags; in sg_open()
282 nonseekable_open(inode, filp); in sg_open()
346 filp->private_data = sfp; in sg_open()
372 sg_release(struct inode *inode, struct file *filp) in sg_release() argument
377 if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) in sg_release()
399 sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) in sg_read() argument
409 if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) in sg_read()
450 if (filp->f_flags & O_NONBLOCK) { in sg_read()
583 sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) in sg_write() argument
595 if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) in sg_write()
601 if (!((filp->f_flags & O_NONBLOCK) || in sg_write()
611 blocking = !(filp->f_flags & O_NONBLOCK); in sg_write()
613 return sg_new_write(sfp, filp, buf, count, in sg_write()
838 sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) in sg_ioctl() argument
848 if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) in sg_ioctl()
853 read_only = (O_RDWR != (filp->f_flags & O_ACCMODE)); in sg_ioctl()
863 result = sg_new_write(sfp, filp, p, SZ_SG_IO_HDR, in sg_ioctl()
1075 if (sg_allow_access(filp, &opcode)) in sg_ioctl()
1078 return sg_scsi_ioctl(sdp->device->request_queue, NULL, filp->f_mode, p); in sg_ioctl()
1115 cmd_in, filp->f_flags & O_NDELAY); in sg_ioctl()
1122 static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) in sg_compat_ioctl() argument
1128 if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) in sg_compat_ioctl()
1145 sg_poll(struct file *filp, poll_table * wait) in sg_poll() argument
1154 sfp = filp->private_data; in sg_poll()
1160 poll_wait(filp, &sfp->read_wait, wait); in sg_poll()
1183 sg_fasync(int fd, struct file *filp, int mode) in sg_fasync() argument
1188 if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) in sg_fasync()
1193 return fasync_helper(fd, filp, mode, &sfp->async_qp); in sg_fasync()
1237 sg_mmap(struct file *filp, struct vm_area_struct *vma) in sg_mmap() argument
1244 if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data))) in sg_mmap()
2290 static ssize_t sg_proc_write_adio(struct file *filp, const char __user *buffer,
2302 static ssize_t sg_proc_write_dressz(struct file *filp,
2443 sg_proc_write_adio(struct file *filp, const char __user *buffer, in sg_proc_write_adio() argument
2464 sg_proc_write_dressz(struct file *filp, const char __user *buffer, in sg_proc_write_dressz() argument