Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[cascardo/linux.git] / fs / ext3 / namei.c
index 642dc6d..d7940b2 100644 (file)
  *     Theodore Ts'o, 2002
  */
 
-#include <linux/fs.h>
-#include <linux/pagemap.h>
-#include <linux/jbd.h>
-#include <linux/time.h>
-#include <linux/ext3_fs.h>
-#include <linux/ext3_jbd.h>
-#include <linux/fcntl.h>
-#include <linux/stat.h>
-#include <linux/string.h>
 #include <linux/quotaops.h>
-#include <linux/buffer_head.h>
-#include <linux/bio.h>
-#include <trace/events/ext3.h>
-
+#include "ext3.h"
 #include "namei.h"
 #include "xattr.h"
 #include "acl.h"
@@ -921,9 +909,12 @@ restart:
                                num++;
                                bh = ext3_getblk(NULL, dir, b++, 0, &err);
                                bh_use[ra_max] = bh;
-                               if (bh)
-                                       ll_rw_block(READ | REQ_META | REQ_PRIO,
-                                                   1, &bh);
+                               if (bh && !bh_uptodate_or_lock(bh)) {
+                                       get_bh(bh);
+                                       bh->b_end_io = end_buffer_read_sync;
+                                       submit_bh(READ | REQ_META | REQ_PRIO,
+                                                 bh);
+                               }
                        }
                }
                if ((bh = bh_use[ra_ptr++]) == NULL)
@@ -1698,7 +1689,7 @@ static int ext3_add_nondir(handle_t *handle,
  * If the create succeeds, we fill in the inode information
  * with d_instantiate().
  */
-static int ext3_create (struct inode * dir, struct dentry * dentry, int mode,
+static int ext3_create (struct inode * dir, struct dentry * dentry, umode_t mode,
                struct nameidata *nd)
 {
        handle_t *handle;
@@ -1732,7 +1723,7 @@ retry:
 }
 
 static int ext3_mknod (struct inode * dir, struct dentry *dentry,
-                       int mode, dev_t rdev)
+                       umode_t mode, dev_t rdev)
 {
        handle_t *handle;
        struct inode *inode;
@@ -1768,7 +1759,7 @@ retry:
        return err;
 }
 
-static int ext3_mkdir(struct inode * dir, struct dentry * dentry, int mode)
+static int ext3_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
 {
        handle_t *handle;
        struct inode * inode;
@@ -2272,7 +2263,7 @@ retry:
                        err = PTR_ERR(handle);
                        goto err_drop_inode;
                }
-               inc_nlink(inode);
+               set_nlink(inode, 1);
                err = ext3_orphan_del(handle, inode);
                if (err) {
                        ext3_journal_stop(handle);