~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/loop.h

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * include/linux/loop.h
  3  *
  4  * Written by Theodore Ts'o, 3/29/93.
  5  *
  6  * Copyright 1993 by Theodore Ts'o.  Redistribution of this file is
  7  * permitted under the GNU General Public License.
  8  */
  9 #ifndef _LINUX_LOOP_H
 10 #define _LINUX_LOOP_H
 11 
 12 #include <linux/bio.h>
 13 #include <linux/blkdev.h>
 14 #include <linux/spinlock.h>
 15 #include <linux/mutex.h>
 16 #include <uapi/linux/loop.h>
 17 
 18 /* Possible states of device */
 19 enum {
 20         Lo_unbound,
 21         Lo_bound,
 22         Lo_rundown,
 23 };
 24 
 25 struct loop_func_table;
 26 
 27 struct loop_device {
 28         int             lo_number;
 29         int             lo_refcnt;
 30         loff_t          lo_offset;
 31         loff_t          lo_sizelimit;
 32         int             lo_flags;
 33         int             (*transfer)(struct loop_device *, int cmd,
 34                                     struct page *raw_page, unsigned raw_off,
 35                                     struct page *loop_page, unsigned loop_off,
 36                                     int size, sector_t real_block);
 37         char            lo_file_name[LO_NAME_SIZE];
 38         char            lo_crypt_name[LO_NAME_SIZE];
 39         char            lo_encrypt_key[LO_KEY_SIZE];
 40         int             lo_encrypt_key_size;
 41         struct loop_func_table *lo_encryption;
 42         __u32           lo_init[2];
 43         kuid_t          lo_key_owner;   /* Who set the key */
 44         int             (*ioctl)(struct loop_device *, int cmd, 
 45                                  unsigned long arg); 
 46 
 47         struct file *   lo_backing_file;
 48         struct block_device *lo_device;
 49         unsigned        lo_blocksize;
 50         void            *key_data; 
 51 
 52         gfp_t           old_gfp_mask;
 53 
 54         spinlock_t              lo_lock;
 55         struct bio_list         lo_bio_list;
 56         unsigned int            lo_bio_count;
 57         int                     lo_state;
 58         struct mutex            lo_ctl_mutex;
 59         struct task_struct      *lo_thread;
 60         wait_queue_head_t       lo_event;
 61         /* wait queue for incoming requests */
 62         wait_queue_head_t       lo_req_wait;
 63 
 64         struct request_queue    *lo_queue;
 65         struct gendisk          *lo_disk;
 66 };
 67 
 68 /* Support for loadable transfer modules */
 69 struct loop_func_table {
 70         int number;     /* filter type */ 
 71         int (*transfer)(struct loop_device *lo, int cmd,
 72                         struct page *raw_page, unsigned raw_off,
 73                         struct page *loop_page, unsigned loop_off,
 74                         int size, sector_t real_block);
 75         int (*init)(struct loop_device *, const struct loop_info64 *); 
 76         /* release is called from loop_unregister_transfer or clr_fd */
 77         int (*release)(struct loop_device *); 
 78         int (*ioctl)(struct loop_device *, int cmd, unsigned long arg);
 79         struct module *owner;
 80 }; 
 81 
 82 int loop_register_transfer(struct loop_func_table *funcs);
 83 int loop_unregister_transfer(int number); 
 84 
 85 #endif
 86 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp