From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yan Zheng" Subject: Re: [Btrfs-devel] [ANNOUNCE] Btrfs v0.10 (online growing/shrinking, ext3 conversion, and more) Date: Mon, 21 Jan 2008 17:15:32 +0800 Message-ID: <3d0408630801210115j39c4b238ia1146f55aa046807@mail.gmail.com> References: <20080115105238.4fc3e992@think.oraclecorp.com> <200801180017.55007.mail@earthworm.de> <200801180848.15634.chris.mason@oracle.com> <200801210957.06927.mail@earthworm.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Chris mason" , btrfs-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org To: "Christian Hesse" Return-path: Received: from mu-out-0910.google.com ([209.85.134.190]:36260 "EHLO mu-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758238AbYAUJPe (ORCPT ); Mon, 21 Jan 2008 04:15:34 -0500 Received: by mu-out-0910.google.com with SMTP id i10so6821813mue.5 for ; Mon, 21 Jan 2008 01:15:33 -0800 (PST) In-Reply-To: <200801210957.06927.mail@earthworm.de> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 2008/1/21, Christian Hesse : > Back in early december I reported the problem for btrfs 0.9. Seems like the > lockfs call still is not implemented. Any hints what I need when I try to > code it myself? Please try this dirty patch. I think it can solve your problem. Regards YZ --- diff -r ac53d7df4c11 super.c --- a/super.c Thu Jan 17 12:58:00 2008 -0500 +++ b/super.c Mon Jan 21 17:10:00 2008 +0800 @@ -423,6 +423,18 @@ static struct file_system_type btrfs_fs_ .fs_flags = FS_REQUIRES_DEV, }; +static void btrfs_write_super_lockfs(struct super_block *sb) +{ + struct btrfs_root *root = btrfs_sb(sb); + btrfs_transaction_flush_work(root); +} + +static void btrfs_unlockfs(struct super_block *sb) +{ + struct btrfs_root *root = btrfs_sb(sb); + btrfs_transaction_queue_work(root, HZ * 30); +} + static struct super_operations btrfs_super_ops = { .delete_inode = btrfs_delete_inode, .put_inode = btrfs_put_inode, @@ -435,6 +447,8 @@ static struct super_operations btrfs_sup .alloc_inode = btrfs_alloc_inode, .destroy_inode = btrfs_destroy_inode, .statfs = btrfs_statfs, + .write_super_lockfs = btrfs_write_super_lockfs, + .unlockfs = btrfs_unlockfs, }; static int __init init_btrfs_fs(void)