Skip to content

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Oct 30, 2019
2 parents e8b885a + 21fc834 commit 79bbbea
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>fuse-nio-adapter</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<name>FUSE-NIO-Adapter</name>
<description>Access resources at a given NIO path via FUSE.</description>
<url>https://github.com/cryptomator/fuse-nio-adapter</url>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cryptomator/frontend/fuse/OpenFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public void close() throws IOException {
channel.close();
}

public void flush() throws IOException {
channel.force(false);
public void fsync(boolean metaData) throws IOException {
channel.force(metaData);
}

public void truncate(long size) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,12 @@ public int ftruncate(String path, long size, FuseFileInfo fi) {
}

@Override
public int flush(String path, FuseFileInfo fi) {
public int fsync(String path, int isdatasync, FuseFileInfo fi) {
try {
boolean metaData = isdatasync == 0;
Path node = resolvePath(path);
LOG.trace("flush {}", path);
return fileHandler.flush(node, fi);
LOG.trace("fsync {}", path);
return fileHandler.fsync(node, fi, metaData);
} catch (RuntimeException e) {
LOG.error("flush " + path + " failed.", e);
return -ErrorCodes.EIO();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ public int write(Path path, Pointer buf, long size, long offset, FuseFileInfo fi
}
}

public int flush(Path path, FuseFileInfo fi) {
public int fsync(Path path, FuseFileInfo fi, boolean metaData) {
OpenFile file = openFiles.get(fi.fh.get());
if (file == null) {
LOG.warn("flush: File not opened: {}", path);
return -ErrorCodes.EBADFD();
}
try {
file.flush();
file.fsync(metaData);
return 0;
} catch (IOException e) {
LOG.error("Flushing file failed.", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ private String getVersionString() {
return node.getTextContent();
}
} catch (ParserConfigurationException | SAXException | XPathException e) {
LOG.error("Could not parse file {} to detect version of OSXFUSE.", OSXFUSE_VERSIONFILE_LOCATION);
LOG.error("Could not parse " + OSXFUSE_VERSIONFILE_LOCATION + " to detect version of OSXFUSE.", e);
return null;
} catch (IOException e) {
LOG.error("Could not read file {} to detect version of OSXFUSE.", OSXFUSE_VERSIONFILE_LOCATION);
LOG.error("Could not read " + OSXFUSE_VERSIONFILE_LOCATION + " to detect version of OSXFUSE.", e);
return null;
}
}
Expand Down

0 comments on commit 79bbbea

Please sign in to comment.