From patchwork Tue Apr 26 08:02:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Philipp X-Patchwork-Id: 731802 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3Q83Hxv031242 for ; Tue, 26 Apr 2011 08:03:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757902Ab1DZIDK (ORCPT ); Tue, 26 Apr 2011 04:03:10 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:59346 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753372Ab1DZIDE (ORCPT ); Tue, 26 Apr 2011 04:03:04 -0400 Received: by wwa36 with SMTP id 36so396143wwa.1 for ; Tue, 26 Apr 2011 01:03:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=0KWKdMMX41dY5UZqMlqWdYk4bGrxiej7FKv1cAGwG0c=; b=rCWF49aNQXb+tqvm+o1PpItHo+ImCmRp8matgSX12FXd3kisyk3wfRG6Cp4jjvv5Aw gLYbUc0rtGT74d8kWCpGdeuczyaLyoNTTDml9B36syXSbRDRbl8IHd1O24KKLT/xhVPc uMz6LhjUQqbvODtUE9W8iOEiIj+g9wilXARx8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Y/s+wsPq30tXIj0UiVY3iEeVExrhZpWgMXJXBR8o7eRfBhrtNUlRmxLYEP6aditfH9 fdCYTUiPc34In1ZgpzSGCv0XYosOrx/4WvmI89Rqls416U+FuGbyznocFUyyBy3aYVm2 3aY6+f7qmVxEuIZNAM9IkFW22VMkE6Tiv4qeI= Received: by 10.216.25.213 with SMTP id z63mr431026wez.58.1303804983465; Tue, 26 Apr 2011 01:03:03 -0700 (PDT) Received: from localhost.localdomain (84-119-52-190.dynamic.xdsl-line.inode.at [84.119.52.190]) by mx.google.com with ESMTPS id j49sm2865644wer.38.2011.04.26.01.03.01 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Apr 2011 01:03:02 -0700 (PDT) From: Andreas Philipp To: linux-btrfs@vger.kernel.org Cc: Andreas Philipp , chris.mason@oracle.com, dcrmorgado@gmail.com, kreijack@libero.it, lizf@cn.fujitsu.com Subject: [PATCH 1/5] Added support for an additional ioctl. Date: Tue, 26 Apr 2011 10:02:40 +0200 Message-Id: <1303804964-2840-2-git-send-email-philipp.andreas@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1303804964-2840-1-git-send-email-philipp.andreas@gmail.com> References: <1303804964-2840-1-git-send-email-philipp.andreas@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 26 Apr 2011 08:03:17 +0000 (UTC) Added BTRFS_IOC_SNAP_CREATE_V2 and struct btrfs_ioctl_vol_args_v2 as defined in fs/btrfs/ioctl.h in the kernel sources. Signed-off-by: Andreas Philipp --- ioctl.h | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/ioctl.h b/ioctl.h index 776d7a9..358f814 100644 --- a/ioctl.h +++ b/ioctl.h @@ -30,6 +30,17 @@ struct btrfs_ioctl_vol_args { char name[BTRFS_PATH_NAME_MAX + 1]; }; +#define BTRFS_SUBVOL_RDONLY (1ULL << 1) +#define BTRFS_SUBVOL_NAME_MAX 4039 + +struct btrfs_ioctl_vol_args_v2 { + __s64 fd; + __u64 transid; + __u64 flags; + __u64 unused[4]; + char name[BTRFS_SUBVOL_NAME_MAX + 1]; +}; + struct btrfs_ioctl_search_key { /* which root are we searching. 0 is the tree of tree roots */ __u64 tree_id; @@ -132,6 +143,7 @@ struct btrfs_ioctl_space_args { struct btrfs_ioctl_space_info spaces[0]; }; +/* BTRFS_IOC_SNAP_CREATE is no longer used by the btrfs command */ #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ struct btrfs_ioctl_vol_args) #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ @@ -169,4 +181,6 @@ struct btrfs_ioctl_space_args { #define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, u64) #define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \ struct btrfs_ioctl_space_args) +#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \ + struct btrfs_ioctl_vol_args_v2) #endif