fixes
authorMiklos Szeredi <miklos@szeredi.hu>
Mon, 12 Jul 2004 11:52:24 +0000 (11:52 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Mon, 12 Jul 2004 11:52:24 +0000 (11:52 +0000)
ChangeLog
kernel/dir.c
kernel/file.c

index 302b8de0f844cf809d91a3c13c4db4b1c2a311b9..cd4886298a0f9b57dfebea30d35c2b3cec9defa1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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
index 3e41f1999171376773f031552e7df96dce7e48b9..519e0444c7821896ae1a5dae60513aeba10a9f21 100644 (file)
@@ -191,6 +191,18 @@ static int fuse_lookup_iget(struct inode *dir, struct dentry *entry,
        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,
@@ -216,6 +228,7 @@ static int lookup_new_entry(struct fuse_conn *fc, struct fuse_req *req,
                                        outarg->entry_valid_nsec);
 
        d_instantiate(entry, inode);
+       uncache_dir(dir);
        return 0;
 }
 
@@ -352,6 +365,7 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry)
                    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;
@@ -373,8 +387,10 @@ static int fuse_rmdir(struct inode *dir, struct dentry *entry)
        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;
 }
@@ -404,6 +420,11 @@ static int fuse_rename(struct inode *olddir, struct dentry *oldent,
        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;
 }
 
index a443e6b5cfb08185cd4fe86f98db04ef1e7227ca..215d9b5331baea18c229ec033b88d955052b863d 100644 (file)
@@ -544,7 +544,7 @@ static int fuse_writepage(struct page *page, struct writeback_control *wbc)
                        if (err)
                                ClearPageWriteback(page);
                        if (err == -EWOULDBLOCK) {
-                               __set_page_dirty_nobuffers(page);
+                               redirty_page_for_writepage(wbc, page);
                                err = 0;
                        }
                } else
@@ -681,6 +681,9 @@ static struct address_space_operations fuse_file_aops  = {
        .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)