From patchwork Sun Oct 2 19:44:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Monakhov X-Patchwork-Id: 117367 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 05EDBB6EE8 for ; Mon, 3 Oct 2011 06:41:20 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754297Ab1JBTlR (ORCPT ); Sun, 2 Oct 2011 15:41:17 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:64605 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752673Ab1JBTlP (ORCPT ); Sun, 2 Oct 2011 15:41:15 -0400 Received: by bkbzt4 with SMTP id zt4so4399514bkb.19 for ; Sun, 02 Oct 2011 12:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=iKEvD47d8jXRG+aKIPr2dv0NZYMWfX9OjExYqCv8/Bs=; b=R3RiEIkEiTr7rbklEqTzQnFyVEwal+ah+UJIScngaqzuHFZdOkfhKqYP5LcmMokf/w lXaGhi4H/iqXPOsia7a7QA+H/pmu2gZd1QjzsPuORoocKNZ/QLIW+XDgJDslckDAbw0P BSqxzWXMuzpl9kGmUVkXBcK0c/iBSY0LFwXM4= Received: by 10.204.144.86 with SMTP id y22mr6126234bku.316.1317584474262; Sun, 02 Oct 2011 12:41:14 -0700 (PDT) Received: from localhost.localdomain (swsoft-msk-nat.sw.ru. [195.214.232.10]) by mx.google.com with ESMTPS id z7sm10882653bkt.5.2011.10.02.12.41.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 12:41:13 -0700 (PDT) From: Dmitry Monakhov To: linux-fsdevel@vger.kernel.org Cc: linux-ext4@vger.kernel.org, jack@suse.cz, viro@ZenIV.linux.org.uk, adityakali@google.com, Dmitry Monakhov Subject: [PATCH 2/6] Add additional owner identifier Date: Sun, 2 Oct 2011 23:44:37 +0400 Message-Id: <1317584681-29967-2-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1317584681-29967-1-git-send-email-dmonakhov@openvz.org> References: <1317584681-29967-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 5f4c45d..f3f1b12 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -56,6 +56,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 e7b118c..9059ad4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1670,6 +1670,7 @@ struct super_operations { int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); int (*nr_cached_objects)(struct super_block *); void (*free_cached_objects)(struct super_block *, int); + u32 (*get_prjid)(const struct inode *inode); }; /* diff --git a/include/linux/xattr.h b/include/linux/xattr.h index e5d1220..f8a83c3 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -61,6 +61,9 @@ #include +#define XATTR_PRJID "system.project_id" +#define XATTR_PRJID_LEN (sizeof (XATTR_PRJID)) + struct inode; struct dentry;