Merge branch 'master' of /home/trondmy/repositories/git/linux-2.6/
This commit is contained in:
commit
dd504ea16f
94 changed files with 650 additions and 672 deletions
|
@ -232,8 +232,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -87,11 +87,9 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct affs_inode_info *ei = (struct affs_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
init_MUTEX(&ei->i_link_lock);
|
||||
init_MUTEX(&ei->i_ext_lock);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
init_MUTEX(&ei->i_link_lock);
|
||||
init_MUTEX(&ei->i_ext_lock);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -451,17 +451,15 @@ static void afs_i_init_once(void *_vnode, struct kmem_cache *cachep,
|
|||
{
|
||||
struct afs_vnode *vnode = _vnode;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
memset(vnode, 0, sizeof(*vnode));
|
||||
inode_init_once(&vnode->vfs_inode);
|
||||
init_waitqueue_head(&vnode->update_waitq);
|
||||
mutex_init(&vnode->permits_lock);
|
||||
mutex_init(&vnode->validate_lock);
|
||||
spin_lock_init(&vnode->writeback_lock);
|
||||
spin_lock_init(&vnode->lock);
|
||||
INIT_LIST_HEAD(&vnode->writebacks);
|
||||
INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
|
||||
}
|
||||
memset(vnode, 0, sizeof(*vnode));
|
||||
inode_init_once(&vnode->vfs_inode);
|
||||
init_waitqueue_head(&vnode->update_waitq);
|
||||
mutex_init(&vnode->permits_lock);
|
||||
mutex_init(&vnode->validate_lock);
|
||||
spin_lock_init(&vnode->writeback_lock);
|
||||
spin_lock_init(&vnode->lock);
|
||||
INIT_LIST_HEAD(&vnode->writebacks);
|
||||
INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -292,10 +292,8 @@ befs_destroy_inode(struct inode *inode)
|
|||
static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
|
||||
{
|
||||
struct befs_inode_info *bi = (struct befs_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
inode_init_once(&bi->vfs_inode);
|
||||
}
|
||||
|
||||
inode_init_once(&bi->vfs_inode);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -248,8 +248,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct bfs_inode_info *bi = foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&bi->vfs_inode);
|
||||
inode_init_once(&bi->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -458,17 +458,15 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
struct bdev_inode *ei = (struct bdev_inode *) foo;
|
||||
struct block_device *bdev = &ei->bdev;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
memset(bdev, 0, sizeof(*bdev));
|
||||
mutex_init(&bdev->bd_mutex);
|
||||
sema_init(&bdev->bd_mount_sem, 1);
|
||||
INIT_LIST_HEAD(&bdev->bd_inodes);
|
||||
INIT_LIST_HEAD(&bdev->bd_list);
|
||||
memset(bdev, 0, sizeof(*bdev));
|
||||
mutex_init(&bdev->bd_mutex);
|
||||
sema_init(&bdev->bd_mount_sem, 1);
|
||||
INIT_LIST_HEAD(&bdev->bd_inodes);
|
||||
INIT_LIST_HEAD(&bdev->bd_list);
|
||||
#ifdef CONFIG_SYSFS
|
||||
INIT_LIST_HEAD(&bdev->bd_holder_list);
|
||||
INIT_LIST_HEAD(&bdev->bd_holder_list);
|
||||
#endif
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static inline void __bd_forget(struct inode *inode)
|
||||
|
|
25
fs/buffer.c
25
fs/buffer.c
|
@ -981,7 +981,8 @@ grow_dev_page(struct block_device *bdev, sector_t block,
|
|||
struct page *page;
|
||||
struct buffer_head *bh;
|
||||
|
||||
page = find_or_create_page(inode->i_mapping, index, GFP_NOFS);
|
||||
page = find_or_create_page(inode->i_mapping, index,
|
||||
mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
|
||||
if (!page)
|
||||
return NULL;
|
||||
|
||||
|
@ -2898,8 +2899,9 @@ static void recalc_bh_state(void)
|
|||
|
||||
struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
|
||||
{
|
||||
struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags);
|
||||
struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags);
|
||||
if (ret) {
|
||||
INIT_LIST_HEAD(&ret->b_assoc_buffers);
|
||||
get_cpu_var(bh_accounting).nr++;
|
||||
recalc_bh_state();
|
||||
put_cpu_var(bh_accounting);
|
||||
|
@ -2918,17 +2920,6 @@ void free_buffer_head(struct buffer_head *bh)
|
|||
}
|
||||
EXPORT_SYMBOL(free_buffer_head);
|
||||
|
||||
static void
|
||||
init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
struct buffer_head * bh = (struct buffer_head *)data;
|
||||
|
||||
memset(bh, 0, sizeof(*bh));
|
||||
INIT_LIST_HEAD(&bh->b_assoc_buffers);
|
||||
}
|
||||
}
|
||||
|
||||
static void buffer_exit_cpu(int cpu)
|
||||
{
|
||||
int i;
|
||||
|
@ -2955,12 +2946,8 @@ void __init buffer_init(void)
|
|||
{
|
||||
int nrpages;
|
||||
|
||||
bh_cachep = kmem_cache_create("buffer_head",
|
||||
sizeof(struct buffer_head), 0,
|
||||
(SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
|
||||
SLAB_MEM_SPREAD),
|
||||
init_buffer_head,
|
||||
NULL);
|
||||
bh_cachep = KMEM_CACHE(buffer_head,
|
||||
SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
|
||||
|
||||
/*
|
||||
* Limit the bh occupancy to 10% of ZONE_NORMAL
|
||||
|
|
|
@ -701,10 +701,8 @@ cifs_init_once(void *inode, struct kmem_cache * cachep, unsigned long flags)
|
|||
{
|
||||
struct cifsInodeInfo *cifsi = inode;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
inode_init_once(&cifsi->vfs_inode);
|
||||
INIT_LIST_HEAD(&cifsi->lockList);
|
||||
}
|
||||
inode_init_once(&cifsi->vfs_inode);
|
||||
INIT_LIST_HEAD(&cifsi->lockList);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -62,8 +62,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct coda_inode_info *ei = (struct coda_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
int coda_init_inodecache(void)
|
||||
|
|
13
fs/compat.c
13
fs/compat.c
|
@ -2230,21 +2230,16 @@ asmlinkage long compat_sys_signalfd(int ufd,
|
|||
asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags,
|
||||
const struct compat_itimerspec __user *utmr)
|
||||
{
|
||||
long res;
|
||||
struct itimerspec t;
|
||||
struct itimerspec __user *ut;
|
||||
|
||||
res = -EFAULT;
|
||||
if (get_compat_itimerspec(&t, utmr))
|
||||
goto err_exit;
|
||||
return -EFAULT;
|
||||
ut = compat_alloc_user_space(sizeof(*ut));
|
||||
if (copy_to_user(ut, &t, sizeof(t)) )
|
||||
goto err_exit;
|
||||
if (copy_to_user(ut, &t, sizeof(t)))
|
||||
return -EFAULT;
|
||||
|
||||
res = sys_timerfd(ufd, clockid, flags, ut);
|
||||
err_exit:
|
||||
return res;
|
||||
return sys_timerfd(ufd, clockid, flags, ut);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_TIMERFD */
|
||||
|
||||
|
|
|
@ -1421,7 +1421,7 @@ int vfs_quota_off(struct super_block *sb, int type)
|
|||
/* If quota was reenabled in the meantime, we have
|
||||
* nothing to do */
|
||||
if (!sb_has_quota_enabled(sb, cnt)) {
|
||||
mutex_lock(&toputinode[cnt]->i_mutex);
|
||||
mutex_lock_nested(&toputinode[cnt]->i_mutex, I_MUTEX_QUOTA);
|
||||
toputinode[cnt]->i_flags &= ~(S_IMMUTABLE |
|
||||
S_NOATIME | S_NOQUOTA);
|
||||
truncate_inode_pages(&toputinode[cnt]->i_data, 0);
|
||||
|
|
|
@ -583,8 +583,7 @@ inode_info_init_once(void *vptr, struct kmem_cache *cachep, unsigned long flags)
|
|||
{
|
||||
struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static struct ecryptfs_cache_info {
|
||||
|
|
|
@ -364,18 +364,14 @@ static int fill_zeros_to_end_of_page(struct page *page, unsigned int to)
|
|||
{
|
||||
struct inode *inode = page->mapping->host;
|
||||
int end_byte_in_page;
|
||||
char *page_virt;
|
||||
|
||||
if ((i_size_read(inode) / PAGE_CACHE_SIZE) != page->index)
|
||||
goto out;
|
||||
end_byte_in_page = i_size_read(inode) % PAGE_CACHE_SIZE;
|
||||
if (to > end_byte_in_page)
|
||||
end_byte_in_page = to;
|
||||
page_virt = kmap_atomic(page, KM_USER0);
|
||||
memset((page_virt + end_byte_in_page), 0,
|
||||
(PAGE_CACHE_SIZE - end_byte_in_page));
|
||||
kunmap_atomic(page_virt, KM_USER0);
|
||||
flush_dcache_page(page);
|
||||
zero_user_page(page, end_byte_in_page,
|
||||
PAGE_CACHE_SIZE - end_byte_in_page, KM_USER0);
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
@ -740,7 +736,6 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
|
|||
{
|
||||
int rc = 0;
|
||||
struct page *tmp_page;
|
||||
char *tmp_page_virt;
|
||||
|
||||
tmp_page = ecryptfs_get1page(file, index);
|
||||
if (IS_ERR(tmp_page)) {
|
||||
|
@ -757,10 +752,7 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
|
|||
page_cache_release(tmp_page);
|
||||
goto out;
|
||||
}
|
||||
tmp_page_virt = kmap_atomic(tmp_page, KM_USER0);
|
||||
memset(((char *)tmp_page_virt + start), 0, num_zeros);
|
||||
kunmap_atomic(tmp_page_virt, KM_USER0);
|
||||
flush_dcache_page(tmp_page);
|
||||
zero_user_page(tmp_page, start, num_zeros, KM_USER0);
|
||||
rc = ecryptfs_commit_write(file, tmp_page, start, start + num_zeros);
|
||||
if (rc < 0) {
|
||||
ecryptfs_printk(KERN_ERR, "Error attempting to write zero's "
|
||||
|
|
|
@ -72,8 +72,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct efs_inode_info *ei = (struct efs_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
#endif
|
||||
|
||||
int core_uses_pid;
|
||||
char core_pattern[128] = "core";
|
||||
char core_pattern[CORENAME_MAX_SIZE] = "core";
|
||||
int suid_dumpable = 0;
|
||||
|
||||
EXPORT_SYMBOL(suid_dumpable);
|
||||
|
@ -1264,8 +1264,6 @@ int set_binfmt(struct linux_binfmt *new)
|
|||
|
||||
EXPORT_SYMBOL(set_binfmt);
|
||||
|
||||
#define CORENAME_MAX_SIZE 64
|
||||
|
||||
/* format_corename will inspect the pattern parameter, and output a
|
||||
* name into corename, which must have space for at least
|
||||
* CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
|
||||
|
|
|
@ -160,13 +160,11 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
rwlock_init(&ei->i_meta_lock);
|
||||
rwlock_init(&ei->i_meta_lock);
|
||||
#ifdef CONFIG_EXT2_FS_XATTR
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
#endif
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -466,14 +466,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
INIT_LIST_HEAD(&ei->i_orphan);
|
||||
INIT_LIST_HEAD(&ei->i_orphan);
|
||||
#ifdef CONFIG_EXT3_FS_XATTR
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
#endif
|
||||
mutex_init(&ei->truncate_mutex);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
mutex_init(&ei->truncate_mutex);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -517,14 +517,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
INIT_LIST_HEAD(&ei->i_orphan);
|
||||
INIT_LIST_HEAD(&ei->i_orphan);
|
||||
#ifdef CONFIG_EXT4DEV_FS_XATTR
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
init_rwsem(&ei->xattr_sem);
|
||||
#endif
|
||||
mutex_init(&ei->truncate_mutex);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
mutex_init(&ei->truncate_mutex);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -40,8 +40,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
|||
{
|
||||
struct fat_cache *cache = (struct fat_cache *)foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
INIT_LIST_HEAD(&cache->cache_list);
|
||||
INIT_LIST_HEAD(&cache->cache_list);
|
||||
}
|
||||
|
||||
int __init fat_cache_init(void)
|
||||
|
|
|
@ -500,14 +500,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct msdos_inode_info *ei = (struct msdos_inode_info *)foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
spin_lock_init(&ei->cache_lru_lock);
|
||||
ei->nr_caches = 0;
|
||||
ei->cache_valid_id = FAT_CACHE_VALID + 1;
|
||||
INIT_LIST_HEAD(&ei->cache_lru);
|
||||
INIT_HLIST_NODE(&ei->i_fat_hash);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
spin_lock_init(&ei->cache_lru_lock);
|
||||
ei->nr_caches = 0;
|
||||
ei->cache_valid_id = FAT_CACHE_VALID + 1;
|
||||
INIT_LIST_HEAD(&ei->cache_lru);
|
||||
INIT_HLIST_NODE(&ei->i_fat_hash);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int __init fat_init_inodecache(void)
|
||||
|
|
|
@ -687,8 +687,7 @@ static void fuse_inode_init_once(void *foo, struct kmem_cache *cachep,
|
|||
{
|
||||
struct inode * inode = foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(inode);
|
||||
inode_init_once(inode);
|
||||
}
|
||||
|
||||
static int __init fuse_fs_init(void)
|
||||
|
|
|
@ -27,29 +27,27 @@
|
|||
static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
struct gfs2_inode *ip = foo;
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
inode_init_once(&ip->i_inode);
|
||||
spin_lock_init(&ip->i_spin);
|
||||
init_rwsem(&ip->i_rw_mutex);
|
||||
memset(ip->i_cache, 0, sizeof(ip->i_cache));
|
||||
}
|
||||
|
||||
inode_init_once(&ip->i_inode);
|
||||
spin_lock_init(&ip->i_spin);
|
||||
init_rwsem(&ip->i_rw_mutex);
|
||||
memset(ip->i_cache, 0, sizeof(ip->i_cache));
|
||||
}
|
||||
|
||||
static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
struct gfs2_glock *gl = foo;
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
INIT_HLIST_NODE(&gl->gl_list);
|
||||
spin_lock_init(&gl->gl_spin);
|
||||
INIT_LIST_HEAD(&gl->gl_holders);
|
||||
INIT_LIST_HEAD(&gl->gl_waiters1);
|
||||
INIT_LIST_HEAD(&gl->gl_waiters3);
|
||||
gl->gl_lvb = NULL;
|
||||
atomic_set(&gl->gl_lvb_count, 0);
|
||||
INIT_LIST_HEAD(&gl->gl_reclaim);
|
||||
INIT_LIST_HEAD(&gl->gl_ail_list);
|
||||
atomic_set(&gl->gl_ail_count, 0);
|
||||
}
|
||||
|
||||
INIT_HLIST_NODE(&gl->gl_list);
|
||||
spin_lock_init(&gl->gl_spin);
|
||||
INIT_LIST_HEAD(&gl->gl_holders);
|
||||
INIT_LIST_HEAD(&gl->gl_waiters1);
|
||||
INIT_LIST_HEAD(&gl->gl_waiters3);
|
||||
gl->gl_lvb = NULL;
|
||||
atomic_set(&gl->gl_lvb_count, 0);
|
||||
INIT_LIST_HEAD(&gl->gl_reclaim);
|
||||
INIT_LIST_HEAD(&gl->gl_ail_list);
|
||||
atomic_set(&gl->gl_ail_count, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -434,8 +434,7 @@ static void hfs_init_once(void *p, struct kmem_cache *cachep, unsigned long flag
|
|||
{
|
||||
struct hfs_inode_info *i = p;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&i->vfs_inode);
|
||||
inode_init_once(&i->vfs_inode);
|
||||
}
|
||||
|
||||
static int __init init_hfs_fs(void)
|
||||
|
|
|
@ -470,8 +470,7 @@ static void hfsplus_init_once(void *p, struct kmem_cache *cachep, unsigned long
|
|||
{
|
||||
struct hfsplus_inode_info *i = p;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&i->vfs_inode);
|
||||
inode_init_once(&i->vfs_inode);
|
||||
}
|
||||
|
||||
static int __init init_hfsplus_fs(void)
|
||||
|
|
|
@ -176,11 +176,9 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
mutex_init(&ei->i_mutex);
|
||||
mutex_init(&ei->i_parent_mutex);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
mutex_init(&ei->i_mutex);
|
||||
mutex_init(&ei->i_parent_mutex);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -556,8 +556,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
|||
{
|
||||
struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
const struct file_operations hugetlbfs_file_operations = {
|
||||
|
|
|
@ -213,8 +213,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct inode * inode = (struct inode *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(inode);
|
||||
inode_init_once(inode);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -77,8 +77,7 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
|
|||
{
|
||||
struct iso_inode_info *ei = foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -47,10 +47,8 @@ static void jffs2_i_init_once(void * foo, struct kmem_cache * cachep, unsigned l
|
|||
{
|
||||
struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
init_MUTEX(&ei->sem);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
init_MUTEX(&ei->sem);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int jffs2_sync_fs(struct super_block *sb, int wait)
|
||||
|
|
|
@ -184,16 +184,14 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
|||
{
|
||||
struct metapage *mp = (struct metapage *)foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
mp->lid = 0;
|
||||
mp->lsn = 0;
|
||||
mp->flag = 0;
|
||||
mp->data = NULL;
|
||||
mp->clsn = 0;
|
||||
mp->log = NULL;
|
||||
set_bit(META_free, &mp->flag);
|
||||
init_waitqueue_head(&mp->wait);
|
||||
}
|
||||
mp->lid = 0;
|
||||
mp->lsn = 0;
|
||||
mp->flag = 0;
|
||||
mp->data = NULL;
|
||||
mp->clsn = 0;
|
||||
mp->log = NULL;
|
||||
set_bit(META_free, &mp->flag);
|
||||
init_waitqueue_head(&mp->wait);
|
||||
}
|
||||
|
||||
static inline struct metapage *alloc_metapage(gfp_t gfp_mask)
|
||||
|
|
|
@ -752,20 +752,18 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
|
|||
{
|
||||
struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
|
||||
INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
|
||||
init_rwsem(&jfs_ip->rdwrlock);
|
||||
mutex_init(&jfs_ip->commit_mutex);
|
||||
init_rwsem(&jfs_ip->xattr_sem);
|
||||
spin_lock_init(&jfs_ip->ag_lock);
|
||||
jfs_ip->active_ag = -1;
|
||||
memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
|
||||
INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
|
||||
init_rwsem(&jfs_ip->rdwrlock);
|
||||
mutex_init(&jfs_ip->commit_mutex);
|
||||
init_rwsem(&jfs_ip->xattr_sem);
|
||||
spin_lock_init(&jfs_ip->ag_lock);
|
||||
jfs_ip->active_ag = -1;
|
||||
#ifdef CONFIG_JFS_POSIX_ACL
|
||||
jfs_ip->i_acl = JFS_ACL_NOT_CACHED;
|
||||
jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED;
|
||||
jfs_ip->i_acl = JFS_ACL_NOT_CACHED;
|
||||
jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED;
|
||||
#endif
|
||||
inode_init_once(&jfs_ip->vfs_inode);
|
||||
}
|
||||
inode_init_once(&jfs_ip->vfs_inode);
|
||||
}
|
||||
|
||||
static int __init init_jfs_fs(void)
|
||||
|
|
|
@ -203,9 +203,6 @@ static void init_once(void *foo, struct kmem_cache *cache, unsigned long flags)
|
|||
{
|
||||
struct file_lock *lock = (struct file_lock *) foo;
|
||||
|
||||
if (!(flags & SLAB_CTOR_CONSTRUCTOR))
|
||||
return;
|
||||
|
||||
locks_init_lock(lock);
|
||||
}
|
||||
|
||||
|
|
|
@ -73,8 +73,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct minix_inode_info *ei = (struct minix_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -60,10 +60,8 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
mutex_init(&ei->open_mutex);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
mutex_init(&ei->open_mutex);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -1164,21 +1164,19 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct nfs_inode *nfsi = (struct nfs_inode *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
inode_init_once(&nfsi->vfs_inode);
|
||||
spin_lock_init(&nfsi->req_lock);
|
||||
INIT_LIST_HEAD(&nfsi->dirty);
|
||||
INIT_LIST_HEAD(&nfsi->commit);
|
||||
INIT_LIST_HEAD(&nfsi->open_files);
|
||||
INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
|
||||
INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
|
||||
INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
|
||||
atomic_set(&nfsi->data_updates, 0);
|
||||
nfsi->ndirty = 0;
|
||||
nfsi->ncommit = 0;
|
||||
nfsi->npages = 0;
|
||||
nfs4_init_once(nfsi);
|
||||
}
|
||||
inode_init_once(&nfsi->vfs_inode);
|
||||
spin_lock_init(&nfsi->req_lock);
|
||||
INIT_LIST_HEAD(&nfsi->dirty);
|
||||
INIT_LIST_HEAD(&nfsi->commit);
|
||||
INIT_LIST_HEAD(&nfsi->open_files);
|
||||
INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
|
||||
INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
|
||||
INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
|
||||
atomic_set(&nfsi->data_updates, 0);
|
||||
nfsi->ndirty = 0;
|
||||
nfsi->ncommit = 0;
|
||||
nfsi->npages = 0;
|
||||
nfs4_init_once(nfsi);
|
||||
}
|
||||
|
||||
static int __init nfs_init_inodecache(void)
|
||||
|
|
|
@ -3085,8 +3085,7 @@ static void ntfs_big_inode_init_once(void *foo, struct kmem_cache *cachep,
|
|||
{
|
||||
ntfs_inode *ni = (ntfs_inode *)foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(VFS_I(ni));
|
||||
inode_init_once(VFS_I(ni));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -262,12 +262,10 @@ static void dlmfs_init_once(void *foo,
|
|||
struct dlmfs_inode_private *ip =
|
||||
(struct dlmfs_inode_private *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
ip->ip_dlm = NULL;
|
||||
ip->ip_parent = NULL;
|
||||
ip->ip_dlm = NULL;
|
||||
ip->ip_parent = NULL;
|
||||
|
||||
inode_init_once(&ip->ip_vfs_inode);
|
||||
}
|
||||
inode_init_once(&ip->ip_vfs_inode);
|
||||
}
|
||||
|
||||
static struct inode *dlmfs_alloc_inode(struct super_block *sb)
|
||||
|
|
|
@ -937,31 +937,29 @@ static void ocfs2_inode_init_once(void *data,
|
|||
{
|
||||
struct ocfs2_inode_info *oi = data;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
oi->ip_flags = 0;
|
||||
oi->ip_open_count = 0;
|
||||
spin_lock_init(&oi->ip_lock);
|
||||
ocfs2_extent_map_init(&oi->vfs_inode);
|
||||
INIT_LIST_HEAD(&oi->ip_io_markers);
|
||||
oi->ip_created_trans = 0;
|
||||
oi->ip_last_trans = 0;
|
||||
oi->ip_dir_start_lookup = 0;
|
||||
oi->ip_flags = 0;
|
||||
oi->ip_open_count = 0;
|
||||
spin_lock_init(&oi->ip_lock);
|
||||
ocfs2_extent_map_init(&oi->vfs_inode);
|
||||
INIT_LIST_HEAD(&oi->ip_io_markers);
|
||||
oi->ip_created_trans = 0;
|
||||
oi->ip_last_trans = 0;
|
||||
oi->ip_dir_start_lookup = 0;
|
||||
|
||||
init_rwsem(&oi->ip_alloc_sem);
|
||||
mutex_init(&oi->ip_io_mutex);
|
||||
init_rwsem(&oi->ip_alloc_sem);
|
||||
mutex_init(&oi->ip_io_mutex);
|
||||
|
||||
oi->ip_blkno = 0ULL;
|
||||
oi->ip_clusters = 0;
|
||||
oi->ip_blkno = 0ULL;
|
||||
oi->ip_clusters = 0;
|
||||
|
||||
ocfs2_lock_res_init_once(&oi->ip_rw_lockres);
|
||||
ocfs2_lock_res_init_once(&oi->ip_meta_lockres);
|
||||
ocfs2_lock_res_init_once(&oi->ip_data_lockres);
|
||||
ocfs2_lock_res_init_once(&oi->ip_open_lockres);
|
||||
ocfs2_lock_res_init_once(&oi->ip_rw_lockres);
|
||||
ocfs2_lock_res_init_once(&oi->ip_meta_lockres);
|
||||
ocfs2_lock_res_init_once(&oi->ip_data_lockres);
|
||||
ocfs2_lock_res_init_once(&oi->ip_open_lockres);
|
||||
|
||||
ocfs2_metadata_cache_init(&oi->vfs_inode);
|
||||
ocfs2_metadata_cache_init(&oi->vfs_inode);
|
||||
|
||||
inode_init_once(&oi->vfs_inode);
|
||||
}
|
||||
inode_init_once(&oi->vfs_inode);
|
||||
}
|
||||
|
||||
static int ocfs2_initialize_mem_caches(void)
|
||||
|
|
|
@ -419,8 +419,7 @@ static void op_inode_init_once(void *data, struct kmem_cache * cachep, unsigned
|
|||
{
|
||||
struct op_inode_info *oi = (struct op_inode_info *) data;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&oi->vfs_inode);
|
||||
inode_init_once(&oi->vfs_inode);
|
||||
}
|
||||
|
||||
static int __init init_openprom_fs(void)
|
||||
|
|
|
@ -109,8 +109,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct proc_inode *ei = (struct proc_inode *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
int __init proc_init_inodecache(void)
|
||||
|
|
|
@ -536,8 +536,7 @@ static void init_once(void *foo, struct kmem_cache * cachep,
|
|||
{
|
||||
struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
23
fs/quota.c
23
fs/quota.c
|
@ -157,7 +157,6 @@ static int check_quotactl_valid(struct super_block *sb, int type, int cmd, qid_t
|
|||
static void quota_sync_sb(struct super_block *sb, int type)
|
||||
{
|
||||
int cnt;
|
||||
struct inode *discard[MAXQUOTAS];
|
||||
|
||||
sb->s_qcop->quota_sync(sb, type);
|
||||
/* This is not very clever (and fast) but currently I don't know about
|
||||
|
@ -167,29 +166,21 @@ static void quota_sync_sb(struct super_block *sb, int type)
|
|||
sb->s_op->sync_fs(sb, 1);
|
||||
sync_blockdev(sb->s_bdev);
|
||||
|
||||
/* Now when everything is written we can discard the pagecache so
|
||||
* that userspace sees the changes. We need i_mutex and so we could
|
||||
* not do it inside dqonoff_mutex. Moreover we need to be carefull
|
||||
* about races with quotaoff() (that is the reason why we have own
|
||||
* reference to inode). */
|
||||
/*
|
||||
* Now when everything is written we can discard the pagecache so
|
||||
* that userspace sees the changes.
|
||||
*/
|
||||
mutex_lock(&sb_dqopt(sb)->dqonoff_mutex);
|
||||
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
|
||||
discard[cnt] = NULL;
|
||||
if (type != -1 && cnt != type)
|
||||
continue;
|
||||
if (!sb_has_quota_enabled(sb, cnt))
|
||||
continue;
|
||||
discard[cnt] = igrab(sb_dqopt(sb)->files[cnt]);
|
||||
mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex, I_MUTEX_QUOTA);
|
||||
truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0);
|
||||
mutex_unlock(&sb_dqopt(sb)->files[cnt]->i_mutex);
|
||||
}
|
||||
mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex);
|
||||
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
|
||||
if (discard[cnt]) {
|
||||
mutex_lock(&discard[cnt]->i_mutex);
|
||||
truncate_inode_pages(&discard[cnt]->i_data, 0);
|
||||
mutex_unlock(&discard[cnt]->i_mutex);
|
||||
iput(discard[cnt]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sync_dquots(struct super_block *sb, int type)
|
||||
|
|
|
@ -511,14 +511,12 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
|
|||
{
|
||||
struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
INIT_LIST_HEAD(&ei->i_prealloc_list);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
INIT_LIST_HEAD(&ei->i_prealloc_list);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
|
||||
ei->i_acl_access = NULL;
|
||||
ei->i_acl_default = NULL;
|
||||
ei->i_acl_access = NULL;
|
||||
ei->i_acl_default = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -566,12 +566,11 @@ static void romfs_destroy_inode(struct inode *inode)
|
|||
kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode));
|
||||
}
|
||||
|
||||
static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
|
||||
static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
|
||||
{
|
||||
struct romfs_inode_info *ei = (struct romfs_inode_info *) foo;
|
||||
struct romfs_inode_info *ei = foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -70,8 +70,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct smb_inode_info *ei = (struct smb_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -322,8 +322,7 @@ static void init_once(void *p, struct kmem_cache *cachep, unsigned long flags)
|
|||
{
|
||||
struct sysv_inode_info *si = (struct sysv_inode_info *)p;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&si->vfs_inode);
|
||||
inode_init_once(&si->vfs_inode);
|
||||
}
|
||||
|
||||
const struct super_operations sysv_sops = {
|
||||
|
|
|
@ -134,10 +134,8 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct udf_inode_info *ei = (struct udf_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR) {
|
||||
ei->i_ext.i_data = NULL;
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
ei->i_ext.i_data = NULL;
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -1237,8 +1237,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
|
|||
{
|
||||
struct ufs_inode_info *ei = (struct ufs_inode_info *) foo;
|
||||
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
inode_init_once(&ei->vfs_inode);
|
||||
}
|
||||
|
||||
static int init_inodecache(void)
|
||||
|
|
|
@ -360,8 +360,7 @@ xfs_fs_inode_init_once(
|
|||
kmem_zone_t *zonep,
|
||||
unsigned long flags)
|
||||
{
|
||||
if (flags & SLAB_CTOR_CONSTRUCTOR)
|
||||
inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
|
||||
inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
|
||||
}
|
||||
|
||||
STATIC int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue