Resolve TODO2
This commit is contained in:
parent
35d997779a
commit
d8d35ae462
@ -19,6 +19,7 @@ CryFuse::CryFuse(CryDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int CryFuse::getattr(const path &path, struct stat *stbuf) {
|
int CryFuse::getattr(const path &path, struct stat *stbuf) {
|
||||||
|
//printf("getattr(%s, _, _)\n", path.c_str());
|
||||||
try {
|
try {
|
||||||
_device->lstat(path, stbuf);
|
_device->lstat(path, stbuf);
|
||||||
return 0;
|
return 0;
|
||||||
@ -275,6 +276,9 @@ int CryFuse::readdir(const path &path, void *buf, fuse_fill_dir_t filler, off_t
|
|||||||
try {
|
try {
|
||||||
auto entries = _device->readDir(fileinfo->fh);
|
auto entries = _device->readDir(fileinfo->fh);
|
||||||
for (const auto &entry : *entries) {
|
for (const auto &entry : *entries) {
|
||||||
|
//We could pass file metadata to filler() in its third parameter,
|
||||||
|
//but it doesn't help performance since fuse seems to ignore it.
|
||||||
|
//It does getattr() calls on all entries nevertheless.
|
||||||
if (filler(buf, entry.c_str(), nullptr, 0) != 0) {
|
if (filler(buf, entry.c_str(), nullptr, 0) != 0) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user