From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bharata B Rao Subject: [RFC][PATCH 3/14] Add the whiteout file type Date: Mon, 14 May 2007 15:09:43 +0530 Message-ID: <20070514093943.GE4139@in.ibm.com> References: <20070514093722.GB4139@in.ibm.com> Reply-To: bharata@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Jan Blunck To: linux-kernel@vger.kernel.org Return-path: Received: from e31.co.us.ibm.com ([32.97.110.149]:40563 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755836AbXENJcU (ORCPT ); Mon, 14 May 2007 05:32:20 -0400 Content-Disposition: inline In-Reply-To: <20070514093722.GB4139@in.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org From: Jan Blunck Subject: Add the whiteout file type A white-out stops the VFS from further lookups of the white-outs name and returns -ENOENT. This is the same behaviour as if the filename isn't found. This can be used in combination with union mounts to virtually delete (white-out) files by creating a file with this file type. Signed-off-by: Jan Blunck Signed-off-by: Bharata B Rao --- include/linux/stat.h | 2 ++ 1 files changed, 2 insertions(+) --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -10,6 +10,7 @@ #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) #define S_IFMT 00170000 +#define S_IFWHT 0160000 /* whiteout */ #define S_IFSOCK 0140000 #define S_IFLNK 0120000 #define S_IFREG 0100000 @@ -28,6 +29,7 @@ #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +#define S_ISWHT(m) (((m) & S_IFMT) == S_IFWHT) #define S_IRWXU 00700 #define S_IRUSR 00400