Skip to content

Commit 4985273

Browse files
committed
Optimize.
1 parent 9b90d07 commit 4985273

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vfs/file.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ func (vfsOS) OpenFilename(name *Filename, flags OpenFlag) (File, OpenFlag, error
125125
file := vfsFile{
126126
File: f,
127127
psow: true,
128+
atomic: osBatchAtomic(f),
128129
readOnly: flags&OPEN_READONLY != 0,
129130
syncDir: canSyncDirs && isCreate && isJournl,
130131
shm: NewSharedMemory(name.String()+"-shm", flags),
@@ -139,6 +140,7 @@ type vfsFile struct {
139140
readOnly bool
140141
keepWAL bool
141142
syncDir bool
143+
atomic bool
142144
psow bool
143145
}
144146

@@ -200,7 +202,7 @@ func (f *vfsFile) SectorSize() int {
200202

201203
func (f *vfsFile) DeviceCharacteristics() DeviceCharacteristic {
202204
ret := IOCAP_SUBPAGE_READ
203-
if osBatchAtomic(f.File) {
205+
if f.atomic {
204206
ret |= IOCAP_BATCH_ATOMIC
205207
}
206208
if f.psow {

0 commit comments

Comments
 (0)