From patchwork Tue Nov 17 14:04:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Emelyanov X-Patchwork-Id: 38634 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C9D741007D4 for ; Wed, 18 Nov 2009 01:05:34 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753270AbZKQOFW (ORCPT ); Tue, 17 Nov 2009 09:05:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753215AbZKQOFV (ORCPT ); Tue, 17 Nov 2009 09:05:21 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:27771 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbZKQOFU (ORCPT ); Tue, 17 Nov 2009 09:05:20 -0500 Received: from xemulnb.sw.ru ([10.30.3.76]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id nAHE4xRm017115 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Nov 2009 17:05:01 +0300 (MSK) Message-ID: <4B02AD8B.2030202@openvz.org> Date: Tue, 17 Nov 2009 17:04:59 +0300 From: Pavel Emelyanov User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Andreas Dilger , "Theodore Ts'o" , Andrew Morton , linux-ext4@vger.kernel.org CC: Dmitri Monakhov Subject: [PATCH] A request to reserve a "tree id" field on ext[34] inodes Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi. We have a proposal to implement a 2-level disk quota on ext3 and ext4. In two words - the aim is to have directories on ext3/4 partitions which are limited by its disk usage and the number of inodes. Further the plan is to allow configuring uid and gid quotas within them. The main usage of this is containers. When two or more of them are located on one disk their roots will be marked with a unique tree id and thus the disk consumption of each container will be limited. While achieving this goal having an id of what tree an inode belongs to is a key requirement. So first we would like to ask to reserve a place on ext3 and ext4 inodes for that ID. Signed-off-by: Pavel Emelyanov --- -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 26d3cf8..0fda97c 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -471,7 +471,7 @@ struct ext4_inode { __le16 l_i_file_acl_high; __le16 l_i_uid_high; /* these 2 fields */ __le16 l_i_gid_high; /* were reserved2[0] */ - __u32 l_i_reserved2; + __u32 l_i_tree_id; /* reserved for 2-level disk quota */ } linux2; struct { __le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */ @@ -585,7 +585,7 @@ do { \ #define i_gid_low i_gid #define i_uid_high osd2.linux2.l_i_uid_high #define i_gid_high osd2.linux2.l_i_gid_high -#define i_reserved2 osd2.linux2.l_i_reserved2 +#define i_tree_id osd2.linux2.l_i_tree_id #elif defined(__GNU__) diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 7499b36..d9f633d 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -320,7 +320,7 @@ struct ext3_inode { __u16 i_pad1; __le16 l_i_uid_high; /* these 2 fields */ __le16 l_i_gid_high; /* were reserved2[0] */ - __u32 l_i_reserved2; + __u32 l_i_tree_id; /* reserved for 2-level disk quota */ } linux2; struct { __u8 h_i_frag; /* Fragment number */ @@ -351,7 +351,7 @@ struct ext3_inode { #define i_gid_low i_gid #define i_uid_high osd2.linux2.l_i_uid_high #define i_gid_high osd2.linux2.l_i_gid_high -#define i_reserved2 osd2.linux2.l_i_reserved2 +#define i_tree_id osd2.linux2.l_i_tree_id #elif defined(__GNU__)