Commit 2dd4c920 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

0.3.1 - fix issue with new FUSE

parent 1701198b
......@@ -71,7 +71,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "redoxfs"
version = "0.3.0"
version = "0.3.1"
dependencies = [
"fuse 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
......
......@@ -2,7 +2,7 @@
name = "redoxfs"
description = "The Redox Filesystem"
repository = "https://github.com/redox-os/redoxfs"
version = "0.3.0"
version = "0.3.1"
license-file = "LICENSE"
readme = "README.md"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
......
extern crate fuse;
extern crate time;
use std::cmp;
use std::ffi::OsStr;
use std::io;
use std::os::unix::ffi::OsStrExt;
......@@ -175,9 +176,9 @@ impl<D: Disk> Filesystem for Fuse<D> {
}
}
fn read(&mut self, _req: &Request, block: u64, _fh: u64, offset: u64, size: u32, reply: ReplyData) {
fn read(&mut self, _req: &Request, block: u64, _fh: u64, offset: i64, size: u32, reply: ReplyData) {
let mut data = vec![0; size as usize];
match self.fs.read_node(block, offset, &mut data) {
match self.fs.read_node(block, cmp::max(0, offset) as u64, &mut data) {
Ok(count) => {
reply.data(&data[..count]);
},
......@@ -187,9 +188,9 @@ impl<D: Disk> Filesystem for Fuse<D> {
}
}
fn write(&mut self, _req: &Request, block: u64, _fh: u64, offset: u64, data: &[u8], _flags: u32, reply: ReplyWrite) {
fn write(&mut self, _req: &Request, block: u64, _fh: u64, offset: i64, data: &[u8], _flags: u32, reply: ReplyWrite) {
let mtime = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
match self.fs.write_node(block, offset, &data, mtime.as_secs(), mtime.subsec_nanos()) {
match self.fs.write_node(block, cmp::max(0, offset) as u64, &data, mtime.as_secs(), mtime.subsec_nanos()) {
Ok(count) => {
reply.written(count as u32);
},
......@@ -207,7 +208,7 @@ impl<D: Disk> Filesystem for Fuse<D> {
reply.ok();
}
fn readdir(&mut self, _req: &Request, parent_block: u64, _fh: u64, offset: u64, mut reply: ReplyDirectory) {
fn readdir(&mut self, _req: &Request, parent_block: u64, _fh: u64, offset: i64, mut reply: ReplyDirectory) {
let mut children = Vec::new();
match self.fs.child_nodes(&mut children, parent_block) {
Ok(()) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment