Merge git://git.infradead.org/mtd-2.6
[platform/adaptation/renesas_rcar/renesas_kernel.git] / fs / jffs2 / file.c
index 935f273..e18c943 100644 (file)
@@ -38,7 +38,7 @@ int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync)
        return 0;
 }
 
-struct file_operations jffs2_file_operations =
+const struct file_operations jffs2_file_operations =
 {
        .llseek =       generic_file_llseek,
        .open =         generic_file_open,
@@ -54,7 +54,12 @@ struct file_operations jffs2_file_operations =
 
 struct inode_operations jffs2_file_inode_operations =
 {
-       .setattr =      jffs2_setattr
+       .permission =   jffs2_permission,
+       .setattr =      jffs2_setattr,
+       .setxattr =     jffs2_setxattr,
+       .getxattr =     jffs2_getxattr,
+       .listxattr =    jffs2_listxattr,
+       .removexattr =  jffs2_removexattr
 };
 
 struct address_space_operations jffs2_file_address_operations =
@@ -215,12 +220,20 @@ static int jffs2_commit_write (struct file *filp, struct page *pg,
        D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n",
                  inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags));
 
-       if (!start && end == PAGE_CACHE_SIZE) {
-               /* We need to avoid deadlock with page_cache_read() in
-                  jffs2_garbage_collect_pass(). So we have to mark the
-                  page up to date, to prevent page_cache_read() from
-                  trying to re-lock it. */
-               SetPageUptodate(pg);
+       if (end == PAGE_CACHE_SIZE) {
+               if (!start) {
+                       /* We need to avoid deadlock with page_cache_read() in
+                          jffs2_garbage_collect_pass(). So we have to mark the
+                          page up to date, to prevent page_cache_read() from
+                          trying to re-lock it. */
+                       SetPageUptodate(pg);
+               } else {
+                       /* When writing out the end of a page, write out the 
+                          _whole_ page. This helps to reduce the number of
+                          nodes in files which have many short writes, like
+                          syslog files. */
+                       start = aligned_start = 0;
+               }
        }
 
        ri = jffs2_alloc_raw_inode();