Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[cascardo/linux.git] / fs / libfs.c
index a6d89f1..48826d4 100644 (file)
@@ -266,7 +266,7 @@ struct dentry *mount_pseudo_xattr(struct file_system_type *fs_type, char *name,
         */
        root->i_ino = 1;
        root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR;
-       root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME;
+       root->i_atime = root->i_mtime = root->i_ctime = current_time(root);
        dentry = __d_alloc(s, &d_name);
        if (!dentry) {
                iput(root);
@@ -296,7 +296,7 @@ int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *den
 {
        struct inode *inode = d_inode(old_dentry);
 
-       inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
+       inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode);
        inc_nlink(inode);
        ihold(inode);
        dget(dentry);
@@ -330,7 +330,7 @@ int simple_unlink(struct inode *dir, struct dentry *dentry)
 {
        struct inode *inode = d_inode(dentry);
 
-       inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
+       inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode);
        drop_nlink(inode);
        dput(dentry);
        return 0;
@@ -350,11 +350,15 @@ int simple_rmdir(struct inode *dir, struct dentry *dentry)
 EXPORT_SYMBOL(simple_rmdir);
 
 int simple_rename(struct inode *old_dir, struct dentry *old_dentry,
-               struct inode *new_dir, struct dentry *new_dentry)
+                 struct inode *new_dir, struct dentry *new_dentry,
+                 unsigned int flags)
 {
        struct inode *inode = d_inode(old_dentry);
        int they_are_dirs = d_is_dir(old_dentry);
 
+       if (flags & ~RENAME_NOREPLACE)
+               return -EINVAL;
+
        if (!simple_empty(new_dentry))
                return -ENOTEMPTY;
 
@@ -370,7 +374,7 @@ int simple_rename(struct inode *old_dir, struct dentry *old_dentry,
        }
 
        old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime =
-               new_dir->i_mtime = inode->i_ctime = CURRENT_TIME;
+               new_dir->i_mtime = inode->i_ctime = current_time(old_dir);
 
        return 0;
 }
@@ -521,7 +525,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic,
         */
        inode->i_ino = 1;
        inode->i_mode = S_IFDIR | 0755;
-       inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+       inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
        inode->i_op = &simple_dir_inode_operations;
        inode->i_fop = &simple_dir_operations;
        set_nlink(inode, 2);
@@ -547,7 +551,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic,
                        goto out;
                }
                inode->i_mode = S_IFREG | files->mode;
-               inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+               inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
                inode->i_fop = files->ops;
                inode->i_ino = i;
                d_add(dentry, inode);
@@ -1093,7 +1097,7 @@ struct inode *alloc_anon_inode(struct super_block *s)
        inode->i_uid = current_fsuid();
        inode->i_gid = current_fsgid();
        inode->i_flags |= S_PRIVATE;
-       inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+       inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
        return inode;
 }
 EXPORT_SYMBOL(alloc_anon_inode);