All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-fsdevel@vger.kernel.org
Subject: hfsplus: remove superflous rootflags field in hfsplus_inode_info
Date: Tue, 12 Oct 2010 15:58:16 +0200	[thread overview]
Message-ID: <20101012135816.GG26867@lst.de> (raw)
In-Reply-To: <20101012135634.GA26867@lst.de>

The rootflags field in hfsplus_inode_info only caches the immutable and
append-only flags in the VFS inode, so we can easily get rid of it.

Signed-off-by: Christoph Hellwig <hch@tuxera.com>

Index: linux-2.6/fs/hfsplus/catalog.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/catalog.c	2010-10-11 19:53:11.478003833 +0200
+++ linux-2.6/fs/hfsplus/catalog.c	2010-10-11 19:53:25.153340347 +0200
@@ -77,7 +77,6 @@ static void hfsplus_set_perms(struct ino
 		perms->rootflags |= HFSPLUS_FLG_APPEND;
 	else
 		perms->rootflags &= ~HFSPLUS_FLG_APPEND;
-	HFSPLUS_I(inode)->rootflags = perms->rootflags;
 	HFSPLUS_I(inode)->userflags = perms->userflags;
 	perms->mode = cpu_to_be16(inode->i_mode);
 	perms->owner = cpu_to_be32(inode->i_uid);
Index: linux-2.6/fs/hfsplus/hfsplus_fs.h
===================================================================
--- linux-2.6.orig/fs/hfsplus/hfsplus_fs.h	2010-10-11 19:53:45.780260404 +0200
+++ linux-2.6/fs/hfsplus/hfsplus_fs.h	2010-10-11 19:53:55.403280008 +0200
@@ -184,7 +184,7 @@ struct hfsplus_inode_info {
 	 * Protected by i_mutex.
 	 */
 	sector_t fs_blocks;
-	u8 rootflags, userflags;	/* BSD system and user file flags */
+	u8 userflags;		/* BSD user file flags */
 	struct list_head open_dir_list;
 	loff_t phys_size;
 
Index: linux-2.6/fs/hfsplus/inode.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/inode.c	2010-10-11 19:53:33.846004413 +0200
+++ linux-2.6/fs/hfsplus/inode.c	2010-10-11 19:53:36.680005829 +0200
@@ -241,7 +241,6 @@ static void hfsplus_get_perms(struct ino
 		mode = S_IFREG | ((S_IRUGO|S_IWUGO) & ~(sbi->umask));
 	inode->i_mode = mode;
 
-	HFSPLUS_I(inode)->rootflags = perms->rootflags;
 	HFSPLUS_I(inode)->userflags = perms->userflags;
 	if (perms->rootflags & HFSPLUS_FLG_IMMUTABLE)
 		inode->i_flags |= S_IMMUTABLE;
Index: linux-2.6/fs/hfsplus/ioctl.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/ioctl.c	2010-10-11 19:50:47.467253978 +0200
+++ linux-2.6/fs/hfsplus/ioctl.c	2010-10-11 19:53:03.041005900 +0200
@@ -26,9 +26,9 @@ static int hfsplus_ioctl_getflags(struct
 	struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
 	unsigned int flags = 0;
 
-	if (hip->rootflags & HFSPLUS_FLG_IMMUTABLE)
+	if (inode->i_flags & S_IMMUTABLE)
 		flags |= FS_IMMUTABLE_FL;
-	if (hip->rootflags & HFSPLUS_FLG_APPEND)
+	if (inode->i_flags |= S_APPEND)
 		flags |= FS_APPEND_FL;
 	if (hip->userflags & HFSPLUS_FLG_NODUMP)
 		flags |= FS_NODUMP_FL;
@@ -59,8 +59,8 @@ static int hfsplus_ioctl_setflags(struct
 
 	mutex_lock(&inode->i_mutex);
 
-	if (flags & (FS_IMMUTABLE_FL|FS_APPEND_FL) ||
-	    hip->rootflags & (HFSPLUS_FLG_IMMUTABLE|HFSPLUS_FLG_APPEND)) {
+	if ((flags & (FS_IMMUTABLE_FL|FS_APPEND_FL)) ||
+	    inode->i_flags & (S_IMMUTABLE|S_APPEND)) {
 		if (!capable(CAP_LINUX_IMMUTABLE)) {
 			err = -EPERM;
 			goto out_unlock_inode;
@@ -72,20 +72,17 @@ static int hfsplus_ioctl_setflags(struct
 		err = -EOPNOTSUPP;
 		goto out_unlock_inode;
 	}
-	if (flags & FS_IMMUTABLE_FL) {
+
+	if (flags & FS_IMMUTABLE_FL)
 		inode->i_flags |= S_IMMUTABLE;
-		hip->rootflags |= HFSPLUS_FLG_IMMUTABLE;
-	} else {
+	else
 		inode->i_flags &= ~S_IMMUTABLE;
-		hip->rootflags &= ~HFSPLUS_FLG_IMMUTABLE;
-	}
-	if (flags & FS_APPEND_FL) {
+
+	if (flags & FS_APPEND_FL)
 		inode->i_flags |= S_APPEND;
-		hip->rootflags |= HFSPLUS_FLG_APPEND;
-	} else {
+	else
 		inode->i_flags &= ~S_APPEND;
-		hip->rootflags &= ~HFSPLUS_FLG_APPEND;
-	}
+
 	if (flags & FS_NODUMP_FL)
 		hip->userflags |= HFSPLUS_FLG_NODUMP;
 	else

  parent reply	other threads:[~2010-10-12 13:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12 13:56 hfsplus updates Christoph Hellwig
2010-10-12 13:56 ` hfsplus: fix oops on mount with corrupted btree extent records Christoph Hellwig
2010-10-12 13:57 ` hfs_bnode_find() can fail, resulting in hfs_bnode_split() breakage Christoph Hellwig
2010-10-12 13:57 ` hfsplus: handle more on-disk corruptions without oopsing Christoph Hellwig
2010-10-12 13:57 ` hfsplus: validate btree flags Christoph Hellwig
2010-10-12 13:58 ` hfsplus: fix link corruption Christoph Hellwig
2010-10-12 13:58 ` Christoph Hellwig [this message]
2010-10-12 13:58 ` hfsplus: create correct initial catalog entries for device files Christoph Hellwig
2010-10-12 13:58 ` hfsplus: remove the unused hfsplus_kmap/hfsplus_kunmap helpers Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101012135816.GG26867@lst.de \
    --to=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.