|
@ -17,6 +17,26 @@ |
|
|
|
|
|
|
|
|
#define DEFAULT_SIZE (1024 * 16) |
|
|
#define DEFAULT_SIZE (1024 * 16) |
|
|
|
|
|
|
|
|
|
|
|
static |
|
|
|
|
|
uint64_t |
|
|
|
|
|
dirent_exact_namelen(const struct dirent *d_) |
|
|
|
|
|
{ |
|
|
|
|
|
#ifdef _D_EXACT_NAMELEN |
|
|
|
|
|
return _D_EXACT_NAMELEN(d_); |
|
|
|
|
|
#elif defined _DIRENT_HAVE_D_NAMLEN |
|
|
|
|
|
return d_->d_namlen; |
|
|
|
|
|
#else |
|
|
|
|
|
return strlen(d_->d_name); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static |
|
|
|
|
|
uint64_t |
|
|
|
|
|
dirent_alloc_namelen(const struct dirent *d_) |
|
|
|
|
|
{ |
|
|
|
|
|
return (dirent_exact_namelen(d_) + 1); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static |
|
|
static |
|
|
uint64_t |
|
|
uint64_t |
|
|
align_uint64_t(uint64_t v_) |
|
|
align_uint64_t(uint64_t v_) |
|
@ -251,7 +271,7 @@ fuse_dirents_add(fuse_dirents_t *d_, |
|
|
return -EINVAL; |
|
|
return -EINVAL; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
namelen = _D_ALLOC_NAMLEN(dirent_); |
|
|
|
|
|
|
|
|
namelen = dirent_alloc_namelen(dirent_); |
|
|
size = fuse_dirent_size(namelen); |
|
|
size = fuse_dirent_size(namelen); |
|
|
|
|
|
|
|
|
d = fuse_dirents_alloc(d_,size); |
|
|
d = fuse_dirents_alloc(d_,size); |
|
@ -288,7 +308,7 @@ fuse_dirents_add_plus(fuse_dirents_t *d_, |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
namelen = _D_ALLOC_NAMLEN(dirent_); |
|
|
|
|
|
|
|
|
namelen = dirent_alloc_namelen(dirent_); |
|
|
size = fuse_direntplus_size(namelen); |
|
|
size = fuse_direntplus_size(namelen); |
|
|
|
|
|
|
|
|
d = fuse_dirents_alloc(d_,size); |
|
|
d = fuse_dirents_alloc(d_,size); |
|
|