root/include/linux/loop.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _LINUX_LOOP_H
   2 #define _LINUX_LOOP_H
   3 
   4 /*
   5  * include/linux/loop.h
   6  *
   7  * Written by Theodore Ts'o, 3/29/93.
   8  *
   9  * Copyright 1993 by Theodore Ts'o.  Redistribution of this file is
  10  * permitted under the GNU Public License.
  11  */
  12 
  13 #define LO_NAME_SIZE    64
  14 #define LO_KEY_SIZE     32
  15 
  16 #ifdef __KERNEL__
  17        
  18 struct loop_device {
  19         int             lo_number;
  20         struct inode    *lo_inode;
  21         int             lo_refcnt;
  22         kdev_t          lo_device;
  23         int             lo_offset;
  24         int             lo_encrypt_type;
  25         int             lo_encrypt_key_size;
  26         int             lo_flags;
  27         int             (*transfer)(struct loop_device *, int cmd,
  28                                     char *raw_buf, char *loop_buf, int size);
  29         char            lo_name[LO_NAME_SIZE];
  30         char            lo_encrypt_key[LO_KEY_SIZE];
  31 #ifdef DES_AVAILABLE
  32         des_key_schedule lo_des_key;
  33         unsigned long   lo_des_init[2];
  34 #endif
  35 };
  36 
  37 typedef int (* transfer_proc_t)(struct loop_device *, int cmd,
  38                                 char *raw_buf, char *loop_buf, int size);
  39 
  40 /*
  41  * Loop flags
  42  */
  43 #define LO_FLAGS_DO_BMAP        0x00000001
  44 #define LO_FLAGS_READ_ONLY      0x00000002
  45 
  46 #endif /* __KERNEL__ */
  47 
  48 struct loop_info {
  49         int             lo_number;      /* ioctl r/o */
  50         dev_t           lo_device;      /* ioctl r/o */
  51         unsigned long   lo_inode;       /* ioctl r/o */
  52         dev_t           lo_rdevice;     /* ioctl r/o */
  53         int             lo_offset;
  54         int             lo_encrypt_type;
  55         int             lo_encrypt_key_size;    /* ioctl w/o */
  56         int             lo_flags;       /* ioctl r/o */
  57         char            lo_name[LO_NAME_SIZE];
  58         unsigned char   lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
  59         unsigned long   lo_init[2];
  60         char            reserved[4];
  61 };
  62 
  63 /*
  64  * Loop encryption types --- LO_CRYPT_IDEA isn't supported yet
  65  */
  66 
  67 #define LO_CRYPT_NONE   0
  68 #define LO_CRYPT_XOR    1
  69 #define LO_CRYPT_DES    2
  70 #define LO_CRYPT_IDEA   3
  71 #define MAX_LO_CRYPT    4
  72 
  73 /*
  74  * IOCTL commands --- we will commandeer 0x4C ('L')
  75  */
  76 
  77 #define LOOP_SET_FD     0x4C00
  78 #define LOOP_CLR_FD     0x4C01
  79 #define LOOP_SET_STATUS 0x4C02
  80 #define LOOP_GET_STATUS 0x4C03
  81 
  82 #endif

/* [previous][next][first][last][top][bottom][index][help] */