correct block counts in stat
This commit is contained in:
parent
15bd0d7ab8
commit
e0b11e496f
@ -1,6 +1,10 @@
|
||||
ChangeLog for davfs2
|
||||
--------------------
|
||||
|
||||
2009-06-30 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* dav_fuse.c, fuse_stat:
|
||||
Correct block counts according to block size.
|
||||
|
||||
2009-06-13 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* Released version 1.4.1.
|
||||
|
||||
|
@ -978,13 +978,21 @@ fuse_stat(void)
|
||||
return sizeof(struct fuse_out_header);
|
||||
}
|
||||
|
||||
out->st.blocks = st->blocks;
|
||||
out->st.bfree = st->bfree;
|
||||
out->st.bavail = st->bavail;
|
||||
int nblocks = (buf_size - sizeof(struct fuse_in_header)
|
||||
- sizeof(struct fuse_write_in) - 4095) / st->bsize;
|
||||
if (nblocks > 1) {
|
||||
out->st.blocks = st->blocks / nblocks;
|
||||
out->st.bfree = st->bfree / nblocks;
|
||||
out->st.bavail = st->bavail / nblocks;
|
||||
out->st.bsize = st->bsize * nblocks;
|
||||
} else {
|
||||
out->st.blocks = st->blocks;
|
||||
out->st.bfree = st->bfree;
|
||||
out->st.bavail = st->bavail;
|
||||
out->st.bsize = st->bsize;
|
||||
}
|
||||
out->st.files = st->files;
|
||||
out->st.ffree = st->ffree;
|
||||
out->st.bsize = (buf_size - sizeof(struct fuse_in_header)
|
||||
- sizeof(struct fuse_write_in) - 4095) & ~4095;
|
||||
out->st.namelen = st->namelen;
|
||||
out->st.frsize = 0;
|
||||
out->st.padding = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user