summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Ørbekk <orbekk@pvv.ntnu.no>2008-08-15 14:35:16 +0200
committerKjetil Ørbekk <orbekk@pvv.ntnu.no>2008-08-15 14:35:16 +0200
commitd1655ce25dbda83b7bbf8874d48654beaa9b9000 (patch)
tree2533c681ed92b25b344b6e92dfc3d5889ba2ba27
parentbbc60fc5a6ef982d93671950e8ffb902f6c507ea (diff)
- Added vnops needed for writing .config
-rwxr-xr-xsrc/mfs_vnops.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/mfs_vnops.c b/src/mfs_vnops.c
index de5146a..6e9e0b7 100755
--- a/src/mfs_vnops.c
+++ b/src/mfs_vnops.c
@@ -184,8 +184,9 @@ static int mfs_read (const char *path, char *buf, size_t size, off_t offset,
int len;
size_t bytes;
+ DEBUG("read: path(%s) offset(%d) size(%d)\n", path, (int)offset, (int)size);
if (strcmp(path, "/.config") == 0) {
- DEBUG("read from paths, offset(%d), size(%d)\n", offset, size);
+ DEBUG("read from config, offset(%d), size(%d)\n", (int)offset, (int)size);
len = strlen(paths_info);
if (size > (len - offset))
size = len - offset;
@@ -213,11 +214,38 @@ static int mfs_read (const char *path, char *buf, size_t size, off_t offset,
*/
}
+static int mfs_write(const char *path, const char *buf, size_t size,
+ off_t off, struct fuse_file_info *fi)
+{
+ DEBUG("writing to %s, size(%d), offset(%d)\n\t%s\n",
+ path, size, (int)off, buf);
+ return (size);
+}
+
+static int mfs_mknod(const char *path, mode_t mode, dev_t rdev)
+{
+ DEBUG("mknod %s\n", path);
+ return (-1);
+}
+
+static int mfs_truncate(const char *path, off_t size)
+{
+ DEBUG("truncating %s\n", path);
+
+ if (strcmp(path, "/.config") == 0)
+ return (0);
+
+ return (-1);
+}
+
static struct fuse_operations mfs_ops = {
.getattr = mfs_getattr,
.readdir = mfs_readdir,
.open = mfs_open,
.read = mfs_read,
+ .write = mfs_write,
+ .mknod = mfs_mknod,
+ .truncate = mfs_truncate,
};
static int musicfs_opt_proc (void *data, const char *arg, int key,