du reports correct space usage
This commit is contained in:
parent
4bcad82186
commit
19bfe97d52
@ -1,6 +1,7 @@
|
||||
Version 0.9.8 (unreleased)
|
||||
--------------
|
||||
|
||||
Fixed bugs:
|
||||
* `du` shows correct file system size
|
||||
|
||||
Version 0.9.7
|
||||
--------------
|
||||
|
@ -160,10 +160,10 @@ void CryNode::stat(struct ::stat *result) const {
|
||||
device()->callFsActionCallbacks();
|
||||
if(_parent == none) {
|
||||
//We are the root directory.
|
||||
//TODO What should we do?
|
||||
//TODO What should we do?
|
||||
result->st_uid = getuid();
|
||||
result->st_gid = getgid();
|
||||
result->st_mode = S_IFDIR | S_IRUSR | S_IWUSR | S_IXUSR;
|
||||
result->st_mode = S_IFDIR | S_IRUSR | S_IWUSR | S_IXUSR;
|
||||
result->st_size = fsblobstore::DirBlob::DIR_LSTAT_SIZE;
|
||||
//TODO If possible without performance loss, then for a directory, st_nlink should return number of dir entries (including "." and "..")
|
||||
result->st_nlink = 1;
|
||||
|
@ -35,8 +35,8 @@ void CryOpenFile::flush() {
|
||||
|
||||
void CryOpenFile::stat(struct ::stat *result) const {
|
||||
_device->callFsActionCallbacks();
|
||||
_parent->statChildExceptSize(_fileBlob->key(), result);
|
||||
result->st_size = _fileBlob->size();
|
||||
_parent->statChildWithSizeAlreadySet(_fileBlob->key(), result);
|
||||
}
|
||||
|
||||
void CryOpenFile::truncate(off_t size) const {
|
||||
|
@ -56,8 +56,8 @@ public:
|
||||
return _base->statChild(key, result);
|
||||
}
|
||||
|
||||
void statChildExceptSize(const blockstore::Key &key, struct ::stat *result) const {
|
||||
return _base->statChildExceptSize(key, result);
|
||||
void statChildWithSizeAlreadySet(const blockstore::Key &key, struct ::stat *result) const {
|
||||
return _base->statChildWithSizeAlreadySet(key, result);
|
||||
}
|
||||
|
||||
void updateAccessTimestampForChild(const blockstore::Key &key) {
|
||||
|
@ -135,11 +135,11 @@ off_t DirBlob::lstat_size() const {
|
||||
}
|
||||
|
||||
void DirBlob::statChild(const Key &key, struct ::stat *result) const {
|
||||
statChildExceptSize(key, result);
|
||||
result->st_size = _getLstatSize(key);
|
||||
statChildWithSizeAlreadySet(key, result);
|
||||
}
|
||||
|
||||
void DirBlob::statChildExceptSize(const Key &key, struct ::stat *result) const {
|
||||
void DirBlob::statChildWithSizeAlreadySet(const Key &key, struct ::stat *result) const {
|
||||
auto childOpt = GetChild(key);
|
||||
if (childOpt == boost::none) {
|
||||
throw fspp::fuse::FuseErrnoException(ENOENT);
|
||||
|
@ -57,7 +57,7 @@ namespace cryfs {
|
||||
|
||||
void statChild(const blockstore::Key &key, struct ::stat *result) const;
|
||||
|
||||
void statChildExceptSize(const blockstore::Key &key, struct ::stat *result) const;
|
||||
void statChildWithSizeAlreadySet(const blockstore::Key &key, struct ::stat *result) const;
|
||||
|
||||
void updateAccessTimestampForChild(const blockstore::Key &key);
|
||||
|
||||
|
@ -52,8 +52,8 @@ public:
|
||||
return _base->statChild(key, result);
|
||||
}
|
||||
|
||||
void statChildExceptSize(const blockstore::Key &key, struct ::stat *result) const {
|
||||
return _base->statChildExceptSize(key, result);
|
||||
void statChildWithSizeAlreadySet(const blockstore::Key &key, struct ::stat *result) const {
|
||||
return _base->statChildWithSizeAlreadySet(key, result);
|
||||
}
|
||||
|
||||
void updateAccessTimestampForChild(const blockstore::Key &key) {
|
||||
|
Loading…
Reference in New Issue
Block a user