git://scientific.zcu.cz
/
dmlite-plugins-vfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
76eee24
)
Properly truncate the file on re-create (using xattr with size instead of truncate()).
author
František Dvořák
<valtri@civ.zcu.cz>
Mon, 2 Dec 2013 12:58:36 +0000
(13:58 +0100)
committer
František Dvořák
<valtri@civ.zcu.cz>
Sun, 23 Feb 2014 13:16:20 +0000
(14:16 +0100)
src/VfsNs.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/VfsNs.cpp
b/src/VfsNs.cpp
index
6e5f8a2
..
fe05072
100644
(file)
--- a/
src/VfsNs.cpp
+++ b/
src/VfsNs.cpp
@@
-702,8
+702,8
@@
void VfsCatalog::create(const std::string& path, mode_t mode) throw (DmException
for (it = file.begin(); it != file.end() && it->first.compare(0, VFS_XATTR_LENGTH + 8, VFS_XATTR "replica.") != 0; it++);
if (it != file.end())
vfsThrow(EACCES, "can't truncate '%s' with replicas", path.c_str());
- //
FIXME: setSize(
)
-
wrapCall(truncate(lpath.c_str(), 0)
);
+ //
setSize(path, 0
)
+
vfsSetXattr(path, lpath, VFS_XATTR "size", "0", 0
);
}
}