+2004-07-08 Miklos Szeredi <miklos@szeredi.hu>
+
+ * When performing create or remove operation, refresh the parent's
+ attributes on next revalidate, as i_nlink (and maybe size/time)
+ could be inacurate.
+
+ * Use redirty_page_for_writepage() in fuse_writepage() for skipped
+ pages (2.6 only)
+
+ * Set set_page_dirty address space operation (2.6 only)
+
2004-07-06 Miklos Szeredi <miklos@szeredi.hu>
* Minor fix in read: print debug info even if read size is zero
return 0;
}
+static void uncache_dir(struct inode *dir)
+{
+ struct dentry *entry = d_find_alias(dir);
+ if (!entry)
+ dir->i_nlink = 0;
+ else {
+ /* FIXME: this should reset the _attribute_ timeout */
+ entry->d_time = jiffies - 1;
+ dput(entry);
+ }
+}
+
static int lookup_new_entry(struct fuse_conn *fc, struct fuse_req *req,
struct inode *dir, struct dentry *entry,
struct fuse_entry_out *outarg, int version,
outarg->entry_valid_nsec);
d_instantiate(entry, inode);
+ uncache_dir(dir);
return 0;
}
discovered at the next lookup/getattr */
/* FIXME: mark inode "not uptodate" */
entry->d_inode->i_nlink = 0;
+ uncache_dir(dir);
}
fuse_put_request(fc, req);
return err;
req->in.args[0].value = entry->d_name.name;
request_send(fc, req);
err = req->out.h.error;
- if (!err)
+ if (!err) {
entry->d_inode->i_nlink = 0;
+ uncache_dir(dir);
+ }
fuse_put_request(fc, req);
return err;
}
request_send(fc, req);
err = req->out.h.error;
fuse_put_request(fc, req);
+ if (!err) {
+ uncache_dir(olddir);
+ if (olddir != newdir)
+ uncache_dir(newdir);
+ }
return err;
}
if (err)
ClearPageWriteback(page);
if (err == -EWOULDBLOCK) {
- __set_page_dirty_nobuffers(page);
+ redirty_page_for_writepage(wbc, page);
err = 0;
}
} else
.writepage = fuse_writepage,
.prepare_write = fuse_prepare_write,
.commit_write = fuse_commit_write,
+#ifdef KERNEL_2_6
+ .set_page_dirty = __set_page_dirty_nobuffers,
+#endif
};
void fuse_init_file_inode(struct inode *inode)