Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- fs/sync.c | 92 --------------------------------------------------------------- 1 file changed, 92 deletions(-)
diff --git a/fs/sync.c b/fs/sync.c index 7ac77bb..cb2c7c2 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -99,98 +99,6 @@ static void fdatawait_one_bdev(struct block_device *bdev, void *arg) filemap_fdatawait(bdev->bd_inode->i_mapping); } -#if 0 - -struct sync_sb { - struct list_head list; - struct super_block *sb; -}; - -static void sync_release_filesystems(struct list_head *sync_list) -{ - struct sync_sb *ss, *tmp; - - list_for_each_entry_safe(ss, tmp, sync_list, list) { - list_del(&ss->list); - put_super(ss->sb); - kfree(ss); - } -} - -static int sync_filesystem_collected(struct list_head *sync_list, struct super_block *sb) -{ - struct sync_sb *ss; - - list_for_each_entry(ss, sync_list, list) - if (ss->sb == sb) - return 1; - return 0; -} - -static int sync_collect_filesystems(struct ve_struct *ve, struct list_head *sync_list) -{ - struct vfsmount *root = ve->root_path.mnt; - struct vfsmount *mnt; - struct sync_sb *ss; - int ret = 0; - - BUG_ON(!list_empty(sync_list)); - - down_read(&namespace_sem); - for (mnt = root; mnt; mnt = next_mnt(mnt, root)) { - if (sync_filesystem_collected(sync_list, mnt->mnt_sb)) - continue; - - ss = kmalloc(sizeof(*ss), GFP_KERNEL); - if (ss == NULL) { - ret = -ENOMEM; - break; - } - ss->sb = mnt->mnt_sb; - /* - * We hold mount point and thus can be sure, that superblock is - * alive. And it means, that we can safely increase it's usage - * counter. - */ - spin_lock(&sb_lock); - ss->sb->s_count++; - spin_unlock(&sb_lock); - list_add_tail(&ss->list, sync_list); - } - up_read(&namespace_sem); - return ret; -} - -static void sync_filesystems_ve(struct ve_struct *ve, struct user_beancounter *ub, int wait) -{ - struct super_block *sb; - LIST_HEAD(sync_list); - struct sync_sb *ss; - - mutex_lock(&ve->sync_mutex); /* Could be down_interruptible */ - - /* - * We don't need to care about allocating failure here. At least we - * don't need to skip sync on such error. - * Let's sync what we collected already instead. - */ - sync_collect_filesystems(ve, &sync_list); - - list_for_each_entry(ss, &sync_list, list) { - sb = ss->sb; - down_read(&sb->s_umount); - if (!(sb->s_flags & MS_RDONLY) && sb->s_root && sb->s_bdi) - __sync_filesystem(sb, ub, wait); - up_read(&sb->s_umount); - } - - sync_release_filesystems(&sync_list); - - mutex_unlock(&ve->sync_mutex); -} - -#endif - static int __ve_fsync_behavior(struct ve_struct *ve) { if (ve->fsync_enable == 2) -- 2.4.10 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel