mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 08:48:55 +00:00
s3fs: make dir size not zero
Directory has size 0, which looks weired and may confuse users. So fake dir size as 4k. Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
This commit is contained in:
parent
4fdd2456d4
commit
bcacca6599
@ -804,7 +804,11 @@ bool convert_header_to_stat(const char* path, const headers_t& meta, struct stat
|
||||
}
|
||||
|
||||
// size
|
||||
pst->st_size = get_size(meta);
|
||||
if(S_ISDIR(pst->st_mode)){
|
||||
pst->st_size = 4096;
|
||||
}else{
|
||||
pst->st_size = get_size(meta);
|
||||
}
|
||||
|
||||
// uid/gid
|
||||
pst->st_uid = get_uid(meta);
|
||||
|
@ -1059,6 +1059,9 @@ static int s3fs_getattr(const char* _path, struct stat* stbuf)
|
||||
stbuf->st_size = tmpstbuf.st_size;
|
||||
}
|
||||
}
|
||||
if(0 == strcmp(path, "/")){
|
||||
stbuf->st_size = 4096;
|
||||
}
|
||||
stbuf->st_blksize = 4096;
|
||||
stbuf->st_blocks = get_blocks(stbuf->st_size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user