cleaner way to set readonly

This commit is contained in:
Chris Lu
2021-04-18 10:02:02 -07:00
parent b0127645a5
commit 54410ca955
7 changed files with 3 additions and 58 deletions

View File

@@ -156,10 +156,6 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {
// Write to the file handle
func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error {
if fh.f.wfs.option.ReadOnly {
return fuse.EPERM
}
fh.Lock()
defer fh.Unlock()