From patchwork Tue Sep 11 11:28:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Fengqi X-Patchwork-Id: 10595517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80EBD920 for ; Tue, 11 Sep 2018 11:29:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7199A28CFB for ; Tue, 11 Sep 2018 11:29:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65E8028F2F; Tue, 11 Sep 2018 11:29:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12CAC28CFB for ; Tue, 11 Sep 2018 11:29:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbeIKQ2G (ORCPT ); Tue, 11 Sep 2018 12:28:06 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:23627 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726713AbeIKQ2G (ORCPT ); Tue, 11 Sep 2018 12:28:06 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="44777955" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 11 Sep 2018 19:29:09 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id B00804B6AE13 for ; Tue, 11 Sep 2018 19:29:10 +0800 (CST) Received: from fnst.localdomain (10.167.226.155) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Sep 2018 19:29:14 +0800 From: Lu Fengqi To: Subject: [RFC PATCH v2 0/4] undelete subvolume online version Date: Tue, 11 Sep 2018 19:28:59 +0800 Message-ID: <20180911112903.25985-1-lufq.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.155] X-yoursite-MailScanner-ID: B00804B6AE13.AAD3A X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lufq.fnst@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patchset will add the BTRFS_IOC_SUBVOL_UNDELETE ioctl for online btrfs subvolume undelete. And using the online_undelete version of btrfs-progs, user can recover the subvolume given by to the directory given by . The optional parameter [-n ] can be used to set the name of the recovered subvolume. # btrfs subvolume undelete [-n ] btrfs online undelete version: https://github.com/littleroad/linux.git undelete btrfs-progs online undelete version: https://github.com/littleroad/btrfs-progs.git online_undelete Issue: #82 Lu Fengqi (4): btrfs: factor out btrfs_link_subvol from create_subvol btrfs: don't BUG_ON() in btrfs_link_subvol() btrfs: undelete: introduce btrfs_undelete_subvolume btrfs: undelete: Add BTRFS_IOCTL_SUBVOL_UNDELETE ioctl fs/btrfs/ioctl.c | 247 +++++++++++++++++++++++++++++++++---- include/uapi/linux/btrfs.h | 7 ++ 2 files changed, 231 insertions(+), 23 deletions(-)