aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend/file_lock.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend/file_lock.go')
-rw-r--r--internal/fusefrontend/file_lock.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/fusefrontend/file_lock.go b/internal/fusefrontend/file_lock.go
index bb72c52..f440754 100644
--- a/internal/fusefrontend/file_lock.go
+++ b/internal/fusefrontend/file_lock.go
@@ -29,3 +29,8 @@ func (f *File) LockSharedStorage(lkType int16, lkStart int64, lkLen int64) error
}
return unix.FcntlFlock(uintptr(f.intFd()), syscallcompat.F_OFD_SETLKW, &lk)
}
+
+// UnlockSharedStorage calls LockSharedStorage with unix.F_UNLCK.
+func (f *File) UnlockSharedStorage(lkStart int64, lkLen int64) error {
+ return f.LockSharedStorage(unix.F_UNLCK, lkStart, lkLen)
+}