]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/hpfs/namei.c
hwmon: (lm90) Fix handling of hysteresis value
[linux-2.6-omap-h63xx.git] / fs / hpfs / namei.c
index 59e7dc182a0c760ff78631cf162313ff6b2f97d4..10783f3d265abd8876502fa63bebad1be2f3be35 100644 (file)
@@ -5,7 +5,7 @@
  *
  *  adding & removing files & directories
  */
-
+#include <linux/sched.h>
 #include "hpfs_fn.h"
 
 static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
@@ -89,7 +89,7 @@ static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        brelse(bh);
        hpfs_mark_4buffers_dirty(&qbh0);
        hpfs_brelse4(&qbh0);
-       dir->i_nlink++;
+       inc_nlink(dir);
        insert_inode_hash(result);
 
        if (result->i_uid != current->fsuid ||
@@ -415,7 +415,7 @@ again:
                d_drop(dentry);
                spin_lock(&dentry->d_lock);
                if (atomic_read(&dentry->d_count) > 1 ||
-                   permission(inode, MAY_WRITE, NULL) ||
+                   generic_permission(inode, MAY_WRITE, NULL) ||
                    !S_ISREG(inode->i_mode) ||
                    get_write_access(inode)) {
                        spin_unlock(&dentry->d_lock);
@@ -434,7 +434,7 @@ again:
                unlock_kernel();
                return -ENOSPC;
        default:
-               inode->i_nlink--;
+               drop_nlink(inode);
                err = 0;
        }
        goto out;
@@ -494,8 +494,8 @@ static int hpfs_rmdir(struct inode *dir, struct dentry *dentry)
                err = -ENOSPC;
                break;
        default:
-               dir->i_nlink--;
-               inode->i_nlink = 0;
+               drop_nlink(dir);
+               clear_nlink(inode);
                err = 0;
        }
        goto out;
@@ -590,7 +590,7 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
                int r;
                if ((r = hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1)) != 2) {
                        if ((nde = map_dirent(new_dir, hpfs_i(new_dir)->i_dno, (char *)new_name, new_len, NULL, &qbh1))) {
-                               new_inode->i_nlink = 0;
+                               clear_nlink(new_inode);
                                copy_de(nde, &de);
                                memcpy(nde->name, new_name, new_len);
                                hpfs_mark_4buffers_dirty(&qbh1);
@@ -635,8 +635,8 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        end:
        hpfs_i(i)->i_parent_dir = new_dir->i_ino;
        if (S_ISDIR(i->i_mode)) {
-               new_dir->i_nlink++;
-               old_dir->i_nlink--;
+               inc_nlink(new_dir);
+               drop_nlink(old_dir);
        }
        if ((fnode = hpfs_map_fnode(i->i_sb, i->i_ino, &bh))) {
                fnode->up = new_dir->i_ino;
@@ -659,7 +659,7 @@ end1:
        return err;
 }
 
-struct inode_operations hpfs_dir_iops =
+const struct inode_operations hpfs_dir_iops =
 {
        .create         = hpfs_create,
        .lookup         = hpfs_lookup,
@@ -669,5 +669,5 @@ struct inode_operations hpfs_dir_iops =
        .rmdir          = hpfs_rmdir,
        .mknod          = hpfs_mknod,
        .rename         = hpfs_rename,
-       .setattr        = hpfs_notify_change,
+       .setattr        = hpfs_setattr,
 };