aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-08 15:33:54 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-08 15:33:54 -0400
commit08607c1b182b3b8b54d7141a0c012cda17d201e6 (patch)
treed0cf03f3c03ca513377f85cf58ee0fbafcfd3f00 /fs/btrfs/super.c
parentfabb568183de7996257080260d3537fa75b3667e (diff)
Btrfs: add compat ioctl
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index b58b4cf66766..5864917953a4 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -12,6 +12,7 @@
12#include <linux/swap.h> 12#include <linux/swap.h>
13#include <linux/writeback.h> 13#include <linux/writeback.h>
14#include <linux/statfs.h> 14#include <linux/statfs.h>
15#include <linux/compat.h>
15#include "ctree.h" 16#include "ctree.h"
16#include "disk-io.h" 17#include "disk-io.h"
17#include "transaction.h" 18#include "transaction.h"
@@ -950,7 +951,7 @@ static int btrfs_fill_super(struct super_block * sb, void * data, int silent)
950 return -ENOMEM; 951 return -ENOMEM;
951 } 952 }
952 sb->s_root = root_dentry; 953 sb->s_root = root_dentry;
953 954 btrfs_transaction_queue_work(tree_root, HZ * 30);
954 return 0; 955 return 0;
955} 956}
956 957
@@ -1452,7 +1453,7 @@ static int btrfs_prepare_write(struct file *file, struct page *page,
1452 1453
1453static void btrfs_write_super(struct super_block *sb) 1454static void btrfs_write_super(struct super_block *sb)
1454{ 1455{
1455 btrfs_sync_fs(sb, 1); 1456 sb->s_dirt = 0;
1456} 1457}
1457 1458
1458static int btrfs_readpage(struct file *file, struct page *page) 1459static int btrfs_readpage(struct file *file, struct page *page)
@@ -2698,6 +2699,20 @@ static int btrfs_ioctl(struct inode *inode, struct file *filp, unsigned int
2698 return ret; 2699 return ret;
2699} 2700}
2700 2701
2702#ifdef CONFIG_COMPAT
2703static long btrfs_compat_ioctl(struct file *file, unsigned int cmd,
2704 unsigned long arg)
2705{
2706 struct inode *inode = file->f_path.dentry->d_inode;
2707 int ret;
2708 lock_kernel();
2709 ret = btrfs_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg));
2710 unlock_kernel();
2711 return ret;
2712
2713}
2714#endif
2715
2701static struct kmem_cache *btrfs_inode_cachep; 2716static struct kmem_cache *btrfs_inode_cachep;
2702struct kmem_cache *btrfs_trans_handle_cachep; 2717struct kmem_cache *btrfs_trans_handle_cachep;
2703struct kmem_cache *btrfs_transaction_cachep; 2718struct kmem_cache *btrfs_transaction_cachep;
@@ -3042,6 +3057,9 @@ static struct file_operations btrfs_dir_file_operations = {
3042 .read = generic_read_dir, 3057 .read = generic_read_dir,
3043 .readdir = btrfs_readdir, 3058 .readdir = btrfs_readdir,
3044 .ioctl = btrfs_ioctl, 3059 .ioctl = btrfs_ioctl,
3060#ifdef CONFIG_COMPAT
3061 .compat_ioctl = btrfs_compat_ioctl,
3062#endif
3045}; 3063};
3046 3064
3047static struct address_space_operations btrfs_aops = { 3065static struct address_space_operations btrfs_aops = {
@@ -3073,6 +3091,9 @@ static struct file_operations btrfs_file_operations = {
3073 .open = generic_file_open, 3091 .open = generic_file_open,
3074 .ioctl = btrfs_ioctl, 3092 .ioctl = btrfs_ioctl,
3075 .fsync = btrfs_sync_file, 3093 .fsync = btrfs_sync_file,
3094#ifdef CONFIG_COMPAT
3095 .compat_ioctl = btrfs_compat_ioctl,
3096#endif
3076}; 3097};
3077 3098
3078static struct inode_operations btrfs_symlink_inode_operations = { 3099static struct inode_operations btrfs_symlink_inode_operations = {
@@ -3085,6 +3106,7 @@ static int __init init_btrfs_fs(void)
3085{ 3106{
3086 int err; 3107 int err;
3087 printk("btrfs loaded!\n"); 3108 printk("btrfs loaded!\n");
3109 btrfs_init_transaction_sys();
3088 err = init_inodecache(); 3110 err = init_inodecache();
3089 if (err) 3111 if (err)
3090 return err; 3112 return err;
@@ -3095,6 +3117,7 @@ static int __init init_btrfs_fs(void)
3095 3117
3096static void __exit exit_btrfs_fs(void) 3118static void __exit exit_btrfs_fs(void)
3097{ 3119{
3120 btrfs_exit_transaction_sys();
3098 destroy_inodecache(); 3121 destroy_inodecache();
3099 unregister_filesystem(&btrfs_fs_type); 3122 unregister_filesystem(&btrfs_fs_type);
3100 printk("btrfs unloaded\n"); 3123 printk("btrfs unloaded\n");