Searched refs:fd_dev (Results 1 - 2 of 2) sorted by relevance

/linux-4.1.27/drivers/target/
H A Dtarget_core_file.c44 static inline struct fd_dev *FD_DEV(struct se_device *dev) FD_DEV()
46 return container_of(dev, struct fd_dev, dev); FD_DEV()
89 struct fd_dev *fd_dev; fd_alloc_device() local
92 fd_dev = kzalloc(sizeof(struct fd_dev), GFP_KERNEL); fd_alloc_device()
93 if (!fd_dev) { fd_alloc_device()
94 pr_err("Unable to allocate memory for struct fd_dev\n"); fd_alloc_device()
98 fd_dev->fd_host = fd_host; fd_alloc_device()
100 pr_debug("FILEIO: Allocated fd_dev for %p\n", name); fd_alloc_device()
102 return &fd_dev->dev; fd_alloc_device()
107 struct fd_dev *fd_dev = FD_DEV(dev); fd_configure_device() local
113 if (!(fd_dev->fbd_flags & FBDF_HAS_PATH)) { fd_configure_device()
133 if (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) { fd_configure_device()
138 file = filp_open(fd_dev->fd_dev_name, flags, 0600); fd_configure_device()
140 pr_err("filp_open(%s) failed\n", fd_dev->fd_dev_name); fd_configure_device()
144 fd_dev->fd_file = file; fd_configure_device()
147 * fd_dev->fd_[block,dev]_size from struct block_device. fd_configure_device()
156 fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev); fd_configure_device()
162 fd_dev->fd_block_size); fd_configure_device()
166 dev_size, div_u64(dev_size, fd_dev->fd_block_size), fd_configure_device()
167 fd_dev->fd_block_size); fd_configure_device()
196 if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) { fd_configure_device()
203 fd_dev->fd_block_size = FD_BLOCKSIZE; fd_configure_device()
222 dev->dev_attrib.hw_block_size = fd_dev->fd_block_size; fd_configure_device()
224 dev->dev_attrib.hw_max_sectors = FD_MAX_BYTES / fd_dev->fd_block_size; fd_configure_device()
227 if (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) { fd_configure_device()
233 fd_dev->fd_dev_id = fd_host->fd_host_dev_id_count++; fd_configure_device()
234 fd_dev->fd_queue_depth = dev->queue_depth; fd_configure_device()
237 " %llu total bytes\n", fd_host->fd_host_id, fd_dev->fd_dev_id, fd_configure_device()
238 fd_dev->fd_dev_name, fd_dev->fd_dev_size); fd_configure_device()
242 if (fd_dev->fd_file) { fd_configure_device()
243 filp_close(fd_dev->fd_file, NULL); fd_configure_device()
244 fd_dev->fd_file = NULL; fd_configure_device()
251 struct fd_dev *fd_dev = FD_DEV(dev); fd_free_device() local
253 if (fd_dev->fd_file) { fd_free_device()
254 filp_close(fd_dev->fd_file, NULL); fd_free_device()
255 fd_dev->fd_file = NULL; fd_free_device()
258 kfree(fd_dev); fd_free_device()
265 struct fd_dev *dev = FD_DEV(se_dev); fd_do_prot_rw()
323 struct fd_dev *dev = FD_DEV(se_dev); fd_do_rw()
387 struct fd_dev *fd_dev = FD_DEV(dev); fd_execute_sync_cache() local
413 ret = vfs_fsync_range(fd_dev->fd_file, start, end, 1); fd_execute_sync_cache()
432 struct fd_dev *fd_dev = FD_DEV(se_dev); fd_execute_write_same() local
473 ret = vfs_iter_write(fd_dev->fd_file, &iter, &pos); fd_execute_write_same()
489 struct fd_dev *fd_dev = FD_DEV(se_dev); fd_do_prot_fill() local
490 struct file *prot_fd = fd_dev->fd_prot_file; fd_do_prot_fill()
495 pr_err("Unable to locate fd_dev->fd_prot_file\n"); fd_do_prot_fill()
583 struct fd_dev *fd_dev = FD_DEV(se_dev); fd_execute_write_same_unmap() local
584 struct file *file = fd_dev->fd_file; fd_execute_write_same_unmap()
684 struct fd_dev *fd_dev = FD_DEV(dev); fd_execute_rw() local
694 vfs_fsync_range(fd_dev->fd_file, start, end, 1); fd_execute_rw()
729 struct fd_dev *fd_dev = FD_DEV(dev); fd_set_configfs_dev_params() local
747 if (match_strlcpy(fd_dev->fd_dev_name, &args[0], fd_set_configfs_dev_params()
753 fd_dev->fd_dev_name); fd_set_configfs_dev_params()
754 fd_dev->fbd_flags |= FBDF_HAS_PATH; fd_set_configfs_dev_params()
762 ret = kstrtoull(arg_p, 0, &fd_dev->fd_dev_size); fd_set_configfs_dev_params()
770 " bytes\n", fd_dev->fd_dev_size); fd_set_configfs_dev_params()
771 fd_dev->fbd_flags |= FBDF_HAS_SIZE; fd_set_configfs_dev_params()
784 " operations for struct fd_dev\n"); fd_set_configfs_dev_params()
786 fd_dev->fbd_flags |= FDBD_HAS_BUFFERED_IO_WCE; fd_set_configfs_dev_params()
800 struct fd_dev *fd_dev = FD_DEV(dev); fd_show_configfs_dev_params() local
803 bl = sprintf(b + bl, "TCM FILEIO ID: %u", fd_dev->fd_dev_id); fd_show_configfs_dev_params()
805 fd_dev->fd_dev_name, fd_dev->fd_dev_size, fd_show_configfs_dev_params()
806 (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) ? fd_show_configfs_dev_params()
813 struct fd_dev *fd_dev = FD_DEV(dev); fd_get_blocks() local
814 struct file *f = fd_dev->fd_file; fd_get_blocks()
825 dev_size = fd_dev->fd_dev_size; fd_get_blocks()
833 struct fd_dev *fd_dev = FD_DEV(dev); fd_init_prot() local
834 struct file *prot_file, *file = fd_dev->fd_file; fd_init_prot()
840 pr_err("Unable to locate fd_dev->fd_file\n"); fd_init_prot()
851 if (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) fd_init_prot()
855 fd_dev->fd_dev_name); fd_init_prot()
863 fd_dev->fd_prot_file = prot_file; fd_init_prot()
898 struct fd_dev *fd_dev = FD_DEV(dev); fd_free_prot() local
900 if (!fd_dev->fd_prot_file) fd_free_prot()
903 filp_close(fd_dev->fd_prot_file, NULL); fd_free_prot()
904 fd_dev->fd_prot_file = NULL; fd_free_prot()
H A Dtarget_core_file.h30 struct fd_dev { struct

Completed in 45 milliseconds