Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/fs/fusefs/bmap.cc
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Test FUSE_BMAP | * Test FUSE_BMAP | ||||
* XXX The FUSE protocol does not include the runp and runb variables, so those | * XXX The FUSE protocol does not include the runp and runb variables, so those | ||||
* must be guessed in-kernel. | * must be guessed in-kernel. | ||||
*/ | */ | ||||
TEST_F(Bmap, bmap) | TEST_F(Bmap, bmap) | ||||
{ | { | ||||
struct fiobmap2_arg arg; | struct fiobmap2_arg arg; | ||||
const off_t filesize = 1 << 20; | const off_t filesize = 1 << 30; | ||||
const ino_t ino = 42; | const ino_t ino = 42; | ||||
int64_t lbn = 10; | int64_t lbn = 100; | ||||
int64_t pbn = 12345; | int64_t pbn = 12345; | ||||
int fd; | int fd; | ||||
expect_lookup(RELPATH, 42, filesize); | expect_lookup(RELPATH, 42, filesize); | ||||
expect_open(ino, 0, 1); | expect_open(ino, 0, 1); | ||||
expect_bmap(ino, lbn, m_maxbcachebuf, pbn); | expect_bmap(ino, lbn, m_maxbcachebuf, pbn); | ||||
fd = open(FULLPATH, O_RDWR); | fd = open(FULLPATH, O_RDWR); | ||||
Show All 10 Lines | |||||
/* | /* | ||||
* If the daemon does not implement VOP_BMAP, fusefs should return sensible | * If the daemon does not implement VOP_BMAP, fusefs should return sensible | ||||
* defaults. | * defaults. | ||||
*/ | */ | ||||
TEST_F(Bmap, default_) | TEST_F(Bmap, default_) | ||||
{ | { | ||||
struct fiobmap2_arg arg; | struct fiobmap2_arg arg; | ||||
const off_t filesize = 1 << 20; | const off_t filesize = 1 << 30; | ||||
const ino_t ino = 42; | const ino_t ino = 42; | ||||
int64_t lbn; | int64_t lbn; | ||||
int fd; | int fd; | ||||
expect_lookup(RELPATH, 42, filesize); | expect_lookup(RELPATH, 42, filesize); | ||||
expect_open(ino, 0, 1); | expect_open(ino, 0, 1); | ||||
EXPECT_CALL(*m_mock, process( | EXPECT_CALL(*m_mock, process( | ||||
ResultOf([=](auto in) { | ResultOf([=](auto in) { | ||||
Show All 40 Lines |