Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "loopdev"
description = "Setup and control loop devices"
version = "0.2.2"
version = "0.3.0"
authors = ["Michael Daffin <michael@daffin.io>"]
license = "MIT"
documentation = "https://docs.rs/loopdev"
Expand Down
58 changes: 0 additions & 58 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,6 @@ impl LoopDevice {
}
}

/// Attach the loop device to a file starting at offset into the file.
#[deprecated(
since = "0.2.0",
note = "use `loop.with().offset(offset).attach(file)` instead"
)]
pub fn attach<P: AsRef<Path>>(&self, backing_file: P, offset: u64) -> io::Result<()> {
let info = loop_info64 {
lo_offset: offset,
..Default::default()
};

Self::attach_with_loop_info(self, backing_file, info)
}

/// Attach the loop device to a file that maps to the whole file.
///
/// # Examples
Expand All @@ -201,44 +187,6 @@ impl LoopDevice {
Self::attach_with_loop_info(self, backing_file, info)
}

/// Attach the loop device to a file starting at offset into the file.
#[deprecated(
since = "0.2.2",
note = "use `loop.with().offset(offset).attach(file)` instead"
)]
pub fn attach_with_offset<P: AsRef<Path>>(
&self,
backing_file: P,
offset: u64,
) -> io::Result<()> {
let info = loop_info64 {
lo_offset: offset,
..Default::default()
};

Self::attach_with_loop_info(self, backing_file, info)
}

/// Attach the loop device to a file starting at offset into the file and a the given sizelimit.
#[deprecated(
since = "0.2.2",
note = "use `with().size_limit(size).attach(file)` instead"
)]
pub fn attach_with_sizelimit<P: AsRef<Path>>(
&self,
backing_file: P,
offset: u64,
size_limit: u64,
) -> io::Result<()> {
let info = loop_info64 {
lo_offset: offset,
lo_sizelimit: size_limit,
..Default::default()
};

Self::attach_with_loop_info(self, backing_file, info)
}

/// Attach the loop device to a file with loop_info64.
fn attach_with_loop_info(
&self, // TODO should be mut? - but changing it is a breaking change
Expand Down Expand Up @@ -280,12 +228,6 @@ impl LoopDevice {
}
}

/// Get the path of the loop device.
#[deprecated(since = "0.2.0", note = "use `path` instead")]
pub fn get_path(&self) -> Option<PathBuf> {
self.path()
}

/// Get the path of the loop device.
pub fn path(&self) -> Option<PathBuf> {
let mut p = PathBuf::from("/proc/self/fd");
Expand Down