Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
[powerpc.git] / fs / jffs2 / dir.c
index a5e9f22..c1dfca3 100644 (file)
@@ -1,19 +1,16 @@
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
- * Copyright (C) 2001-2003 Red Hat, Inc.
+ * Copyright © 2001-2007 Red Hat, Inc.
  *
  * Created by David Woodhouse <dwmw2@infradead.org>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: dir.c,v 1.90 2005/11/07 11:14:39 gleixner Exp $
- *
  */
 
 #include <linux/kernel.h>
 #include <linux/slab.h>
-#include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/crc32.h>
 #include <linux/jffs2.h>
@@ -46,7 +43,7 @@ const struct file_operations jffs2_dir_operations =
 };
 
 
-struct inode_operations jffs2_dir_inode_operations =
+const struct inode_operations jffs2_dir_inode_operations =
 {
        .create =       jffs2_create,
        .lookup =       jffs2_lookup,
@@ -123,11 +120,11 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
        struct jffs2_inode_info *f;
        struct jffs2_sb_info *c;
-       struct inode *inode = filp->f_dentry->d_inode;
+       struct inode *inode = filp->f_path.dentry->d_inode;
        struct jffs2_full_dirent *fd;
        unsigned long offset, curofs;
 
-       D1(printk(KERN_DEBUG "jffs2_readdir() for dir_i #%lu\n", filp->f_dentry->d_inode->i_ino));
+       D1(printk(KERN_DEBUG "jffs2_readdir() for dir_i #%lu\n", filp->f_path.dentry->d_inode->i_ino));
 
        f = JFFS2_INODE_INFO(inode);
        c = JFFS2_SB_INFO(inode->i_sb);
@@ -141,7 +138,7 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir)
                offset++;
        }
        if (offset == 1) {
-               unsigned long pino = parent_ino(filp->f_dentry);
+               unsigned long pino = parent_ino(filp->f_path.dentry);
                D1(printk(KERN_DEBUG "Dirent 1: \"..\", ino #%lu\n", pino));
                if (filldir(dirent, "..", 2, 1, pino, DT_DIR) < 0)
                        goto out;
@@ -588,7 +585,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode)
        }
 
        dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime));
-       dir_i->i_nlink++;
+       inc_nlink(dir_i);
 
        jffs2_free_raw_dirent(rd);
 
@@ -836,7 +833,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
        /* If it was a directory we moved, and there was no victim,
           increase i_nlink on its new parent */
        if (S_ISDIR(old_dentry->d_inode->i_mode) && !victim_f)
-               new_dir_i->i_nlink++;
+               inc_nlink(new_dir_i);
 
        /* Unlink the original */
        ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i),
@@ -848,7 +845,7 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
                /* Oh shit. We really ought to make a single node which can do both atomically */
                struct jffs2_inode_info *f = JFFS2_INODE_INFO(old_dentry->d_inode);
                down(&f->sem);
-               old_dentry->d_inode->i_nlink++;
+               inc_nlink(old_dentry->d_inode);
                if (f->inocache)
                        f->inocache->nlink++;
                up(&f->sem);