From f025ffb385a67f61b192013dcd04061945b8a1f8 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Mon, 13 Jan 2025 09:28:47 +0000 Subject: [PATCH] Fix naming. --- util/vfsutil/wrap.go | 14 +++++++------- vfs/adiantum/hbsh.go | 2 +- vfs/api.go | 8 ++++---- vfs/file.go | 6 +++--- vfs/vfs.go | 6 +++--- vfs/xts/xts.go | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/util/vfsutil/wrap.go b/util/vfsutil/wrap.go index 43b8640..875ea69 100644 --- a/util/vfsutil/wrap.go +++ b/util/vfsutil/wrap.go @@ -38,18 +38,18 @@ func WrapLockState(f vfs.File) vfs.LockLevel { return vfs.LOCK_EXCLUSIVE + 1 // UNKNOWN_LOCK } -// WrapPersistentWAL helps wrap [vfs.FilePersistentWAL]. -func WrapPersistentWAL(f vfs.File) bool { - if f, ok := f.(vfs.FilePersistentWAL); ok { - return f.PersistentWAL() +// WrapPersistWAL helps wrap [vfs.FilePersistWAL]. +func WrapPersistWAL(f vfs.File) bool { + if f, ok := f.(vfs.FilePersistWAL); ok { + return f.PersistWAL() } return false } -// WrapSetPersistentWAL helps wrap [vfs.FilePersistentWAL]. +// WrapSetPersistentWAL helps wrap [vfs.FilePersistWAL]. func WrapSetPersistentWAL(f vfs.File, keepWAL bool) { - if f, ok := f.(vfs.FilePersistentWAL); ok { - f.SetPersistentWAL(keepWAL) + if f, ok := f.(vfs.FilePersistWAL); ok { + f.SetPersistWAL(keepWAL) } } diff --git a/vfs/adiantum/hbsh.go b/vfs/adiantum/hbsh.go index 0a70943..283c645 100644 --- a/vfs/adiantum/hbsh.go +++ b/vfs/adiantum/hbsh.go @@ -238,7 +238,7 @@ func (h *hbshFile) LockState() vfs.LockLevel { } func (h *hbshFile) PersistentWAL() bool { - return vfsutil.WrapPersistentWAL(h.File) // notest + return vfsutil.WrapPersistWAL(h.File) // notest } func (h *hbshFile) SetPersistentWAL(keepWAL bool) { diff --git a/vfs/api.go b/vfs/api.go index 330e8a2..e29a0c8 100644 --- a/vfs/api.go +++ b/vfs/api.go @@ -65,14 +65,14 @@ type FileLockState interface { LockState() LockLevel } -// FilePersistentWAL extends File to implement the +// FilePersistWAL extends File to implement the // SQLITE_FCNTL_PERSIST_WAL file control opcode. // // https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlpersistwal -type FilePersistentWAL interface { +type FilePersistWAL interface { File - PersistentWAL() bool - SetPersistentWAL(bool) + PersistWAL() bool + SetPersistWAL(bool) } // FilePowersafeOverwrite extends File to implement the diff --git a/vfs/file.go b/vfs/file.go index 1d19fcb..e028a2a 100644 --- a/vfs/file.go +++ b/vfs/file.go @@ -142,7 +142,7 @@ var ( _ FileLockState = &vfsFile{} _ FileHasMoved = &vfsFile{} _ FileSizeHint = &vfsFile{} - _ FilePersistentWAL = &vfsFile{} + _ FilePersistWAL = &vfsFile{} _ FilePowersafeOverwrite = &vfsFile{} ) @@ -217,6 +217,6 @@ func (f *vfsFile) HasMoved() (bool, error) { func (f *vfsFile) LockState() LockLevel { return f.lock } func (f *vfsFile) PowersafeOverwrite() bool { return f.psow } -func (f *vfsFile) PersistentWAL() bool { return f.keepWAL } +func (f *vfsFile) PersistWAL() bool { return f.keepWAL } func (f *vfsFile) SetPowersafeOverwrite(psow bool) { f.psow = psow } -func (f *vfsFile) SetPersistentWAL(keepWAL bool) { f.keepWAL = keepWAL } +func (f *vfsFile) SetPersistWAL(keepWAL bool) { f.keepWAL = keepWAL } diff --git a/vfs/vfs.go b/vfs/vfs.go index 83c95d0..6edfe27 100644 --- a/vfs/vfs.go +++ b/vfs/vfs.go @@ -255,10 +255,10 @@ func vfsFileControlImpl(ctx context.Context, mod api.Module, file File, op _Fcnt } case _FCNTL_PERSIST_WAL: - if file, ok := file.(FilePersistentWAL); ok { + if file, ok := file.(FilePersistWAL); ok { if i := util.ReadUint32(mod, pArg); int32(i) >= 0 { - file.SetPersistentWAL(i != 0) - } else if file.PersistentWAL() { + file.SetPersistWAL(i != 0) + } else if file.PersistWAL() { util.WriteUint32(mod, pArg, 1) } else { util.WriteUint32(mod, pArg, 0) diff --git a/vfs/xts/xts.go b/vfs/xts/xts.go index 4bf5565..007c0ce 100644 --- a/vfs/xts/xts.go +++ b/vfs/xts/xts.go @@ -234,7 +234,7 @@ func (x *xtsFile) LockState() vfs.LockLevel { } func (x *xtsFile) PersistentWAL() bool { - return vfsutil.WrapPersistentWAL(x.File) // notest + return vfsutil.WrapPersistWAL(x.File) // notest } func (x *xtsFile) SetPersistentWAL(keepWAL bool) {