* [PATCH proxmox] sys: fs: re-export nix types used in file creation API
@ 2026-07-15 11:54 Arthur Bied-Charreton
2026-08-28 14:55 ` Thomas Ellmenreich
0 siblings, 1 reply; 2+ messages in thread
From: Arthur Bied-Charreton @ 2026-07-15 11:54 UTC (permalink / raw)
To: pve-devel
Several public helpers in proxmox-sys::fs take nix types in their
signatures: Mode, Uid and Gid for CreateOptions and fchown() and OFlag
for atomic_open_or_create_file(). Until now, this forced consumers to
pull in nix explicitly just to call/instantiate them.
Re-export those types from proxmox-sys::fs so they can be imported from
there directly.
Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
proxmox-sys/src/fs/file.rs | 2 +-
proxmox-sys/src/fs/mod.rs | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/proxmox-sys/src/fs/file.rs b/proxmox-sys/src/fs/file.rs
index b52bd922..82460035 100644
--- a/proxmox-sys/src/fs/file.rs
+++ b/proxmox-sys/src/fs/file.rs
@@ -8,7 +8,7 @@ use std::time::Duration;
use anyhow::{Context as _, Error, bail, format_err};
use nix::NixPath;
use nix::errno::Errno;
-use nix::fcntl::OFlag;
+pub use nix::fcntl::OFlag;
use nix::sys::stat;
use nix::unistd;
use serde_json::Value;
diff --git a/proxmox-sys/src/fs/mod.rs b/proxmox-sys/src/fs/mod.rs
index 6cda6326..c3fad318 100644
--- a/proxmox-sys/src/fs/mod.rs
+++ b/proxmox-sys/src/fs/mod.rs
@@ -4,7 +4,8 @@ use std::path::Path;
use anyhow::{Context, Error, bail};
use nix::sys::stat;
-use nix::unistd::{Gid, Uid};
+pub use nix::sys::stat::Mode;
+pub use nix::unistd::{Gid, Uid};
use std::os::unix::io::{AsRawFd, RawFd};
#[cfg(feature = "acl")]
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH proxmox] sys: fs: re-export nix types used in file creation API
2026-07-15 11:54 [PATCH proxmox] sys: fs: re-export nix types used in file creation API Arthur Bied-Charreton
@ 2026-08-28 14:55 ` Thomas Ellmenreich
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Ellmenreich @ 2026-08-28 14:55 UTC (permalink / raw)
To: Arthur Bied-Charreton, pve-devel
I think this change makes sense. I noticed that fs/mod.rs contains a few
uses of `stat::Mode`, which could now be replaced with just `Mode`. Not
sure if that is wanted, though.
Reviewed-by: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
On Wed Jul 15, 2026 at 1:54 PM CEST, Arthur Bied-Charreton wrote:
> Several public helpers in proxmox-sys::fs take nix types in their
> signatures: Mode, Uid and Gid for CreateOptions and fchown() and OFlag
> for atomic_open_or_create_file(). Until now, this forced consumers to
> pull in nix explicitly just to call/instantiate them.
>
> Re-export those types from proxmox-sys::fs so they can be imported from
> there directly.
>
> Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
[snip]
> use nix::sys::stat;
> -use nix::unistd::{Gid, Uid};
> +pub use nix::sys::stat::Mode;
> +pub use nix::unistd::{Gid, Uid};
> use std::os::unix::io::{AsRawFd, RawFd};
>
> #[cfg(feature = "acl")]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-28 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15 11:54 [PATCH proxmox] sys: fs: re-export nix types used in file creation API Arthur Bied-Charreton
2026-08-28 14:55 ` Thomas Ellmenreich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.