Files
laptops-kernel/drivers/block/loop.h
T

72 lines
1.5 KiB
C
Raw Normal View History

2005-04-16 15:20:36 -07:00
/*
2013-05-12 10:14:07 -04:00
* loop.h
2005-04-16 15:20:36 -07:00
*
* Written by Theodore Ts'o, 3/29/93.
*
* Copyright 1993 by Theodore Ts'o. Redistribution of this file is
* permitted under the GNU General Public License.
*/
2012-10-13 10:46:48 +01:00
#ifndef _LINUX_LOOP_H
#define _LINUX_LOOP_H
2005-04-16 15:20:36 -07:00
#include <linux/bio.h>
#include <linux/blkdev.h>
2015-01-02 15:20:25 -07:00
#include <linux/blk-mq.h>
2005-04-16 15:20:36 -07:00
#include <linux/spinlock.h>
2006-03-23 03:00:38 -08:00
#include <linux/mutex.h>
2012-10-13 10:46:48 +01:00
#include <uapi/linux/loop.h>
2005-04-16 15:20:36 -07:00
/* Possible states of device */
enum {
Lo_unbound,
Lo_bound,
Lo_rundown,
Lo_deleting,
2005-04-16 15:20:36 -07:00
};
struct loop_func_table;
struct loop_device {
int lo_number;
atomic_t lo_refcnt;
2005-04-16 15:20:36 -07:00
loff_t lo_offset;
loff_t lo_sizelimit;
int lo_flags;
char lo_file_name[LO_NAME_SIZE];
struct file * lo_backing_file;
struct block_device *lo_device;
2005-10-21 03:22:34 -04:00
gfp_t old_gfp_mask;
2005-04-16 15:20:36 -07:00
spinlock_t lo_lock;
int lo_state;
spinlock_t lo_work_lock;
struct workqueue_struct *workqueue;
struct work_struct rootcg_work;
struct list_head rootcg_cmd_list;
struct list_head idle_worker_list;
struct rb_root worker_tree;
struct timer_list timer;
bool use_dio;
bool sysfs_inited;
2005-04-16 15:20:36 -07:00
2007-07-23 18:44:00 -07:00
struct request_queue *lo_queue;
2014-12-31 13:22:57 +00:00
struct blk_mq_tag_set tag_set;
2007-05-08 00:28:20 -07:00
struct gendisk *lo_disk;
struct mutex lo_mutex;
2021-09-02 09:07:35 +09:00
bool idr_visible;
2005-04-16 15:20:36 -07:00
};
2014-12-31 13:22:57 +00:00
struct loop_cmd {
struct list_head list_entry;
bool use_aio; /* use AIO interface to handle I/O */
atomic_t ref; /* only for aio */
2017-04-20 16:03:02 +02:00
long ret;
2015-08-17 10:31:51 +08:00
struct kiocb iocb;
struct bio_vec *bvec;
2021-06-28 19:38:21 -07:00
struct cgroup_subsys_state *blkcg_css;
struct cgroup_subsys_state *memcg_css;
2014-12-31 13:22:57 +00:00
};
2005-04-16 15:20:36 -07:00
#endif