Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits) no need for list_for_each_entry_safe()/resetting with superblock list Fix sget() race with failing mount vfs: don't hold s_umount over close_bdev_exclusive() call sysv: do not mark superblock dirty on remount sysv: do not mark superblock dirty on mount btrfs: remove junk sb_dirt change BFS: clean up the superblock usage AFFS: wait for sb synchronization when needed AFFS: clean up dirty flag usage cifs: truncate fallout mbcache: fix shrinker function return value mbcache: Remove unused features add f_flags to struct statfs(64) pass a struct path to vfs_statfs update VFS documentation for method changes. All filesystems that need invalidate_inode_buffers() are doing that explicitly convert remaining ->clear_inode() to ->evict_inode() Make ->drop_inode() just return whether inode needs to be dropped fs/inode.c:clear_inode() is gone fs/inode.c:evict() doesn't care about delete vs. non-delete paths now ... Fix up trivial conflicts in fs/nilfs2/super.c
This commit is contained in:
@@ -559,9 +559,19 @@ static int proc_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
return -EPERM;
|
||||
|
||||
error = inode_change_ok(inode, attr);
|
||||
if (!error)
|
||||
error = inode_setattr(inode, attr);
|
||||
return error;
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if ((attr->ia_valid & ATTR_SIZE) &&
|
||||
attr->ia_size != i_size_read(inode)) {
|
||||
error = vmtruncate(inode, attr->ia_size);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
||||
setattr_copy(inode, attr);
|
||||
mark_inode_dirty(inode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct inode_operations proc_def_inode_operations = {
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include <linux/time.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/stat.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/mount.h>
|
||||
@@ -258,17 +259,22 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
|
||||
|
||||
error = inode_change_ok(inode, iattr);
|
||||
if (error)
|
||||
goto out;
|
||||
return error;
|
||||
|
||||
error = inode_setattr(inode, iattr);
|
||||
if (error)
|
||||
goto out;
|
||||
if ((iattr->ia_valid & ATTR_SIZE) &&
|
||||
iattr->ia_size != i_size_read(inode)) {
|
||||
error = vmtruncate(inode, iattr->ia_size);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
||||
setattr_copy(inode, iattr);
|
||||
mark_inode_dirty(inode);
|
||||
|
||||
de->uid = inode->i_uid;
|
||||
de->gid = inode->i_gid;
|
||||
de->mode = inode->i_mode;
|
||||
out:
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int proc_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||
|
@@ -25,11 +25,12 @@
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
static void proc_delete_inode(struct inode *inode)
|
||||
static void proc_evict_inode(struct inode *inode)
|
||||
{
|
||||
struct proc_dir_entry *de;
|
||||
|
||||
truncate_inode_pages(&inode->i_data, 0);
|
||||
end_writeback(inode);
|
||||
|
||||
/* Stop tracking associated processes */
|
||||
put_pid(PROC_I(inode)->pid);
|
||||
@@ -40,7 +41,6 @@ static void proc_delete_inode(struct inode *inode)
|
||||
pde_put(de);
|
||||
if (PROC_I(inode)->sysctl)
|
||||
sysctl_head_put(PROC_I(inode)->sysctl);
|
||||
clear_inode(inode);
|
||||
}
|
||||
|
||||
struct vfsmount *proc_mnt;
|
||||
@@ -91,7 +91,7 @@ static const struct super_operations proc_sops = {
|
||||
.alloc_inode = proc_alloc_inode,
|
||||
.destroy_inode = proc_destroy_inode,
|
||||
.drop_inode = generic_delete_inode,
|
||||
.delete_inode = proc_delete_inode,
|
||||
.evict_inode = proc_evict_inode,
|
||||
.statfs = simple_statfs,
|
||||
};
|
||||
|
||||
|
@@ -329,10 +329,19 @@ static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
return -EPERM;
|
||||
|
||||
error = inode_change_ok(inode, attr);
|
||||
if (!error)
|
||||
error = inode_setattr(inode, attr);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
return error;
|
||||
if ((attr->ia_valid & ATTR_SIZE) &&
|
||||
attr->ia_size != i_size_read(inode)) {
|
||||
error = vmtruncate(inode, attr->ia_size);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
||||
setattr_copy(inode, attr);
|
||||
mark_inode_dirty(inode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int proc_sys_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
|
||||
|
Reference in New Issue
Block a user