From patchwork Fri Oct 29 13:03:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Monakhov X-Patchwork-Id: 69579 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 84443B70E0 for ; Sat, 30 Oct 2010 00:04:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758532Ab0J2ND4 (ORCPT ); Fri, 29 Oct 2010 09:03:56 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:61064 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756141Ab0J2NDz (ORCPT ); Fri, 29 Oct 2010 09:03:55 -0400 Received: by mail-ey0-f174.google.com with SMTP id 27so2081912eye.19 for ; Fri, 29 Oct 2010 06:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=P3Z/T47P4Fg6GUr73AzrF9lh5oqU3j+EAbW8lQ7bt+c=; b=Qp0yuHiXYBIhYrGjI6cRJZwvhFVdvj8NxMW5YLYnwf+soEdRAukNpS7RPyqO4R8ozC tk3i6Za6fMFfRFlGG4T/v7WHt8pCq3bzcJsobTEkz9otbSCimaM0SfdRWUPkxddoVoIs tuFuk3NsrBEm9RQqyE94r2F7ABHCObvFVgje0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=uieHOtSaS07BCPLIlghI+r8Kn3vbt41i7/JhuHTkH8DWApiQroBDgulzFild4YAmyA twR+nAHCWJL8wuATXFZjIF3h0BZOb90R0e1qVPpdqXA/mSKGlXSy9p1XSlU5ho/6tREH EVMmxaBcn9zuKiXyrWefGgK6MlXn3fS0fL+0E= Received: by 10.14.11.147 with SMTP id 19mr9900184eex.14.1288357434124; Fri, 29 Oct 2010 06:03:54 -0700 (PDT) Received: from localhost.localdomain (swsoft-msk-nat.sw.ru [195.214.232.10]) by mx.google.com with ESMTPS id x54sm1686102eeh.23.2010.10.29.06.03.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Oct 2010 06:03:53 -0700 (PDT) From: Dmitry Monakhov To: linux-fsdevel@vger.kernel.org Cc: viro@ZenIV.linux.org.uk, jack@suse.cz, linux-ext4@vger.kernel.org, Dmitry Monakhov Subject: [PATCH 1/4] vfs: Add additional owner identifier Date: Fri, 29 Oct 2010 17:03:37 +0400 Message-Id: <1288357420-7178-2-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1288357420-7178-1-git-send-email-dmonakhov@openvz.org> References: <1288357420-7178-1-git-send-email-dmonakhov@openvz.org> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This patch add project inode identifier. Project ID may be used as auxiliary owner specifier in addition to standard uid/gid. Signed-off-by: Dmitry Monakhov --- fs/Kconfig | 7 +++++++ include/linux/fs.h | 1 + include/linux/xattr.h | 3 +++ 3 files changed, 11 insertions(+), 0 deletions(-) diff --git a/fs/Kconfig b/fs/Kconfig index c49e224..4250f0b 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -58,6 +58,13 @@ config FILE_LOCKING This option enables standard file locking support, required for filesystems like NFS and for the flock() system call. Disabling this option saves about 11k. +config PROJECT_ID + bool "Enable project inode identifier" + default y + help + This option enables project inode identifier. Project ID + may be used as auxiliary owner specifier in addition to + standard uid/gid. source "fs/notify/Kconfig" diff --git a/include/linux/fs.h b/include/linux/fs.h index 24dd5d5..cba9a65 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1611,6 +1611,7 @@ struct super_operations { #endif int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); int (*trim_fs) (struct super_block *, struct fstrim_range *); + u32 (*get_prjid)(const struct inode *inode); }; /* diff --git a/include/linux/xattr.h b/include/linux/xattr.h index f1e5bde..2f64a1c 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -47,6 +47,9 @@ #define XATTR_CAPS_SUFFIX "capability" #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX +#define XATTR_PRJID "system.project_id" +#define XATTR_PRJID_LEN (sizeof (XATTR_PRJID)) + struct inode; struct dentry;