mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Move to code generation rather than reflection for io_uring offsets.
This avoids the cost at startup time and allows the resulting function to be more effectively inlined to call sites. Although these are not widely used at the moment, this change may also be used as an example for code generation in similar cases. PiperOrigin-RevId: 477597333
This commit is contained in:
committed by
gVisor bot
parent
c4249a0e79
commit
2928c19239
@@ -137,7 +137,7 @@ func New(ctx context.Context, vfsObj *vfs.VirtualFilesystem, entries uint32, par
|
||||
return nil, linuxerr.EOVERFLOW
|
||||
}
|
||||
|
||||
params.SqOff = linux.PreComputedIOSqRingOffsets
|
||||
params.SqOff = linux.PreComputedIOSqRingOffsets()
|
||||
params.SqOff.Array = uint32(arrayOffset)
|
||||
|
||||
cqesOffset := uint64(hostarch.Addr((*linux.IORings)(nil).SizeBytes()))
|
||||
@@ -146,7 +146,7 @@ func New(ctx context.Context, vfsObj *vfs.VirtualFilesystem, entries uint32, par
|
||||
return nil, linuxerr.EOVERFLOW
|
||||
}
|
||||
|
||||
params.CqOff = linux.PreComputedIOCqRingOffsets
|
||||
params.CqOff = linux.PreComputedIOCqRingOffsets()
|
||||
params.CqOff.Cqes = uint32(cqesOffset)
|
||||
|
||||
// Set features supported by the current IO_URING implementation.
|
||||
|
||||
Reference in New Issue
Block a user