summaryrefslogtreecommitdiff
path: root/src/sys/quota.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2020-05-16 14:36:10 -0600
committerAlan Somers <asomers@gmail.com>2020-05-16 14:43:54 -0600
commit9d8c8c92adcb74277331a827ca991a04cc4ea36f (patch)
tree4c8699171cc73ddba51e2b56af2c54c4c14460f9 /src/sys/quota.rs
parent465a8f73134de0eec1bf28c749cc89cece0c7a1a (diff)
downloadnix-9d8c8c92adcb74277331a827ca991a04cc4ea36f.zip
Don't implement `NixPath` for `Option<&P> where P: NixPath`
Most Nix functions that accept `NixPath` arguments can't do anything useful with `None`. The exceptions (`mount` and `quotactl_sync`) already take explicitly optional arguments. Also, this changes the behavior of `mount` with `None` arguments. Previously, it would call mount(2) with empty strings for those arguments. Now, it will use null pointers.
Diffstat (limited to 'src/sys/quota.rs')
-rw-r--r--src/sys/quota.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sys/quota.rs b/src/sys/quota.rs
index b056c84d..db97b0e7 100644
--- a/src/sys/quota.rs
+++ b/src/sys/quota.rs
@@ -253,6 +253,8 @@ pub fn quotactl_off<P: ?Sized + NixPath>(which: QuotaType, special: &P) -> Resul
}
/// Update the on-disk copy of quota usages for a filesystem.
+///
+/// If `special` is `None`, then all file systems with active quotas are sync'd.
pub fn quotactl_sync<P: ?Sized + NixPath>(which: QuotaType, special: Option<&P>) -> Result<()> {
quotactl(QuotaCmd(QuotaSubCmd::Q_SYNC, which), special, 0, ptr::null_mut())
}