summaryrefslogtreecommitdiffhomepage
path: root/pkg/p9/messages_test.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-09-01 19:20:37 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-01 19:22:12 -0700
commit37a217aca4a128d66a6dd4969375ea81bd879ac7 (patch)
tree21f60d54ca05029cd2c67d7de78cb987ee76f050 /pkg/p9/messages_test.go
parent40faeaa180a30906da4822a105c43fcdb996750d (diff)
Implement setattr+clunk in 9P
This is to cover the common pattern: open->read/write->close, where SetAttr needs to be called to update atime/mtime before the file is closed. Benchmark results: BM_OpenReadClose/10240 CPU setattr+clunk: 63783 ns VFS2: 68109 ns VFS1: 72507 ns Updates #1198 PiperOrigin-RevId: 329628461
Diffstat (limited to 'pkg/p9/messages_test.go')
-rw-r--r--pkg/p9/messages_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkg/p9/messages_test.go b/pkg/p9/messages_test.go
index 7facc9f5e..bfeb6c236 100644
--- a/pkg/p9/messages_test.go
+++ b/pkg/p9/messages_test.go
@@ -376,6 +376,30 @@ func TestEncodeDecode(t *testing.T) {
&Rumknod{
Rmknod{QID: QID{Type: 1}},
},
+ &Tsetattrclunk{
+ FID: 1,
+ Valid: SetAttrMask{
+ Permissions: true,
+ UID: true,
+ GID: true,
+ Size: true,
+ ATime: true,
+ MTime: true,
+ CTime: true,
+ ATimeNotSystemTime: true,
+ MTimeNotSystemTime: true,
+ },
+ SetAttr: SetAttr{
+ Permissions: 1,
+ UID: 2,
+ GID: 3,
+ Size: 4,
+ ATimeSeconds: 5,
+ ATimeNanoSeconds: 6,
+ MTimeSeconds: 7,
+ MTimeNanoSeconds: 8,
+ },
+ },
}
for _, enc := range objs {