All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhi Yong Wu <zwu.kernel@gmail.com>
To: xfs@oss.sgi.com
Cc: linux-fsdevel@vger.kernel.org,
	Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] xfs: factor prid related codes into xfs_get_initial_prid()
Date: Fri, 13 Dec 2013 22:27:49 +0800	[thread overview]
Message-ID: <1386944873-16796-2-git-send-email-zwu.kernel@gmail.com> (raw)
In-Reply-To: <1386944873-16796-1-git-send-email-zwu.kernel@gmail.com>

From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

It will be reused by the O_TMPFILE creation function.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
 fs/xfs/xfs_inode.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 001aa89..e8b9a68 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1139,6 +1139,14 @@ xfs_bumplink(
 	return 0;
 }
 
+static inline prid_t xfs_get_initial_prid(struct xfs_inode *dp)
+{
+	if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
+		return xfs_get_projid(dp);
+	else
+		return XFS_PROJID_DEFAULT;
+}
+
 int
 xfs_create(
 	xfs_inode_t		*dp,
@@ -1169,10 +1177,7 @@ xfs_create(
 	if (XFS_FORCED_SHUTDOWN(mp))
 		return XFS_ERROR(EIO);
 
-	if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
-		prid = xfs_get_projid(dp);
-	else
-		prid = XFS_PROJID_DEFAULT;
+	prid = xfs_get_initial_prid(dp);
 
 	/*
 	 * Make sure that we have allocated dquot(s) on disk.
-- 
1.7.6.5

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

WARNING: multiple messages have this Message-ID (diff)
From: Zhi Yong Wu <zwu.kernel@gmail.com>
To: xfs@oss.sgi.com
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Subject: [PATCH 1/5] xfs: factor prid related codes into xfs_get_initial_prid()
Date: Fri, 13 Dec 2013 22:27:49 +0800	[thread overview]
Message-ID: <1386944873-16796-2-git-send-email-zwu.kernel@gmail.com> (raw)
In-Reply-To: <1386944873-16796-1-git-send-email-zwu.kernel@gmail.com>

From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

It will be reused by the O_TMPFILE creation function.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
 fs/xfs/xfs_inode.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 001aa89..e8b9a68 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1139,6 +1139,14 @@ xfs_bumplink(
 	return 0;
 }
 
+static inline prid_t xfs_get_initial_prid(struct xfs_inode *dp)
+{
+	if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
+		return xfs_get_projid(dp);
+	else
+		return XFS_PROJID_DEFAULT;
+}
+
 int
 xfs_create(
 	xfs_inode_t		*dp,
@@ -1169,10 +1177,7 @@ xfs_create(
 	if (XFS_FORCED_SHUTDOWN(mp))
 		return XFS_ERROR(EIO);
 
-	if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
-		prid = xfs_get_projid(dp);
-	else
-		prid = XFS_PROJID_DEFAULT;
+	prid = xfs_get_initial_prid(dp);
 
 	/*
 	 * Make sure that we have allocated dquot(s) on disk.
-- 
1.7.6.5


  reply	other threads:[~2013-12-13 14:28 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 14:27 [PATCH 0/5] xfs: add O_TMPFILE support Zhi Yong Wu
2013-12-13 14:27 ` Zhi Yong Wu
2013-12-13 14:27 ` Zhi Yong Wu [this message]
2013-12-13 14:27   ` [PATCH 1/5] xfs: factor prid related codes into xfs_get_initial_prid() Zhi Yong Wu
2013-12-13 16:32   ` Christoph Hellwig
2013-12-13 16:32     ` Christoph Hellwig
2013-12-14 11:20     ` Jeff Liu
2013-12-14 11:20       ` Jeff Liu
2013-12-14 11:43       ` Zhi Yong Wu
2013-12-14 11:43         ` Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 2/5] xfs: adjust the interface of xfs_qm_vop_dqalloc() Zhi Yong Wu
2013-12-13 14:27   ` Zhi Yong Wu
2013-12-13 16:32   ` Christoph Hellwig
2013-12-13 16:32     ` Christoph Hellwig
2013-12-13 17:29     ` Zhi Yong Wu
2013-12-13 17:29       ` Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 3/5] xfs: add xfs_create_tmpfile() for O_TMPFILE support Zhi Yong Wu
2013-12-13 14:27   ` Zhi Yong Wu
2013-12-13 16:37   ` Christoph Hellwig
2013-12-13 16:37     ` Christoph Hellwig
2013-12-13 17:29     ` Zhi Yong Wu
2013-12-13 17:29       ` Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 4/5] xfs: add a new method xfs_vn_tmpfile() Zhi Yong Wu
2013-12-13 14:27   ` Zhi Yong Wu
2013-12-13 16:39   ` Christoph Hellwig
2013-12-13 16:39     ` Christoph Hellwig
2013-12-13 17:32     ` Zhi Yong Wu
2013-12-13 17:32       ` Zhi Yong Wu
2013-12-13 14:27 ` [PATCH 5/5] xfs: allow linkat() on O_TMPFILE files Zhi Yong Wu
2013-12-13 14:27   ` Zhi Yong Wu
2013-12-13 16:41   ` Christoph Hellwig
2013-12-13 16:41     ` Christoph Hellwig
2013-12-13 17:36     ` Zhi Yong Wu
2013-12-13 17:36       ` Zhi Yong Wu
2013-12-14  8:19       ` Dave Chinner
2013-12-14  8:19         ` Dave Chinner
2013-12-14  9:58         ` Zhi Yong Wu
2013-12-14  9:58           ` Zhi Yong Wu

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=1386944873-16796-2-git-send-email-zwu.kernel@gmail.com \
    --to=zwu.kernel@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wuzhy@linux.vnet.ibm.com \
    --cc=xfs@oss.sgi.com \
    /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.