diff options
-rw-r--r-- | mount/lomount.c | 10 | ||||
-rw-r--r-- | mount/lomount.h | 20 | ||||
-rw-r--r-- | mount/loop.h | 54 |
3 files changed, 7 insertions, 77 deletions
diff --git a/mount/lomount.c b/mount/lomount.c index 32655cba3..d38b36404 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -18,12 +18,11 @@ #include <getopt.h> #include <stdarg.h> -#include "loop.h" -#include "lomount.h" #include "strutils.h" #include "nls.h" #include "sundries.h" #include "pathnames.h" +#include "loopdev.h" static int is_associated(int dev, struct stat *file, unsigned long long offset, int isoff); @@ -49,6 +48,11 @@ struct looplist { #define LLFLG_SUBDIR (1 << 5) /* /dev/loop/N */ #define LLFLG_DFLT (1 << 6) /* directly try to check default loops */ +#define SETLOOP_RDONLY (1<<0) /* Open loop read-only */ +#define SETLOOP_AUTOCLEAR (1<<1) /* Automatically detach loop on close (2.6.25?) */ + +static int del_loop (const char *device); + /* TODO: move to lib/sysfs.c */ static char *loopfile_from_sysfs(const char *device) { @@ -882,7 +886,7 @@ delete_all_devices (void) return ok; } -int +static int del_loop (const char *device) { int fd, errsv; diff --git a/mount/lomount.h b/mount/lomount.h deleted file mode 100644 index 4acc37185..000000000 --- a/mount/lomount.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef UTIL_LINUX_LOMOUNT_H -#define UTIL_LINUX_LOMOUNT_H - -extern int set_loop(const char *, const char *, unsigned long long, unsigned long long, - const char *, int, int *); -extern int del_loop(const char *); -extern int is_loop_device(const char *); -extern int is_loop_autoclear(const char *device); -extern char * find_unused_loop_device(void); - -extern int loopfile_used_with(char *devname, const char *filename, unsigned long long offset); -extern char *loopfile_used (const char *filename, unsigned long long offset); -extern char *loopdev_get_loopfile(const char *device); -extern int find_loopdev_by_backing_file(const char *filename, char **loopdev); - - -#define SETLOOP_RDONLY (1<<0) /* Open loop read-only */ -#define SETLOOP_AUTOCLEAR (1<<1) /* Automatically detach loop on close (2.6.25?) */ - -#endif /* !UTIL_LINUX_LOMOUNT_H */ diff --git a/mount/loop.h b/mount/loop.h deleted file mode 100644 index 891826f7d..000000000 --- a/mount/loop.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef MNT_LOOP_H -#define MNT_LOOP_H - -#include <linux/posix_types.h> -#include <stdint.h> -#include "linux_version.h" - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68) -#define my_dev_t __kernel_dev_t -#else -#define my_dev_t __kernel_old_dev_t -#endif - -#define LO_CRYPT_NONE 0 -#define LO_CRYPT_XOR 1 -#define LO_CRYPT_DES 2 -#define LO_CRYPT_CRYPTOAPI 18 - -#define LOOP_SET_FD 0x4C00 -#define LOOP_CLR_FD 0x4C01 -#define LOOP_SET_STATUS 0x4C02 -#define LOOP_GET_STATUS 0x4C03 -#define LOOP_SET_STATUS64 0x4C04 -#define LOOP_GET_STATUS64 0x4C05 -/* #define LOOP_CHANGE_FD 0x4C06 */ -#define LOOP_SET_CAPACITY 0x4C07 - -/* Flags for loop_into{64,}->lo_flags */ -enum { - LO_FLAGS_READ_ONLY = 1, - LO_FLAGS_USE_AOPS = 2, - LO_FLAGS_AUTOCLEAR = 4, /* New in 2.6.25 */ -}; - -#define LO_NAME_SIZE 64 -#define LO_KEY_SIZE 32 - -struct loop_info64 { - uint64_t lo_device; - uint64_t lo_inode; - uint64_t lo_rdevice; - uint64_t lo_offset; - uint64_t lo_sizelimit; /* bytes, 0 == max available */ - uint32_t lo_number; - uint32_t lo_encrypt_type; - uint32_t lo_encrypt_key_size; - uint32_t lo_flags; - uint8_t lo_file_name[LO_NAME_SIZE]; - uint8_t lo_crypt_name[LO_NAME_SIZE]; - uint8_t lo_encrypt_key[LO_KEY_SIZE]; - uint64_t lo_init[2]; -}; - -#endif /* MNT_LOOP_H */ |