fuse_loop: add documentation

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter 2020-10-07 13:53:03 +02:00 committed by Dietmar Maurer
parent 708fab3082
commit fcad02e1de
1 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,5 @@
//! Map a raw data reader as a loop device via FUSE
use anyhow::{Error, format_err, bail}; use anyhow::{Error, format_err, bail};
use std::ffi::OsStr; use std::ffi::OsStr;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@ -18,6 +20,10 @@ use super::loopdev;
const RUN_DIR: &'static str = "/run/pbs-loopdev"; const RUN_DIR: &'static str = "/run/pbs-loopdev";
/// Represents an ongoing FUSE-session that has been mapped onto a loop device.
/// Create with map_loop, then call 'main' and poll until startup_chan reports
/// success. Then, daemonize or otherwise finish setup, and continue polling
/// main's future until completion.
pub struct FuseLoopSession<R: AsyncRead + AsyncSeek + Unpin> { pub struct FuseLoopSession<R: AsyncRead + AsyncSeek + Unpin> {
session: Option<Fuse>, session: Option<Fuse>,
stat: libc::stat, stat: libc::stat,