summaryrefslogtreecommitdiffhomepage
path: root/test/util/fuse_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/util/fuse_util.cc')
-rw-r--r--test/util/fuse_util.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/util/fuse_util.cc b/test/util/fuse_util.cc
index 4db053335..595d0cebf 100644
--- a/test/util/fuse_util.cc
+++ b/test/util/fuse_util.cc
@@ -22,13 +22,13 @@
namespace gvisor {
namespace testing {
-// Create a default FuseAttr struct with specified mode and inode.
-fuse_attr DefaultFuseAttr(mode_t mode, uint64_t inode) {
+// Create a default FuseAttr struct with specified mode, inode, and size.
+fuse_attr DefaultFuseAttr(mode_t mode, uint64_t inode, uint64_t size) {
const int time_sec = 1595436289;
const int time_nsec = 134150844;
return (struct fuse_attr){
.ino = inode,
- .size = 512,
+ .size = size,
.blocks = 4,
.atime = time_sec,
.mtime = time_sec,
@@ -45,8 +45,8 @@ fuse_attr DefaultFuseAttr(mode_t mode, uint64_t inode) {
};
}
-// Create response body with specified mode and nodeID.
-fuse_entry_out DefaultEntryOut(mode_t mode, uint64_t node_id) {
+// Create response body with specified mode, nodeID, and size.
+fuse_entry_out DefaultEntryOut(mode_t mode, uint64_t node_id, uint64_t size) {
struct fuse_entry_out default_entry_out = {
.nodeid = node_id,
.generation = 0,
@@ -54,7 +54,7 @@ fuse_entry_out DefaultEntryOut(mode_t mode, uint64_t node_id) {
.attr_valid = 0,
.entry_valid_nsec = 0,
.attr_valid_nsec = 0,
- .attr = DefaultFuseAttr(mode, node_id),
+ .attr = DefaultFuseAttr(mode, node_id, size),
};
return default_entry_out;
};