From: ?????? ???????? <kol...@gm...> - 2009-12-06 00:43:06
|
Hi! I have a problem with this example: #include <stdio.h> #define FUSE_USE_VERSION 26 #include <fuse.h> static int my_getattr(const char* path, struct stat* sb) { sb->st_gid = 100; sb->st_mode = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; sb->st_nlink = 1; sb->st_size = 0; sb->st_uid = 1000; return 0; } static int my_readdir(const char* path, void* buf, fuse_fill_dir_t fill, off_t offset, struct fuse_file_info* fi) { int i; for (i = 0; i < 100; i++) { char t[128]; sprintf(t, "sample_%d", i); fill(buf, t, 0, 0); } return 0; } static struct fuse_operations operations; int main(int argc, char *argv[]) { operations.getattr = my_getattr; operations.readdir = my_readdir; return fuse_main(argc, argv, &operations, NULL); } I compile it: gcc -O3 test.c -D_FILE_OFFSET_BITS=64 -lfuse -o fuse_test. Then i start it ./fuse_test -s -o allow_other,direct_io,noatime,sync_read,noauto_cache mnt Then i do find mnt -maxdepth 3 > /dev/null. After this, process fuse_test eats more than 100Mb of memory. Is this a fuse bug or i made something wrong? I tested this on gentoo (kernel 2.6.30), ubuntu (kernel 2.6.31) fuse versions 2.8.1, 2.7.4. Thank you. |