loop-util: rename loop_device_open() -> loop_device_open_from_path()

No functional changes, just preparation for later commits.
This commit is contained in:
Yu Watanabe
2022-09-28 17:42:37 +09:00
parent fd690a4b7f
commit de3b7f168e
5 changed files with 9 additions and 6 deletions
+5 -2
View File
@@ -31,8 +31,11 @@ struct LoopDevice {
int loop_device_make(int fd, int open_flags, uint64_t offset, uint64_t size, uint32_t loop_flags, int lock_op, LoopDevice **ret);
int loop_device_make_by_path(const char *path, int open_flags, uint32_t loop_flags, int lock_op, LoopDevice **ret);
int loop_device_open_full(const char *loop_path, int loop_fd, int open_flags, int lock_op, LoopDevice **ret);
static inline int loop_device_open(const char *loop_path, int open_flags, int lock_op, LoopDevice **ret) {
return loop_device_open_full(loop_path, -1, open_flags, lock_op, ret);
static inline int loop_device_open_from_fd(int fd, int open_flags, int lock_op, LoopDevice **ret) {
return loop_device_open_full(NULL, fd, open_flags, lock_op, ret);
}
static inline int loop_device_open_from_path(const char *path, int open_flags, int lock_op, LoopDevice **ret) {
return loop_device_open_full(path, -1, open_flags, lock_op, ret);
}
LoopDevice* loop_device_ref(LoopDevice *d);