Skip to contentSkip to conversation

xfs: directly call xfs_generic_create() for ->create() and ->mkdir()

PATCH In review [email protected] 2 participants 2 messages Sep 25, 2020 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfs: directly call xfs_generic_create() for ->create() and ->mkdir()

From: Kaixu Xia <[email protected]>

The current create and mkdir handlers both call the xfs_vn_mknod() which is a wrapper routine around xfs_generic_create() function. Actually the create and mkdir handlers can directly call xfs_generic_create() function and reduce the call chain.

---
v2:
-add the necessary space.

 fs/xfs/xfs_iops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_iops.c +2 -2
index 80a13c8561d8..5e165456da68 100644
@@ -237,7 +237,7 @@ xfs_vn_create(
 	umode_t		mode,
 	bool		flags)
 {
-	return xfs_vn_mknod(dir, dentry, mode, 0);
+	return xfs_generic_create(dir, dentry, mode, 0, false);
 }
 
 STATIC int
@@ -246,7 +246,7 @@ xfs_vn_mkdir(
 	struct dentry	*dentry,
 	umode_t		mode)
 {
-	return xfs_vn_mknod(dir, dentry, mode|S_IFDIR, 0);
+	return xfs_generic_create(dir, dentry, mode | S_IFDIR, 0, false);
 }
 
 STATIC struct dentry *
Signature · 1 line
2.20.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · On Fri, Sep 25, 2020 at 10:43:21AM +0800, [email protected] wrote:

From: Kaixu Xia <[email protected]>

The current create and mkdir handlers both call the xfs_vn_mknod() which is a wrapper routine around xfs_generic_create() function. Actually the create and mkdir handlers can directly call xfs_generic_create() function and reduce the call chain.

Looks good to me,

--D

Quoted 32 lines

---
v2:
-add the necessary space.

 fs/xfs/xfs_iops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_iops.c +2 -2
index 80a13c8561d8..5e165456da68 100644
@@ -237,7 +237,7 @@ xfs_vn_create(
 	umode_t		mode,
 	bool		flags)
 {
-	return xfs_vn_mknod(dir, dentry, mode, 0);
+	return xfs_generic_create(dir, dentry, mode, 0, false);
 }
 
 STATIC int
@@ -246,7 +246,7 @@ xfs_vn_mkdir(
 	struct dentry	*dentry,
 	umode_t		mode)
 {
-	return xfs_vn_mknod(dir, dentry, mode|S_IFDIR, 0);
+	return xfs_generic_create(dir, dentry, mode | S_IFDIR, 0, false);
 }
 
 STATIC struct dentry *
Signature · 1 line
2.20.0