Skip to content

Commit e446c08

Browse files
committed
vfs: remove O_TMPFILE directly
Signed-off-by: jiefenghuang <[email protected]>
1 parent d00d06f commit e446c08

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/vfs/vfs.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ func (v *VFS) Mknod(ctx Context, parent Ino, name string, mode uint16, cumask ui
267267
}
268268

269269
func (v *VFS) Unlink(ctx Context, parent Ino, name string) (err syscall.Errno) {
270+
return v.doUnlink(ctx, parent, name, false)
271+
}
272+
273+
func (v *VFS) doUnlink(ctx Context, parent Ino, name string, skipTrash bool) (err syscall.Errno) {
270274
defer func() { logit(ctx, "unlink", err, "(%d,%s)", parent, name) }()
271275
if parent == rootID && IsSpecialName(name) {
272276
err = syscall.EPERM
@@ -276,7 +280,7 @@ func (v *VFS) Unlink(ctx Context, parent Ino, name string) (err syscall.Errno) {
276280
err = syscall.ENAMETOOLONG
277281
return
278282
}
279-
err = v.Meta.Unlink(ctx, parent, name)
283+
err = v.Meta.Unlink(ctx, parent, name, skipTrash)
280284
if err == 0 {
281285
v.invalidateDirHandle(parent, name, 0, nil)
282286
}
@@ -536,7 +540,7 @@ func (v *VFS) Create(ctx Context, parent Ino, name string, mode uint16, cumask u
536540
if flags&syscall.O_EXCL != 0 {
537541
logger.Warnf("The O_EXCL is currently not supported for use with O_TMPFILE")
538542
}
539-
err = v.Unlink(ctx, parent, name)
543+
err = v.doUnlink(ctx, parent, name, true)
540544
}
541545
}
542546
return

0 commit comments

Comments
 (0)