[PATCH 17/67] aufs special handling inode attributes on XFS branch in linux-2.6.24 and later

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

	initial commit
	aufs special handling inode attributes on XFS branch in linux-2.6.24 and later

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
 fs/aufs/br_xfs.c |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/br_xfs.c b/fs/aufs/br_xfs.c
new file mode 100644
index 0000000..360ffaa
--- /dev/null
+++ b/fs/aufs/br_xfs.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2008 Junjiro Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * special handling inode attributes on XFS branch in linux-2.6.24 and later
+ *
+ * $Id: br_xfs.c,v 1.2 2008/04/21 01:33:00 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+/* h_mnt can be NULL, is it safe? */
+dev_t au_h_rdev(struct inode *h_inode, struct vfsmount *h_mnt,
+		struct dentry *h_dentry)
+{
+	dev_t rdev;
+	int err;
+	struct kstat st;
+
+	LKTRTrace("hi%lu\n", h_inode->i_ino);
+	if (h_dentry)
+		LKTRTrace("%.*s\n", AuDLNPair(h_dentry));
+
+	rdev = h_inode->i_rdev;
+	if (!rdev || !au_test_xfs(h_inode->i_sb))
+		goto out;
+
+	rdev = 0;
+	if (!h_dentry) {
+		err = 0;
+		h_dentry = d_find_alias(h_inode);
+		if (unlikely(!h_dentry))
+			goto failure;
+		err = PTR_ERR(h_dentry);
+		if (IS_ERR(h_dentry)) {
+			h_dentry = NULL;
+			goto failure;
+		}
+		LKTRTrace("%.*s\n", AuDLNPair(h_dentry));
+	} else
+		dget(h_dentry);
+
+	err = vfsub_getattr(h_mnt, h_dentry, &st, /*dlgt*/0);
+	dput(h_dentry);
+	if (!err) {
+		rdev = st.rdev;
+		goto out; /* success */
+	}
+
+ failure:
+	AuIOErr("failed rdev for XFS inode, hi%lu, %d\n", h_inode->i_ino, err);
+ out:
+	return rdev;
+}
-- 
1.4.4.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/67] aufs document, , (Fri May 16, 10:32 am)
Re: [PATCH 1/67] aufs document, Dave Quigley, (Fri May 16, 10:59 am)
Re: [PATCH 1/67] aufs document , , (Fri May 16, 11:45 am)
Re: [PATCH 1/67] aufs document, Dave Quigley, (Fri May 16, 12:09 pm)
Re: [PATCH 1/67] aufs document , , (Fri May 16, 10:06 pm)
Re: [PATCH 1/67] aufs document, Jan Engelhardt, (Fri May 16, 11:32 am)
Re: [PATCH 1/67] aufs document , , (Sun May 18, 10:25 pm)
Re: [PATCH 1/67] aufs document, Josef 'Jeff' Sipek, (Fri May 16, 5:07 pm)
[PATCH 2/67] aufs manual, , (Fri May 16, 10:32 am)
[PATCH 3/67] aufs global header file, , (Fri May 16, 10:32 am)
[PATCH 4/67] aufs configuration, , (Fri May 16, 10:32 am)
Re: [PATCH 4/67] aufs configuration, Jan Engelhardt, (Fri May 16, 11:28 am)
Re: [PATCH 4/67] aufs configuration , , (Sun May 18, 10:23 pm)
[PATCH 5/67] aufs Makefile, , (Fri May 16, 10:32 am)
Re: [PATCH 5/67] aufs Makefile, Sam Ravnborg, (Fri May 16, 1:25 pm)
Re: [PATCH 5/67] aufs Makefile , , (Sun May 18, 10:27 pm)
[PATCH 6/67] aufs main header file, , (Fri May 16, 10:32 am)
Re: [PATCH 6/67] aufs main header file, Jan Engelhardt, (Fri May 16, 11:33 am)
Re: [PATCH 8/67] aufs module global variables and operations, Jan Engelhardt, (Fri May 16, 11:36 am)
[PATCH 13/67] aufs branch management, , (Fri May 16, 10:32 am)
[PATCH 17/67] aufs special handling inode attributes on XFS ..., , (Fri May 16, 10:32 am)
[PATCH 24/67] aufs sub-VFS, header, , (Fri May 16, 10:32 am)
[PATCH 25/67] aufs sub-VFS, source, , (Fri May 16, 10:32 am)
[PATCH 26/67] aufs sub-dcache, header, , (Fri May 16, 10:32 am)
[PATCH 27/67] aufs sub-dcache, source, , (Fri May 16, 10:32 am)
[PATCH 32/67] aufs pseudo-link, , (Fri May 16, 10:32 am)
[PATCH 36/67] aufs dentry private data, , (Fri May 16, 10:32 am)
[PATCH 37/67] aufs file operations, , (Fri May 16, 10:32 am)
[PATCH 39/67] aufs file private data, , (Fri May 16, 10:32 am)
[PATCH 44/67] aufs inode operations, , (Fri May 16, 10:32 am)
[PATCH 45/67] aufs inode functions, , (Fri May 16, 10:32 am)
[PATCH 46/67] aufs inode private data, , (Fri May 16, 10:33 am)
[PATCH 52/67] aufs inotify handler, , (Fri May 16, 10:33 am)
[PATCH 55/67] aufs export via nfs, , (Fri May 16, 10:33 am)
[PATCH 57/67] aufs sysfs interface, , (Fri May 16, 10:33 am)
[PATCH 62/67] aufs magic sysrq handler, , (Fri May 16, 10:33 am)
[PATCH 63/67] aufs mount helper, , (Fri May 16, 10:33 am)
[PATCH 64/67] aufs pseudo-link helper, , (Fri May 16, 10:33 am)
[PATCH 66/67] aufs umount helper, , (Fri May 16, 10:33 am)
[PATCH 67/67] merge aufs, , (Fri May 16, 10:33 am)