public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] A couple more patches for 2.6.30
@ 2009-03-18  9:41 Christoph Hellwig
  2009-03-18  9:41 ` [PATCH 1/5] xfs: cleanup uuid handling Christoph Hellwig
                   ` (5 more replies)
  0 siblings, 6 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-18  9:41 UTC (permalink / raw)
  To: xfs


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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 1/5] xfs: cleanup uuid handling
  2009-03-18  9:41 [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
@ 2009-03-18  9:41 ` Christoph Hellwig
  2009-03-29  7:45   ` Christoph Hellwig
  2009-03-30  6:06   ` Felix Blyakher
  2009-03-18  9:41 ` [PATCH 2/5] xfs: kill mutex_t typedef Christoph Hellwig
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-18  9:41 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-uuid-cleanup --]
[-- Type: text/plain, Size: 7543 bytes --]

The uuid table handling should not be part of a semi-generic uuid library
but in the XFS code using it, so move those bits to xfs_mount.c and
refactor the whole glob to give a proper abstraction.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/support/uuid.c
===================================================================
--- xfs.orig/fs/xfs/support/uuid.c	2009-02-15 19:40:08.564944522 +0100
+++ xfs/fs/xfs/support/uuid.c	2009-02-24 21:50:49.051029140 +0100
@@ -17,10 +17,6 @@
  */
 #include <xfs.h>
 
-static DEFINE_MUTEX(uuid_monitor);
-static int	uuid_table_size;
-static uuid_t	*uuid_table;
-
 /* IRIX interpretation of an uuid_t */
 typedef struct {
 	__be32	uu_timelow;
@@ -46,12 +42,6 @@ uuid_getnodeuniq(uuid_t *uuid, int fsid 
 	fsid[1] = be32_to_cpu(uup->uu_timelow);
 }
 
-void
-uuid_create_nil(uuid_t *uuid)
-{
-	memset(uuid, 0, sizeof(*uuid));
-}
-
 int
 uuid_is_nil(uuid_t *uuid)
 {
@@ -71,64 +61,3 @@ uuid_equal(uuid_t *uuid1, uuid_t *uuid2)
 {
 	return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? 0 : 1;
 }
-
-/*
- * Given a 128-bit uuid, return a 64-bit value by adding the top and bottom
- * 64-bit words.  NOTE: This function can not be changed EVER.  Although
- * brain-dead, some applications depend on this 64-bit value remaining
- * persistent.  Specifically, DMI vendors store the value as a persistent
- * filehandle.
- */
-__uint64_t
-uuid_hash64(uuid_t *uuid)
-{
-	__uint64_t	*sp = (__uint64_t *)uuid;
-
-	return sp[0] + sp[1];
-}
-
-int
-uuid_table_insert(uuid_t *uuid)
-{
-	int	i, hole;
-
-	mutex_lock(&uuid_monitor);
-	for (i = 0, hole = -1; i < uuid_table_size; i++) {
-		if (uuid_is_nil(&uuid_table[i])) {
-			hole = i;
-			continue;
-		}
-		if (uuid_equal(uuid, &uuid_table[i])) {
-			mutex_unlock(&uuid_monitor);
-			return 0;
-		}
-	}
-	if (hole < 0) {
-		uuid_table = kmem_realloc(uuid_table,
-			(uuid_table_size + 1) * sizeof(*uuid_table),
-			uuid_table_size  * sizeof(*uuid_table),
-			KM_SLEEP);
-		hole = uuid_table_size++;
-	}
-	uuid_table[hole] = *uuid;
-	mutex_unlock(&uuid_monitor);
-	return 1;
-}
-
-void
-uuid_table_remove(uuid_t *uuid)
-{
-	int	i;
-
-	mutex_lock(&uuid_monitor);
-	for (i = 0; i < uuid_table_size; i++) {
-		if (uuid_is_nil(&uuid_table[i]))
-			continue;
-		if (!uuid_equal(uuid, &uuid_table[i]))
-			continue;
-		uuid_create_nil(&uuid_table[i]);
-		break;
-	}
-	ASSERT(i < uuid_table_size);
-	mutex_unlock(&uuid_monitor);
-}
Index: xfs/fs/xfs/support/uuid.h
===================================================================
--- xfs.orig/fs/xfs/support/uuid.h	2009-02-15 19:40:08.569944670 +0100
+++ xfs/fs/xfs/support/uuid.h	2009-02-24 21:50:37.206029255 +0100
@@ -22,12 +22,8 @@ typedef struct {
 	unsigned char	__u_bits[16];
 } uuid_t;
 
-extern void uuid_create_nil(uuid_t *uuid);
 extern int uuid_is_nil(uuid_t *uuid);
 extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2);
 extern void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]);
-extern __uint64_t uuid_hash64(uuid_t *uuid);
-extern int uuid_table_insert(uuid_t *uuid);
-extern void uuid_table_remove(uuid_t *uuid);
 
 #endif	/* __XFS_SUPPORT_UUID_H__ */
Index: xfs/fs/xfs/xfs_mount.c
===================================================================
--- xfs.orig/fs/xfs/xfs_mount.c	2009-02-24 15:32:35.871518446 +0100
+++ xfs/fs/xfs/xfs_mount.c	2009-02-24 21:51:03.558027729 +0100
@@ -45,7 +45,6 @@
 #include "xfs_fsops.h"
 #include "xfs_utils.h"
 
-STATIC int	xfs_uuid_mount(xfs_mount_t *);
 STATIC void	xfs_unmountfs_wait(xfs_mount_t *);
 
 
@@ -121,6 +120,84 @@ static const struct {
     { sizeof(xfs_sb_t),			 0 }
 };
 
+static DEFINE_MUTEX(xfs_uuid_table_mutex);
+static int xfs_uuid_table_size;
+static uuid_t *xfs_uuid_table;
+
+/*
+ * See if the UUID is unique among mounted XFS filesystems.
+ * Mount fails if UUID is nil or a FS with the same UUID is already mounted.
+ */
+STATIC int
+xfs_uuid_mount(
+	struct xfs_mount	*mp)
+{
+	uuid_t			*uuid = &mp->m_sb.sb_uuid;
+	int			hole, i;
+
+	if (mp->m_flags & XFS_MOUNT_NOUUID)
+		return 0;
+
+	if (uuid_is_nil(uuid)) {
+		cmn_err(CE_WARN,
+			"XFS: Filesystem %s has nil UUID - can't mount",
+			mp->m_fsname);
+		return XFS_ERROR(EINVAL);
+	}
+
+	mutex_lock(&xfs_uuid_table_mutex);
+	for (i = 0, hole = -1; i < xfs_uuid_table_size; i++) {
+		if (uuid_is_nil(&xfs_uuid_table[i])) {
+			hole = i;
+			continue;
+		}
+		if (uuid_equal(uuid, &xfs_uuid_table[i]))
+			goto out_duplicate;
+	}
+
+	if (hole < 0) {
+		xfs_uuid_table = kmem_realloc(xfs_uuid_table,
+			(xfs_uuid_table_size + 1) * sizeof(*xfs_uuid_table),
+			xfs_uuid_table_size  * sizeof(*xfs_uuid_table),
+			KM_SLEEP);
+		hole = xfs_uuid_table_size++;
+	}
+	xfs_uuid_table[hole] = *uuid;
+	mutex_unlock(&xfs_uuid_table_mutex);
+
+	return 0;
+
+ out_duplicate:
+	mutex_unlock(&xfs_uuid_table_mutex);
+	cmn_err(CE_WARN, "XFS: Filesystem %s has duplicate UUID - can't mount",
+			 mp->m_fsname);
+	return XFS_ERROR(EINVAL);
+}
+
+STATIC void
+xfs_uuid_unmount(
+	struct xfs_mount	*mp)
+{
+	uuid_t			*uuid = &mp->m_sb.sb_uuid;
+	int			i;
+
+	if (mp->m_flags & XFS_MOUNT_NOUUID)
+		return;
+
+	mutex_lock(&xfs_uuid_table_mutex);
+	for (i = 0; i < xfs_uuid_table_size; i++) {
+		if (uuid_is_nil(&xfs_uuid_table[i]))
+			continue;
+		if (!uuid_equal(uuid, &xfs_uuid_table[i]))
+			continue;
+		memset(&xfs_uuid_table[i], 0, sizeof(uuid_t));
+		break;
+	}
+	ASSERT(i < xfs_uuid_table_size);
+	mutex_unlock(&xfs_uuid_table_mutex);
+}
+
+
 /*
  * Free up the resources associated with a mount structure.  Assume that
  * the structure was initially zeroed, so we can tell which fields got
@@ -1016,18 +1093,9 @@ xfs_mountfs(
 
 	mp->m_maxioffset = xfs_max_file_offset(sbp->sb_blocklog);
 
-	/*
-	 * XFS uses the uuid from the superblock as the unique
-	 * identifier for fsid.  We can not use the uuid from the volume
-	 * since a single partition filesystem is identical to a single
-	 * partition volume/filesystem.
-	 */
-	if (!(mp->m_flags & XFS_MOUNT_NOUUID)) {
-		if (xfs_uuid_mount(mp)) {
-			error = XFS_ERROR(EINVAL);
-			goto out;
-		}
-	}
+	error = xfs_uuid_mount(mp);
+	if (error)
+		goto out;
 
 	/*
 	 * Set the minimum read and write sizes
@@ -1275,8 +1343,7 @@ xfs_mountfs(
  out_free_perag:
 	xfs_free_perag(mp);
  out_remove_uuid:
-	if (!(mp->m_flags & XFS_MOUNT_NOUUID))
-		uuid_table_remove(&mp->m_sb.sb_uuid);
+	xfs_uuid_unmount(mp);
  out:
 	return error;
 }
@@ -1351,9 +1418,7 @@ xfs_unmountfs(
 	xfs_unmountfs_wait(mp); 		/* wait for async bufs */
 	xfs_log_unmount_write(mp);
 	xfs_log_unmount(mp);
-
-	if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0)
-		uuid_table_remove(&mp->m_sb.sb_uuid);
+	xfs_uuid_unmount(mp);
 
 #if defined(DEBUG)
 	xfs_errortag_clearall(mp, 0);
@@ -1855,29 +1920,6 @@ xfs_freesb(
 }
 
 /*
- * See if the UUID is unique among mounted XFS filesystems.
- * Mount fails if UUID is nil or a FS with the same UUID is already mounted.
- */
-STATIC int
-xfs_uuid_mount(
-	xfs_mount_t	*mp)
-{
-	if (uuid_is_nil(&mp->m_sb.sb_uuid)) {
-		cmn_err(CE_WARN,
-			"XFS: Filesystem %s has nil UUID - can't mount",
-			mp->m_fsname);
-		return -1;
-	}
-	if (!uuid_table_insert(&mp->m_sb.sb_uuid)) {
-		cmn_err(CE_WARN,
-			"XFS: Filesystem %s has duplicate UUID - can't mount",
-			mp->m_fsname);
-		return -1;
-	}
-	return 0;
-}
-
-/*
  * Used to log changes to the superblock unit and width fields which could
  * be altered by the mount options, as well as any potential sb_features2
  * fixup. Only the first superblock is updated.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 2/5] xfs: kill mutex_t typedef
  2009-03-18  9:41 [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
  2009-03-18  9:41 ` [PATCH 1/5] xfs: cleanup uuid handling Christoph Hellwig
@ 2009-03-18  9:41 ` Christoph Hellwig
  2009-03-21  3:51   ` Eric Sandeen
  2009-03-26 22:31   ` Felix Blyakher
  2009-03-18  9:41 ` [PATCH 3/5] xfs: kill ino64 mount option Christoph Hellwig
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-18  9:41 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-mutex_t --]
[-- Type: text/plain, Size: 5541 bytes --]

People continue to complain about this for weird reasons, but there's
really no point in keeping this typedef for a couple of users anyway.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/linux-2.6/mutex.h
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/mutex.h	2009-02-24 21:01:18.877182725 +0100
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This program 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.
- *
- * This program is distributed in the hope that it would 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 the Free Software Foundation,
- * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#ifndef __XFS_SUPPORT_MUTEX_H__
-#define __XFS_SUPPORT_MUTEX_H__
-
-#include <linux/mutex.h>
-
-typedef struct mutex mutex_t;
-
-#endif /* __XFS_SUPPORT_MUTEX_H__ */
Index: xfs/fs/xfs/linux-2.6/xfs_linux.h
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_linux.h	2009-02-24 21:01:34.596153088 +0100
+++ xfs/fs/xfs/linux-2.6/xfs_linux.h	2009-02-24 21:01:47.951030927 +0100
@@ -38,7 +38,6 @@
 #include <kmem.h>
 #include <mrlock.h>
 #include <sv.h>
-#include <mutex.h>
 #include <time.h>
 
 #include <support/ktrace.h>
@@ -51,6 +50,7 @@
 #include <linux/blkdev.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/file.h>
 #include <linux/swap.h>
 #include <linux/errno.h>
Index: xfs/fs/xfs/quota/xfs_dquot.h
===================================================================
--- xfs.orig/fs/xfs/quota/xfs_dquot.h	2009-02-24 20:59:24.413152831 +0100
+++ xfs/fs/xfs/quota/xfs_dquot.h	2009-02-24 20:59:39.642153943 +0100
@@ -34,7 +34,7 @@
  */
 typedef struct xfs_dqhash {
 	struct xfs_dquot *qh_next;
-	mutex_t		  qh_lock;
+	struct mutex	  qh_lock;
 	uint		  qh_version;	/* ever increasing version */
 	uint		  qh_nelems;	/* number of dquots on the list */
 } xfs_dqhash_t;
@@ -81,7 +81,7 @@ typedef struct xfs_dquot {
 	xfs_qcnt_t	 q_res_bcount;	/* total regular nblks used+reserved */
 	xfs_qcnt_t	 q_res_icount;	/* total inos allocd+reserved */
 	xfs_qcnt_t	 q_res_rtbcount;/* total realtime blks used+reserved */
-	mutex_t		 q_qlock;	/* quota lock */
+	struct mutex	 q_qlock;	/* quota lock */
 	struct completion q_flush;	/* flush completion queue */
 	atomic_t          q_pincount;	/* dquot pin count */
 	wait_queue_head_t q_pinwait;	/* dquot pinning wait queue */
Index: xfs/fs/xfs/quota/xfs_qm.c
===================================================================
--- xfs.orig/fs/xfs/quota/xfs_qm.c	2009-02-24 21:00:11.195028215 +0100
+++ xfs/fs/xfs/quota/xfs_qm.c	2009-02-24 21:00:30.583030096 +0100
@@ -55,7 +55,7 @@
  * quota functionality, including maintaining the freelist and hash
  * tables of dquots.
  */
-mutex_t		xfs_Gqm_lock;
+struct mutex	xfs_Gqm_lock;
 struct xfs_qm	*xfs_Gqm;
 uint		ndquot;
 
@@ -80,7 +80,7 @@ static struct shrinker xfs_qm_shaker = {
 };
 
 #ifdef DEBUG
-extern mutex_t	qcheck_lock;
+extern struct mutex	qcheck_lock;
 #endif
 
 #ifdef QUOTADEBUG
Index: xfs/fs/xfs/quota/xfs_qm.h
===================================================================
--- xfs.orig/fs/xfs/quota/xfs_qm.h	2009-02-24 21:00:11.207028206 +0100
+++ xfs/fs/xfs/quota/xfs_qm.h	2009-02-24 21:00:52.676027690 +0100
@@ -27,7 +27,7 @@ struct xfs_qm;
 struct xfs_inode;
 
 extern uint		ndquot;
-extern mutex_t		xfs_Gqm_lock;
+extern struct mutex	xfs_Gqm_lock;
 extern struct xfs_qm	*xfs_Gqm;
 extern kmem_zone_t	*qm_dqzone;
 extern kmem_zone_t	*qm_dqtrxzone;
@@ -79,7 +79,7 @@ typedef xfs_dqhash_t	xfs_dqlist_t;
 typedef struct xfs_frlist {
        struct xfs_dquot *qh_next;
        struct xfs_dquot *qh_prev;
-       mutex_t		 qh_lock;
+       struct mutex	 qh_lock;
        uint		 qh_version;
        uint		 qh_nelems;
 } xfs_frlist_t;
@@ -115,7 +115,7 @@ typedef struct xfs_quotainfo {
 	xfs_qwarncnt_t	 qi_bwarnlimit;	 /* limit for blks warnings */
 	xfs_qwarncnt_t	 qi_iwarnlimit;	 /* limit for inodes warnings */
 	xfs_qwarncnt_t	 qi_rtbwarnlimit;/* limit for rt blks warnings */
-	mutex_t		 qi_quotaofflock;/* to serialize quotaoff */
+	struct mutex	 qi_quotaofflock;/* to serialize quotaoff */
 	xfs_filblks_t	 qi_dqchunklen;	 /* # BBs in a chunk of dqs */
 	uint		 qi_dqperchunk;	 /* # ondisk dqs in above chunk */
 	xfs_qcnt_t	 qi_bhardlimit;	 /* default data blk hard limit */
Index: xfs/fs/xfs/quota/xfs_qm_syscalls.c
===================================================================
--- xfs.orig/fs/xfs/quota/xfs_qm_syscalls.c	2009-02-24 21:01:03.015027884 +0100
+++ xfs/fs/xfs/quota/xfs_qm_syscalls.c	2009-02-24 21:01:11.159155659 +0100
@@ -960,7 +960,7 @@ xfs_dqhash_t *qmtest_udqtab;
 xfs_dqhash_t *qmtest_gdqtab;
 int	      qmtest_hashmask;
 int	      qmtest_nfails;
-mutex_t	      qcheck_lock;
+struct mutex  qcheck_lock;
 
 #define DQTEST_HASHVAL(mp, id) (((__psunsigned_t)(mp) + \
 				 (__psunsigned_t)(id)) & \

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 3/5] xfs: kill ino64 mount option
  2009-03-18  9:41 [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
  2009-03-18  9:41 ` [PATCH 1/5] xfs: cleanup uuid handling Christoph Hellwig
  2009-03-18  9:41 ` [PATCH 2/5] xfs: kill mutex_t typedef Christoph Hellwig
@ 2009-03-18  9:41 ` Christoph Hellwig
  2009-03-21  3:54   ` Eric Sandeen
  2009-03-18  9:41 ` [PATCH 4/5] xfs: remove m_litino Christoph Hellwig
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-18  9:41 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-ino64 --]
[-- Type: text/plain, Size: 7778 bytes --]

The ino64 mount option adds a fixed offset to 32bit inode numbers
to bring them into the 64bit range.  There's no need for this kind
of debug tool given that it's easy to produce real 64bit inode numbers
for testing.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_iops.c	2009-03-17 19:46:13.246882523 +0100
+++ xfs/fs/xfs/linux-2.6/xfs_iops.c	2009-03-17 19:58:00.491978754 +0100
@@ -541,9 +541,6 @@ xfs_vn_getattr(
 	stat->uid = ip->i_d.di_uid;
 	stat->gid = ip->i_d.di_gid;
 	stat->ino = ip->i_ino;
-#if XFS_BIG_INUMS
-	stat->ino += mp->m_inoadd;
-#endif
 	stat->atime = inode->i_atime;
 	stat->mtime.tv_sec = ip->i_d.di_mtime.t_sec;
 	stat->mtime.tv_nsec = ip->i_d.di_mtime.t_nsec;
Index: xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_super.c	2009-03-17 19:50:03.421854113 +0100
+++ xfs/fs/xfs/linux-2.6/xfs_super.c	2009-03-17 19:58:00.492978881 +0100
@@ -78,7 +78,6 @@ mempool_t *xfs_ioend_pool;
 #define MNTOPT_RTDEV	"rtdev"		/* realtime I/O device */
 #define MNTOPT_BIOSIZE	"biosize"	/* log2 of preferred buffered io size */
 #define MNTOPT_WSYNC	"wsync"		/* safe-mode nfs compatible mount */
-#define MNTOPT_INO64	"ino64"		/* force inodes into 64-bit range */
 #define MNTOPT_NOALIGN	"noalign"	/* turn off stripe alignment */
 #define MNTOPT_SWALLOC	"swalloc"	/* turn on stripe width allocation */
 #define MNTOPT_SUNIT	"sunit"		/* data volume stripe unit */
@@ -290,16 +289,6 @@ xfs_parseargs(
 			mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC;
 		} else if (!strcmp(this_char, MNTOPT_NORECOVERY)) {
 			mp->m_flags |= XFS_MOUNT_NORECOVERY;
-		} else if (!strcmp(this_char, MNTOPT_INO64)) {
-#if XFS_BIG_INUMS
-			mp->m_flags |= XFS_MOUNT_INO64;
-			mp->m_inoadd = XFS_INO64_OFFSET;
-#else
-			cmn_err(CE_WARN,
-				"XFS: %s option not allowed on this system",
-				this_char);
-			return EINVAL;
-#endif
 		} else if (!strcmp(this_char, MNTOPT_NOALIGN)) {
 			mp->m_flags |= XFS_MOUNT_NOALIGN;
 		} else if (!strcmp(this_char, MNTOPT_SWALLOC)) {
@@ -536,7 +525,6 @@ xfs_showargs(
 		/* the few simple ones we can get from the mount struct */
 		{ XFS_MOUNT_IKEEP,		"," MNTOPT_IKEEP },
 		{ XFS_MOUNT_WSYNC,		"," MNTOPT_WSYNC },
-		{ XFS_MOUNT_INO64,		"," MNTOPT_INO64 },
 		{ XFS_MOUNT_NOALIGN,		"," MNTOPT_NOALIGN },
 		{ XFS_MOUNT_SWALLOC,		"," MNTOPT_SWALLOC },
 		{ XFS_MOUNT_NOUUID,		"," MNTOPT_NOUUID },
@@ -1207,18 +1195,12 @@ xfs_fs_statfs(
 	statp->f_bfree = statp->f_bavail =
 				sbp->sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp);
 	fakeinos = statp->f_bfree << sbp->sb_inopblog;
-#if XFS_BIG_INUMS
-	fakeinos += mp->m_inoadd;
-#endif
 	statp->f_files =
 	    MIN(sbp->sb_icount + fakeinos, (__uint64_t)XFS_MAXINUMBER);
 	if (mp->m_maxicount)
-#if XFS_BIG_INUMS
-		if (!mp->m_inoadd)
-#endif
-			statp->f_files = min_t(typeof(statp->f_files),
-						statp->f_files,
-						mp->m_maxicount);
+		statp->f_files = min_t(typeof(statp->f_files),
+					statp->f_files,
+					mp->m_maxicount);
 	statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree);
 	spin_unlock(&mp->m_sb_lock);
 
Index: xfs/fs/xfs/xfs_dir2_block.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dir2_block.c	2009-02-11 20:49:46.773069530 +0100
+++ xfs/fs/xfs/xfs_dir2_block.c	2009-03-17 19:58:53.672855925 +0100
@@ -448,7 +448,6 @@ xfs_dir2_block_getdents(
 	xfs_mount_t		*mp;		/* filesystem mount point */
 	char			*ptr;		/* current data entry */
 	int			wantoff;	/* starting block offset */
-	xfs_ino_t		ino;
 	xfs_off_t		cook;
 
 	mp = dp->i_mount;
@@ -509,16 +508,12 @@ xfs_dir2_block_getdents(
 
 		cook = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk,
 					    (char *)dep - (char *)block);
-		ino = be64_to_cpu(dep->inumber);
-#if XFS_BIG_INUMS
-		ino += mp->m_inoadd;
-#endif
 
 		/*
 		 * If it didn't fit, set the final offset to here & return.
 		 */
 		if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff,
-			    ino, DT_UNKNOWN)) {
+			    be64_to_cpu(dep->inumber), DT_UNKNOWN)) {
 			*offset = cook & 0x7fffffff;
 			xfs_da_brelse(NULL, bp);
 			return 0;
Index: xfs/fs/xfs/xfs_dir2_leaf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dir2_leaf.c	2009-03-15 15:52:46.814978815 +0100
+++ xfs/fs/xfs/xfs_dir2_leaf.c	2009-03-17 19:59:39.331981439 +0100
@@ -780,7 +780,6 @@ xfs_dir2_leaf_getdents(
 	int			ra_index;	/* *map index for read-ahead */
 	int			ra_offset;	/* map entry offset for ra */
 	int			ra_want;	/* readahead count wanted */
-	xfs_ino_t		ino;
 
 	/*
 	 * If the offset is at or past the largest allowed value,
@@ -1076,24 +1075,12 @@ xfs_dir2_leaf_getdents(
 			continue;
 		}
 
-		/*
-		 * Copy the entry into the putargs, and try formatting it.
-		 */
 		dep = (xfs_dir2_data_entry_t *)ptr;
-
 		length = xfs_dir2_data_entsize(dep->namelen);
 
-		ino = be64_to_cpu(dep->inumber);
-#if XFS_BIG_INUMS
-		ino += mp->m_inoadd;
-#endif
-
-		/*
-		 * Won't fit.  Return to caller.
-		 */
 		if (filldir(dirent, dep->name, dep->namelen,
 			    xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff,
-			    ino, DT_UNKNOWN))
+			    be64_to_cpu(dep->inumber), DT_UNKNOWN))
 			break;
 
 		/*
Index: xfs/fs/xfs/xfs_dir2_sf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dir2_sf.c	2009-02-11 20:49:46.759069355 +0100
+++ xfs/fs/xfs/xfs_dir2_sf.c	2009-03-17 20:00:44.438859792 +0100
@@ -748,11 +748,7 @@ xfs_dir2_sf_getdents(
 	 * Put . entry unless we're starting past it.
 	 */
 	if (*offset <= dot_offset) {
-		ino = dp->i_ino;
-#if XFS_BIG_INUMS
-		ino += mp->m_inoadd;
-#endif
-		if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, ino, DT_DIR)) {
+		if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, dp->i_ino, DT_DIR)) {
 			*offset = dot_offset & 0x7fffffff;
 			return 0;
 		}
@@ -763,9 +759,6 @@ xfs_dir2_sf_getdents(
 	 */
 	if (*offset <= dotdot_offset) {
 		ino = xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent);
-#if XFS_BIG_INUMS
-		ino += mp->m_inoadd;
-#endif
 		if (filldir(dirent, "..", 2, dotdot_offset & 0x7fffffff, ino, DT_DIR)) {
 			*offset = dotdot_offset & 0x7fffffff;
 			return 0;
@@ -786,10 +779,6 @@ xfs_dir2_sf_getdents(
 		}
 
 		ino = xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep));
-#if XFS_BIG_INUMS
-		ino += mp->m_inoadd;
-#endif
-
 		if (filldir(dirent, sfep->name, sfep->namelen,
 			    off & 0x7fffffff, ino, DT_UNKNOWN)) {
 			*offset = off & 0x7fffffff;
Index: xfs/fs/xfs/xfs_mount.h
===================================================================
--- xfs.orig/fs/xfs/xfs_mount.h	2009-03-17 19:50:03.418853801 +0100
+++ xfs/fs/xfs/xfs_mount.h	2009-03-17 19:58:00.501978351 +0100
@@ -211,9 +211,6 @@ typedef struct xfs_mount {
 	__uint64_t		m_maxioffset;	/* maximum inode offset */
 	__uint64_t		m_resblks;	/* total reserved blocks */
 	__uint64_t		m_resblks_avail;/* available reserved blocks */
-#if XFS_BIG_INUMS
-	xfs_ino_t		m_inoadd;	/* add value for ino64_offset */
-#endif
 	int			m_dalign;	/* stripe unit */
 	int			m_swidth;	/* stripe width */
 	int			m_sinoalign;	/* stripe unit inode alignment */
@@ -255,7 +252,6 @@ typedef struct xfs_mount {
 #define XFS_MOUNT_WSYNC		(1ULL << 0)	/* for nfs - all metadata ops
 						   must be synchronous except
 						   for space allocations */
-#define XFS_MOUNT_INO64		(1ULL << 1)
 #define XFS_MOUNT_DMAPI		(1ULL << 2)	/* dmapi is enabled */
 #define XFS_MOUNT_WAS_CLEAN	(1ULL << 3)
 #define XFS_MOUNT_FS_SHUTDOWN	(1ULL << 4)	/* atomic stop of all filesystem

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 4/5] xfs: remove m_litino
  2009-03-18  9:41 [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
                   ` (2 preceding siblings ...)
  2009-03-18  9:41 ` [PATCH 3/5] xfs: kill ino64 mount option Christoph Hellwig
@ 2009-03-18  9:41 ` Christoph Hellwig
  2009-03-21  3:57   ` Eric Sandeen
  2009-03-26 22:41   ` Felix Blyakher
  2009-03-18  9:41 ` [PATCH 5/5] xfs: remove m_attroffset Christoph Hellwig
  2009-03-29  9:28 ` [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
  5 siblings, 2 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-18  9:41 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-m_litino --]
[-- Type: text/plain, Size: 2188 bytes --]

With the upcoming v3 inodes the inode data/attr area size needs to be
calculated for each specific inode, so we can't cache it in the superblock
anymore.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_dinode.h
===================================================================
--- xfs.orig/fs/xfs/xfs_dinode.h	2009-02-19 20:44:20.755069389 +0100
+++ xfs/fs/xfs/xfs_dinode.h	2009-03-18 07:37:16.652977839 +0100
@@ -103,7 +103,9 @@ typedef enum xfs_dinode_fmt {
 /*
  * Inode size for given fs.
  */
-#define	XFS_LITINO(mp)	((mp)->m_litino)
+#define XFS_LITINO(mp) \
+	((int)(((mp)->m_sb.sb_inodesize) - sizeof(struct xfs_dinode)))
+
 #define	XFS_BROOT_SIZE_ADJ	\
 	(XFS_BTREE_LBLOCK_LEN - sizeof(xfs_bmdr_block_t))
 
Index: xfs/fs/xfs/xfs_mount.c
===================================================================
--- xfs.orig/fs/xfs/xfs_mount.c	2009-03-18 07:37:15.633978066 +0100
+++ xfs/fs/xfs/xfs_mount.c	2009-03-18 07:37:20.566978952 +0100
@@ -651,7 +651,6 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb
 	mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
 	mp->m_agno_log = xfs_highbit32(sbp->sb_agcount - 1) + 1;
 	mp->m_agino_log = sbp->sb_inopblog + sbp->sb_agblklog;
-	mp->m_litino = sbp->sb_inodesize - sizeof(struct xfs_dinode);
 	mp->m_blockmask = sbp->sb_blocksize - 1;
 	mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG;
 	mp->m_blockwmask = mp->m_blockwsize - 1;
Index: xfs/fs/xfs/xfs_mount.h
===================================================================
--- xfs.orig/fs/xfs/xfs_mount.h	2009-03-18 07:37:16.077856262 +0100
+++ xfs/fs/xfs/xfs_mount.h	2009-03-18 07:37:20.585978718 +0100
@@ -203,7 +203,6 @@ typedef struct xfs_mount {
 	uint			m_attr_node_ents; /* #entries in attr danode */
 	int			m_ialloc_inos;	/* inodes in inode allocation */
 	int			m_ialloc_blks;	/* blocks in inode allocation */
-	int			m_litino;	/* size of inode union area */
 	int			m_inoalign_mask;/* mask sb_inoalignmt if used */
 	uint			m_qflags;	/* quota status flags */
 	xfs_trans_reservations_t m_reservations;/* precomputed res values */

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 5/5] xfs: remove m_attroffset
  2009-03-18  9:41 [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
                   ` (3 preceding siblings ...)
  2009-03-18  9:41 ` [PATCH 4/5] xfs: remove m_litino Christoph Hellwig
@ 2009-03-18  9:41 ` Christoph Hellwig
  2009-03-26 19:42   ` Josef 'Jeff' Sipek
  2009-04-06 22:11   ` Felix Blyakher
  2009-03-29  9:28 ` [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
  5 siblings, 2 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-18  9:41 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-xfs_default_attroffset --]
[-- Type: text/plain, Size: 7111 bytes --]

With the upcoming v3 inodes the default attroffset needs to be calculated
for each specific inode, so we can't cache it in the superblock anymore.

Also replace the assert for wrong inode sizes with a proper error check
also included in non-debug builds.  Note that the ENOSYS retourn for
that might seem odd, but that error is returned by xfs_mount_validate_sb
for all theoretically valid but not supported filesystem geometries.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_mount.c
===================================================================
--- xfs.orig/fs/xfs/xfs_mount.c	2009-03-18 07:37:20.566978952 +0100
+++ xfs/fs/xfs/xfs_mount.c	2009-03-18 07:47:49.573979000 +0100
@@ -333,6 +333,22 @@ xfs_mount_validate_sb(
 		return XFS_ERROR(ENOSYS);
 	}
 
+	/*
+	 * Currently only very few inode sizes are supported.
+	 */
+	switch (sbp->sb_inodesize) {
+	case 256:
+	case 512:
+	case 1024:
+	case 2048:
+		break;
+	default:
+		xfs_fs_mount_cmn_err(flags,
+			"inode size of %d bytes not supported",
+			sbp->sb_inodesize);
+		return XFS_ERROR(ENOSYS);
+	}
+
 	if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) ||
 	    xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) {
 		xfs_fs_mount_cmn_err(flags,
@@ -655,27 +671,6 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb
 	mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG;
 	mp->m_blockwmask = mp->m_blockwsize - 1;
 
-	/*
-	 * Setup for attributes, in case they get created.
-	 * This value is for inodes getting attributes for the first time,
-	 * the per-inode value is for old attribute values.
-	 */
-	ASSERT(sbp->sb_inodesize >= 256 && sbp->sb_inodesize <= 2048);
-	switch (sbp->sb_inodesize) {
-	case 256:
-		mp->m_attroffset = XFS_LITINO(mp) -
-				   XFS_BMDR_SPACE_CALC(MINABTPTRS);
-		break;
-	case 512:
-	case 1024:
-	case 2048:
-		mp->m_attroffset = XFS_BMDR_SPACE_CALC(6 * MINABTPTRS);
-		break;
-	default:
-		ASSERT(0);
-	}
-	ASSERT(mp->m_attroffset < XFS_LITINO(mp));
-
 	mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 1);
 	mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 0);
 	mp->m_alloc_mnr[0] = mp->m_alloc_mxr[0] / 2;
Index: xfs/fs/xfs/xfs_attr_leaf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_attr_leaf.c	2009-03-18 07:37:20.570978763 +0100
+++ xfs/fs/xfs/xfs_attr_leaf.c	2009-03-18 07:37:23.768978423 +0100
@@ -155,7 +155,8 @@ xfs_attr_shortform_bytesfit(xfs_inode_t 
 		 * minimum offset only needs to be the space required for 
 		 * the btree root.
 		 */ 
-		if (!dp->i_d.di_forkoff && dp->i_df.if_bytes > mp->m_attroffset)
+		if (!dp->i_d.di_forkoff && dp->i_df.if_bytes >
+		    xfs_default_attroffset(dp))
 			dsize = XFS_BMDR_SPACE_CALC(MINDBTPTRS);
 		break;
 		
Index: xfs/fs/xfs/xfs_bmap.c
===================================================================
--- xfs.orig/fs/xfs/xfs_bmap.c	2009-03-18 07:37:20.575978772 +0100
+++ xfs/fs/xfs/xfs_bmap.c	2009-03-18 07:37:23.770978468 +0100
@@ -3569,6 +3569,27 @@ xfs_bmap_extents_to_btree(
 }
 
 /*
+ * Calculate the default attribute fork offset for newly created inodes.
+ */
+uint
+xfs_default_attroffset(
+	struct xfs_inode	*ip)
+{
+	struct xfs_mount	*mp = ip->i_mount;
+	uint			offset;
+
+	if (mp->m_sb.sb_inodesize == 256) {
+		offset = XFS_LITINO(mp) -
+				XFS_BMDR_SPACE_CALC(MINABTPTRS);
+	} else {
+		offset = XFS_BMDR_SPACE_CALC(6 * MINABTPTRS);
+	}
+
+	ASSERT(offset < XFS_LITINO(mp));
+	return offset;
+}
+
+/*
  * Helper routine to reset inode di_forkoff field when switching
  * attribute fork from local to extent format - we reset it where
  * possible to make space available for inline data fork extents.
@@ -3580,15 +3601,18 @@ xfs_bmap_forkoff_reset(
 	int		whichfork)
 {
 	if (whichfork == XFS_ATTR_FORK &&
-	    (ip->i_d.di_format != XFS_DINODE_FMT_DEV) &&
-	    (ip->i_d.di_format != XFS_DINODE_FMT_UUID) &&
-	    (ip->i_d.di_format != XFS_DINODE_FMT_BTREE) &&
-	    ((mp->m_attroffset >> 3) > ip->i_d.di_forkoff)) {
-		ip->i_d.di_forkoff = mp->m_attroffset >> 3;
-		ip->i_df.if_ext_max = XFS_IFORK_DSIZE(ip) /
-					(uint)sizeof(xfs_bmbt_rec_t);
-		ip->i_afp->if_ext_max = XFS_IFORK_ASIZE(ip) /
-					(uint)sizeof(xfs_bmbt_rec_t);
+	    ip->i_d.di_format != XFS_DINODE_FMT_DEV &&
+	    ip->i_d.di_format != XFS_DINODE_FMT_UUID &&
+	    ip->i_d.di_format != XFS_DINODE_FMT_BTREE) {
+		uint	dfl_forkoff = xfs_default_attroffset(ip) >> 3;
+
+		if (dfl_forkoff > ip->i_d.di_forkoff) {
+			ip->i_d.di_forkoff = dfl_forkoff;
+			ip->i_df.if_ext_max =
+				XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t);
+			ip->i_afp->if_ext_max =
+				XFS_IFORK_ASIZE(ip) / sizeof(xfs_bmbt_rec_t);
+		}
 	}
 }
 
@@ -4057,7 +4081,7 @@ xfs_bmap_add_attrfork(
 	case XFS_DINODE_FMT_BTREE:
 		ip->i_d.di_forkoff = xfs_attr_shortform_bytesfit(ip, size);
 		if (!ip->i_d.di_forkoff)
-			ip->i_d.di_forkoff = mp->m_attroffset >> 3;
+			ip->i_d.di_forkoff = xfs_default_attroffset(ip) >> 3;
 		else if (mp->m_flags & XFS_MOUNT_ATTR2)
 			version = 2;
 		break;
@@ -4204,12 +4228,12 @@ xfs_bmap_compute_maxlevels(
 	 * (a signed 16-bit number, xfs_aextnum_t).
 	 *
 	 * Note that we can no longer assume that if we are in ATTR1 that
-	 * the fork offset of all the inodes will be (m_attroffset >> 3)
-	 * because we could have mounted with ATTR2 and then mounted back
-	 * with ATTR1, keeping the di_forkoff's fixed but probably at
-	 * various positions. Therefore, for both ATTR1 and ATTR2
-	 * we have to assume the worst case scenario of a minimum size
-	 * available.
+	 * the fork offset of all the inodes will be
+	 * (xfs_default_attroffset(ip) >> 3) because we could have mounted
+	 * with ATTR2 and then mounted back with ATTR1, keeping the
+	 * di_forkoff's fixed but probably at various positions. Therefore,
+	 * for both ATTR1 and ATTR2 we have to assume the worst case scenario
+	 * of a minimum size available.
 	 */
 	if (whichfork == XFS_DATA_FORK) {
 		maxleafents = MAXEXTNUM;
Index: xfs/fs/xfs/xfs_bmap.h
===================================================================
--- xfs.orig/fs/xfs/xfs_bmap.h	2009-03-18 07:37:20.579979142 +0100
+++ xfs/fs/xfs/xfs_bmap.h	2009-03-18 07:37:23.772979002 +0100
@@ -338,6 +338,10 @@ xfs_check_nostate_extents(
 	xfs_extnum_t		idx,
 	xfs_extnum_t		num);
 
+uint
+xfs_default_attroffset(
+	struct xfs_inode	*ip);
+
 #ifdef __KERNEL__
 
 /*
Index: xfs/fs/xfs/xfs_mount.h
===================================================================
--- xfs.orig/fs/xfs/xfs_mount.h	2009-03-18 07:37:20.585978718 +0100
+++ xfs/fs/xfs/xfs_mount.h	2009-03-18 07:37:23.772979002 +0100
@@ -198,7 +198,6 @@ typedef struct xfs_mount {
 	int			m_fixedfsid[2];	/* unchanged for life of FS */
 	uint			m_dmevmask;	/* DMI events for this FS */
 	__uint64_t		m_flags;	/* global mount flags */
-	uint			m_attroffset;	/* inode attribute offset */
 	uint			m_dir_node_ents; /* #entries in a dir danode */
 	uint			m_attr_node_ents; /* #entries in attr danode */
 	int			m_ialloc_inos;	/* inodes in inode allocation */

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 2/5] xfs: kill mutex_t typedef
  2009-03-18  9:41 ` [PATCH 2/5] xfs: kill mutex_t typedef Christoph Hellwig
@ 2009-03-21  3:51   ` Eric Sandeen
  2009-03-26 22:31   ` Felix Blyakher
  1 sibling, 0 replies; 25+ messages in thread
From: Eric Sandeen @ 2009-03-21  3:51 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:

(argh quilt sending attachments)

Anyway

Reviewed-by: Eric Sandeen <sandeen@sandeen.net>

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 3/5] xfs: kill ino64 mount option
  2009-03-18  9:41 ` [PATCH 3/5] xfs: kill ino64 mount option Christoph Hellwig
@ 2009-03-21  3:54   ` Eric Sandeen
  2009-03-21 20:08     ` Christoph Hellwig
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Sandeen @ 2009-03-21  3:54 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:

> The ino64 mount option adds a fixed offset to 32bit inode numbers
> to bring them into the 64bit range.  There's no need for this kind
> of debug tool given that it's easy to produce real 64bit inode numbers
> for testing.

hm, easy how?

Change seems fien though.

Reviewed-by: Eric Sandeen <sandeen@sandeen.net>

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 4/5] xfs: remove m_litino
  2009-03-18  9:41 ` [PATCH 4/5] xfs: remove m_litino Christoph Hellwig
@ 2009-03-21  3:57   ` Eric Sandeen
  2009-03-21 20:09     ` Christoph Hellwig
  2009-03-26 22:41   ` Felix Blyakher
  1 sibling, 1 reply; 25+ messages in thread
From: Eric Sandeen @ 2009-03-21  3:57 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:

> With the upcoming v3 inodes the inode data/attr area size needs to be
> calculated for each specific inode, so we can't cache it in the superblock
> anymore.

hm, ok, but why do this now?

-Eric

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 3/5] xfs: kill ino64 mount option
  2009-03-21  3:54   ` Eric Sandeen
@ 2009-03-21 20:08     ` Christoph Hellwig
  2009-03-21 22:12       ` Eric Sandeen
  0 siblings, 1 reply; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-21 20:08 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Christoph Hellwig, xfs

On Fri, Mar 20, 2009 at 10:54:51PM -0500, Eric Sandeen wrote:
> Christoph Hellwig wrote:
> 
> > The ino64 mount option adds a fixed offset to 32bit inode numbers
> > to bring them into the 64bit range.  There's no need for this kind
> > of debug tool given that it's easy to produce real 64bit inode numbers
> > for testing.
> 
> hm, easy how?

Actually test with a large enough device and let them spread evenly
over the AGs.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 4/5] xfs: remove m_litino
  2009-03-21  3:57   ` Eric Sandeen
@ 2009-03-21 20:09     ` Christoph Hellwig
  0 siblings, 0 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-21 20:09 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Christoph Hellwig, xfs

On Fri, Mar 20, 2009 at 10:57:32PM -0500, Eric Sandeen wrote:
> Christoph Hellwig wrote:
> 
> > With the upcoming v3 inodes the inode data/attr area size needs to be
> > calculated for each specific inode, so we can't cache it in the superblock
> > anymore.
> 
> hm, ok, but why do this now?

It could be considered a cleanup as there's no point in caching a
constant expression in the superblock.  More importantly I want to get
as many of the CRC preparation patches upstream so that I don't have
to keep rebasing them.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 3/5] xfs: kill ino64 mount option
  2009-03-21 20:08     ` Christoph Hellwig
@ 2009-03-21 22:12       ` Eric Sandeen
  2009-03-24  8:30         ` Dave Chinner
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Sandeen @ 2009-03-21 22:12 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:
> On Fri, Mar 20, 2009 at 10:54:51PM -0500, Eric Sandeen wrote:
>> Christoph Hellwig wrote:
>>
>>> The ino64 mount option adds a fixed offset to 32bit inode numbers
>>> to bring them into the 64bit range.  There's no need for this kind
>>> of debug tool given that it's easy to produce real 64bit inode numbers
>>> for testing.
>> hm, easy how?
> 
> Actually test with a large enough device and let them spread evenly
> over the AGs.

It's the large-enough device which sometimes is at odds with "easy"

-Eric

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 3/5] xfs: kill ino64 mount option
  2009-03-21 22:12       ` Eric Sandeen
@ 2009-03-24  8:30         ` Dave Chinner
  2009-03-24 13:11           ` Eric Sandeen
  0 siblings, 1 reply; 25+ messages in thread
From: Dave Chinner @ 2009-03-24  8:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Christoph Hellwig, xfs

On Sat, Mar 21, 2009 at 05:12:32PM -0500, Eric Sandeen wrote:
> Christoph Hellwig wrote:
> > On Fri, Mar 20, 2009 at 10:54:51PM -0500, Eric Sandeen wrote:
> >> Christoph Hellwig wrote:
> >>
> >>> The ino64 mount option adds a fixed offset to 32bit inode numbers
> >>> to bring them into the 64bit range.  There's no need for this kind
> >>> of debug tool given that it's easy to produce real 64bit inode numbers
> >>> for testing.
> >> hm, easy how?
> > 
> > Actually test with a large enough device and let them spread evenly
> > over the AGs.
> 
> It's the large-enough device which sometimes is at odds with "easy"

Sparse loopback image.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 3/5] xfs: kill ino64 mount option
  2009-03-24  8:30         ` Dave Chinner
@ 2009-03-24 13:11           ` Eric Sandeen
  2009-03-26 22:37             ` Felix Blyakher
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Sandeen @ 2009-03-24 13:11 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Christoph Hellwig, xfs@oss.sgi.com



On Mar 24, 2009, at 3:30 AM, Dave Chinner <david@fromorbit.com> wrote:

> On Sat, Mar 21, 2009 at 05:12:32PM -0500, Eric Sandeen wrote:
>> Christoph Hellwig wrote:
>>> On Fri, Mar 20, 2009 at 10:54:51PM -0500, Eric Sandeen wrote:
>>>> Christoph Hellwig wrote:
>>>>
>>>>> The ino64 mount option adds a fixed offset to 32bit inode numbers
>>>>> to bring them into the 64bit range.  There's no need for this kind
>>>>> of debug tool given that it's easy to produce real 64bit inode  
>>>>> numbers
>>>>> for testing.
>>>> hm, easy how?
>>>
>>> Actually test with a large enough device and let them spread evenly
>>> over the AGs.
>>
>> It's the large-enough device which sometimes is at odds with "easy"
>
> Sparse loopback image

OK I'm sold...

Eric

>
> Cheers,
>
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
>

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 5/5] xfs: remove m_attroffset
  2009-03-18  9:41 ` [PATCH 5/5] xfs: remove m_attroffset Christoph Hellwig
@ 2009-03-26 19:42   ` Josef 'Jeff' Sipek
  2009-03-29  7:50     ` Christoph Hellwig
  2009-04-06 22:11   ` Felix Blyakher
  1 sibling, 1 reply; 25+ messages in thread
From: Josef 'Jeff' Sipek @ 2009-03-26 19:42 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Wed, Mar 18, 2009 at 05:41:24AM -0400, Christoph Hellwig wrote:
> With the upcoming v3 inodes the default attroffset needs to be calculated
> for each specific inode, so we can't cache it in the superblock anymore.
> 
> Also replace the assert for wrong inode sizes with a proper error check
> also included in non-debug builds.  Note that the ENOSYS retourn for
                                                           ^^^^^^^

Typo.

Otherwise it makes sense.

Josef 'Jeff' Sipek.

P.S. feel free to consider this an acked-by

-- 
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.
		- George Bernard Shaw

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 2/5] xfs: kill mutex_t typedef
  2009-03-18  9:41 ` [PATCH 2/5] xfs: kill mutex_t typedef Christoph Hellwig
  2009-03-21  3:51   ` Eric Sandeen
@ 2009-03-26 22:31   ` Felix Blyakher
  1 sibling, 0 replies; 25+ messages in thread
From: Felix Blyakher @ 2009-03-26 22:31 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Mar 18, 2009, at 4:41 AM, Christoph Hellwig wrote:

> People continue to complain about this for weird reasons, but there's
> really no point in keeping this typedef for a couple of users anyway.

Yeah, linux community seems to shy away from type_t's in favor of
'struct type'.

Reviewed-by: Felix Blyakher <felixb@sgi.com>


> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
>
> Index: xfs/fs/xfs/linux-2.6/mutex.h
> ===================================================================
> --- xfs.orig/fs/xfs/linux-2.6/mutex.h	2009-02-24 21:01:18.877182725  
> +0100
> +++ /dev/null	1970-01-01 00:00:00.000000000 +0000
> @@ -1,25 +0,0 @@
> -/*
> - * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
> - * All Rights Reserved.
> - *
> - * This program 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.
> - *
> - * This program is distributed in the hope that it would 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 the Free Software  
> Foundation,
> - * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> - */
> -#ifndef __XFS_SUPPORT_MUTEX_H__
> -#define __XFS_SUPPORT_MUTEX_H__
> -
> -#include <linux/mutex.h>
> -
> -typedef struct mutex mutex_t;
> -
> -#endif /* __XFS_SUPPORT_MUTEX_H__ */
> Index: xfs/fs/xfs/linux-2.6/xfs_linux.h
> ===================================================================
> --- xfs.orig/fs/xfs/linux-2.6/xfs_linux.h	2009-02-24  
> 21:01:34.596153088 +0100
> +++ xfs/fs/xfs/linux-2.6/xfs_linux.h	2009-02-24 21:01:47.951030927  
> +0100
> @@ -38,7 +38,6 @@
> #include <kmem.h>
> #include <mrlock.h>
> #include <sv.h>
> -#include <mutex.h>
> #include <time.h>
>
> #include <support/ktrace.h>
> @@ -51,6 +50,7 @@
> #include <linux/blkdev.h>
> #include <linux/slab.h>
> #include <linux/module.h>
> +#include <linux/mutex.h>
> #include <linux/file.h>
> #include <linux/swap.h>
> #include <linux/errno.h>
> Index: xfs/fs/xfs/quota/xfs_dquot.h
> ===================================================================
> --- xfs.orig/fs/xfs/quota/xfs_dquot.h	2009-02-24 20:59:24.413152831  
> +0100
> +++ xfs/fs/xfs/quota/xfs_dquot.h	2009-02-24 20:59:39.642153943 +0100
> @@ -34,7 +34,7 @@
>  */
> typedef struct xfs_dqhash {
> 	struct xfs_dquot *qh_next;
> -	mutex_t		  qh_lock;
> +	struct mutex	  qh_lock;
> 	uint		  qh_version;	/* ever increasing version */
> 	uint		  qh_nelems;	/* number of dquots on the list */
> } xfs_dqhash_t;
> @@ -81,7 +81,7 @@ typedef struct xfs_dquot {
> 	xfs_qcnt_t	 q_res_bcount;	/* total regular nblks used+reserved */
> 	xfs_qcnt_t	 q_res_icount;	/* total inos allocd+reserved */
> 	xfs_qcnt_t	 q_res_rtbcount;/* total realtime blks used+reserved */
> -	mutex_t		 q_qlock;	/* quota lock */
> +	struct mutex	 q_qlock;	/* quota lock */
> 	struct completion q_flush;	/* flush completion queue */
> 	atomic_t          q_pincount;	/* dquot pin count */
> 	wait_queue_head_t q_pinwait;	/* dquot pinning wait queue */
> Index: xfs/fs/xfs/quota/xfs_qm.c
> ===================================================================
> --- xfs.orig/fs/xfs/quota/xfs_qm.c	2009-02-24 21:00:11.195028215 +0100
> +++ xfs/fs/xfs/quota/xfs_qm.c	2009-02-24 21:00:30.583030096 +0100
> @@ -55,7 +55,7 @@
>  * quota functionality, including maintaining the freelist and hash
>  * tables of dquots.
>  */
> -mutex_t		xfs_Gqm_lock;
> +struct mutex	xfs_Gqm_lock;
> struct xfs_qm	*xfs_Gqm;
> uint		ndquot;
>
> @@ -80,7 +80,7 @@ static struct shrinker xfs_qm_shaker = {
> };
>
> #ifdef DEBUG
> -extern mutex_t	qcheck_lock;
> +extern struct mutex	qcheck_lock;
> #endif
>
> #ifdef QUOTADEBUG
> Index: xfs/fs/xfs/quota/xfs_qm.h
> ===================================================================
> --- xfs.orig/fs/xfs/quota/xfs_qm.h	2009-02-24 21:00:11.207028206 +0100
> +++ xfs/fs/xfs/quota/xfs_qm.h	2009-02-24 21:00:52.676027690 +0100
> @@ -27,7 +27,7 @@ struct xfs_qm;
> struct xfs_inode;
>
> extern uint		ndquot;
> -extern mutex_t		xfs_Gqm_lock;
> +extern struct mutex	xfs_Gqm_lock;
> extern struct xfs_qm	*xfs_Gqm;
> extern kmem_zone_t	*qm_dqzone;
> extern kmem_zone_t	*qm_dqtrxzone;
> @@ -79,7 +79,7 @@ typedef xfs_dqhash_t	xfs_dqlist_t;
> typedef struct xfs_frlist {
>        struct xfs_dquot *qh_next;
>        struct xfs_dquot *qh_prev;
> -       mutex_t		 qh_lock;
> +       struct mutex	 qh_lock;
>        uint		 qh_version;
>        uint		 qh_nelems;
> } xfs_frlist_t;
> @@ -115,7 +115,7 @@ typedef struct xfs_quotainfo {
> 	xfs_qwarncnt_t	 qi_bwarnlimit;	 /* limit for blks warnings */
> 	xfs_qwarncnt_t	 qi_iwarnlimit;	 /* limit for inodes warnings */
> 	xfs_qwarncnt_t	 qi_rtbwarnlimit;/* limit for rt blks warnings */
> -	mutex_t		 qi_quotaofflock;/* to serialize quotaoff */
> +	struct mutex	 qi_quotaofflock;/* to serialize quotaoff */
> 	xfs_filblks_t	 qi_dqchunklen;	 /* # BBs in a chunk of dqs */
> 	uint		 qi_dqperchunk;	 /* # ondisk dqs in above chunk */
> 	xfs_qcnt_t	 qi_bhardlimit;	 /* default data blk hard limit */
> Index: xfs/fs/xfs/quota/xfs_qm_syscalls.c
> ===================================================================
> --- xfs.orig/fs/xfs/quota/xfs_qm_syscalls.c	2009-02-24  
> 21:01:03.015027884 +0100
> +++ xfs/fs/xfs/quota/xfs_qm_syscalls.c	2009-02-24 21:01:11.159155659  
> +0100
> @@ -960,7 +960,7 @@ xfs_dqhash_t *qmtest_udqtab;
> xfs_dqhash_t *qmtest_gdqtab;
> int	      qmtest_hashmask;
> int	      qmtest_nfails;
> -mutex_t	      qcheck_lock;
> +struct mutex  qcheck_lock;
>
> #define DQTEST_HASHVAL(mp, id) (((__psunsigned_t)(mp) + \
> 				 (__psunsigned_t)(id)) & \
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 3/5] xfs: kill ino64 mount option
  2009-03-24 13:11           ` Eric Sandeen
@ 2009-03-26 22:37             ` Felix Blyakher
  0 siblings, 0 replies; 25+ messages in thread
From: Felix Blyakher @ 2009-03-26 22:37 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Christoph Hellwig, xfs@oss.sgi.com

On Mar 24, 2009, at 8:11 AM, Eric Sandeen wrote:

>
>
> On Mar 24, 2009, at 3:30 AM, Dave Chinner <david@fromorbit.com> wrote:
>
>> On Sat, Mar 21, 2009 at 05:12:32PM -0500, Eric Sandeen wrote:
>>> Christoph Hellwig wrote:
>>>> On Fri, Mar 20, 2009 at 10:54:51PM -0500, Eric Sandeen wrote:
>>>>> Christoph Hellwig wrote:
>>>>>
>>>>>> The ino64 mount option adds a fixed offset to 32bit inode numbers
>>>>>> to bring them into the 64bit range.  There's no need for this  
>>>>>> kind
>>>>>> of debug tool given that it's easy to produce real 64bit inode  
>>>>>> numbers
>>>>>> for testing.
>>>>> hm, easy how?
>>>>
>>>> Actually test with a large enough device and let them spread evenly
>>>> over the AGs.
>>>
>>> It's the large-enough device which sometimes is at odds with "easy"
>>
>> Sparse loopback image
>
> OK I'm sold...

That addressed my concern too.

Reviewed-by: Felix Blyakher <felixb@sgi.com>

>
>
> Eric
>
>>
>> Cheers,
>>
>> Dave.
>> -- 
>> Dave Chinner
>> david@fromorbit.com
>>
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 4/5] xfs: remove m_litino
  2009-03-18  9:41 ` [PATCH 4/5] xfs: remove m_litino Christoph Hellwig
  2009-03-21  3:57   ` Eric Sandeen
@ 2009-03-26 22:41   ` Felix Blyakher
  2009-03-29  7:48     ` Christoph Hellwig
  1 sibling, 1 reply; 25+ messages in thread
From: Felix Blyakher @ 2009-03-26 22:41 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs


On Mar 18, 2009, at 4:41 AM, Christoph Hellwig wrote:

> With the upcoming v3 inodes the inode data/attr area size needs to be
> calculated for each specific inode, so we can't cache it in the  
> superblock
> anymore.

The change looks fine. But what is "v3 inodes"? I'm sure it's been
mentioned on the list, I'm just missing the history.

Reviewed-by: Felix Blyakher <felixb@sgi.com>

>
>
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: xfs/fs/xfs/xfs_dinode.h
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_dinode.h	2009-02-19 20:44:20.755069389 +0100
> +++ xfs/fs/xfs/xfs_dinode.h	2009-03-18 07:37:16.652977839 +0100
> @@ -103,7 +103,9 @@ typedef enum xfs_dinode_fmt {
> /*
>  * Inode size for given fs.
>  */
> -#define	XFS_LITINO(mp)	((mp)->m_litino)
> +#define XFS_LITINO(mp) \
> +	((int)(((mp)->m_sb.sb_inodesize) - sizeof(struct xfs_dinode)))
> +
> #define	XFS_BROOT_SIZE_ADJ	\
> 	(XFS_BTREE_LBLOCK_LEN - sizeof(xfs_bmdr_block_t))
>
> Index: xfs/fs/xfs/xfs_mount.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_mount.c	2009-03-18 07:37:15.633978066 +0100
> +++ xfs/fs/xfs/xfs_mount.c	2009-03-18 07:37:20.566978952 +0100
> @@ -651,7 +651,6 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb
> 	mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
> 	mp->m_agno_log = xfs_highbit32(sbp->sb_agcount - 1) + 1;
> 	mp->m_agino_log = sbp->sb_inopblog + sbp->sb_agblklog;
> -	mp->m_litino = sbp->sb_inodesize - sizeof(struct xfs_dinode);
> 	mp->m_blockmask = sbp->sb_blocksize - 1;
> 	mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG;
> 	mp->m_blockwmask = mp->m_blockwsize - 1;
> Index: xfs/fs/xfs/xfs_mount.h
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_mount.h	2009-03-18 07:37:16.077856262 +0100
> +++ xfs/fs/xfs/xfs_mount.h	2009-03-18 07:37:20.585978718 +0100
> @@ -203,7 +203,6 @@ typedef struct xfs_mount {
> 	uint			m_attr_node_ents; /* #entries in attr danode */
> 	int			m_ialloc_inos;	/* inodes in inode allocation */
> 	int			m_ialloc_blks;	/* blocks in inode allocation */
> -	int			m_litino;	/* size of inode union area */
> 	int			m_inoalign_mask;/* mask sb_inoalignmt if used */
> 	uint			m_qflags;	/* quota status flags */
> 	xfs_trans_reservations_t m_reservations;/* precomputed res values */
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 1/5] xfs: cleanup uuid handling
  2009-03-18  9:41 ` [PATCH 1/5] xfs: cleanup uuid handling Christoph Hellwig
@ 2009-03-29  7:45   ` Christoph Hellwig
  2009-03-30  6:06   ` Felix Blyakher
  1 sibling, 0 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-29  7:45 UTC (permalink / raw)
  To: xfs

ping?

On Wed, Mar 18, 2009 at 05:41:20AM -0400, Christoph Hellwig wrote:
> The uuid table handling should not be part of a semi-generic uuid library
> but in the XFS code using it, so move those bits to xfs_mount.c and
> refactor the whole glob to give a proper abstraction.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: xfs/fs/xfs/support/uuid.c
> ===================================================================
> --- xfs.orig/fs/xfs/support/uuid.c	2009-02-15 19:40:08.564944522 +0100
> +++ xfs/fs/xfs/support/uuid.c	2009-02-24 21:50:49.051029140 +0100
> @@ -17,10 +17,6 @@
>   */
>  #include <xfs.h>
>  
> -static DEFINE_MUTEX(uuid_monitor);
> -static int	uuid_table_size;
> -static uuid_t	*uuid_table;
> -
>  /* IRIX interpretation of an uuid_t */
>  typedef struct {
>  	__be32	uu_timelow;
> @@ -46,12 +42,6 @@ uuid_getnodeuniq(uuid_t *uuid, int fsid 
>  	fsid[1] = be32_to_cpu(uup->uu_timelow);
>  }
>  
> -void
> -uuid_create_nil(uuid_t *uuid)
> -{
> -	memset(uuid, 0, sizeof(*uuid));
> -}
> -
>  int
>  uuid_is_nil(uuid_t *uuid)
>  {
> @@ -71,64 +61,3 @@ uuid_equal(uuid_t *uuid1, uuid_t *uuid2)
>  {
>  	return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? 0 : 1;
>  }
> -
> -/*
> - * Given a 128-bit uuid, return a 64-bit value by adding the top and bottom
> - * 64-bit words.  NOTE: This function can not be changed EVER.  Although
> - * brain-dead, some applications depend on this 64-bit value remaining
> - * persistent.  Specifically, DMI vendors store the value as a persistent
> - * filehandle.
> - */
> -__uint64_t
> -uuid_hash64(uuid_t *uuid)
> -{
> -	__uint64_t	*sp = (__uint64_t *)uuid;
> -
> -	return sp[0] + sp[1];
> -}
> -
> -int
> -uuid_table_insert(uuid_t *uuid)
> -{
> -	int	i, hole;
> -
> -	mutex_lock(&uuid_monitor);
> -	for (i = 0, hole = -1; i < uuid_table_size; i++) {
> -		if (uuid_is_nil(&uuid_table[i])) {
> -			hole = i;
> -			continue;
> -		}
> -		if (uuid_equal(uuid, &uuid_table[i])) {
> -			mutex_unlock(&uuid_monitor);
> -			return 0;
> -		}
> -	}
> -	if (hole < 0) {
> -		uuid_table = kmem_realloc(uuid_table,
> -			(uuid_table_size + 1) * sizeof(*uuid_table),
> -			uuid_table_size  * sizeof(*uuid_table),
> -			KM_SLEEP);
> -		hole = uuid_table_size++;
> -	}
> -	uuid_table[hole] = *uuid;
> -	mutex_unlock(&uuid_monitor);
> -	return 1;
> -}
> -
> -void
> -uuid_table_remove(uuid_t *uuid)
> -{
> -	int	i;
> -
> -	mutex_lock(&uuid_monitor);
> -	for (i = 0; i < uuid_table_size; i++) {
> -		if (uuid_is_nil(&uuid_table[i]))
> -			continue;
> -		if (!uuid_equal(uuid, &uuid_table[i]))
> -			continue;
> -		uuid_create_nil(&uuid_table[i]);
> -		break;
> -	}
> -	ASSERT(i < uuid_table_size);
> -	mutex_unlock(&uuid_monitor);
> -}
> Index: xfs/fs/xfs/support/uuid.h
> ===================================================================
> --- xfs.orig/fs/xfs/support/uuid.h	2009-02-15 19:40:08.569944670 +0100
> +++ xfs/fs/xfs/support/uuid.h	2009-02-24 21:50:37.206029255 +0100
> @@ -22,12 +22,8 @@ typedef struct {
>  	unsigned char	__u_bits[16];
>  } uuid_t;
>  
> -extern void uuid_create_nil(uuid_t *uuid);
>  extern int uuid_is_nil(uuid_t *uuid);
>  extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2);
>  extern void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]);
> -extern __uint64_t uuid_hash64(uuid_t *uuid);
> -extern int uuid_table_insert(uuid_t *uuid);
> -extern void uuid_table_remove(uuid_t *uuid);
>  
>  #endif	/* __XFS_SUPPORT_UUID_H__ */
> Index: xfs/fs/xfs/xfs_mount.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_mount.c	2009-02-24 15:32:35.871518446 +0100
> +++ xfs/fs/xfs/xfs_mount.c	2009-02-24 21:51:03.558027729 +0100
> @@ -45,7 +45,6 @@
>  #include "xfs_fsops.h"
>  #include "xfs_utils.h"
>  
> -STATIC int	xfs_uuid_mount(xfs_mount_t *);
>  STATIC void	xfs_unmountfs_wait(xfs_mount_t *);
>  
>  
> @@ -121,6 +120,84 @@ static const struct {
>      { sizeof(xfs_sb_t),			 0 }
>  };
>  
> +static DEFINE_MUTEX(xfs_uuid_table_mutex);
> +static int xfs_uuid_table_size;
> +static uuid_t *xfs_uuid_table;
> +
> +/*
> + * See if the UUID is unique among mounted XFS filesystems.
> + * Mount fails if UUID is nil or a FS with the same UUID is already mounted.
> + */
> +STATIC int
> +xfs_uuid_mount(
> +	struct xfs_mount	*mp)
> +{
> +	uuid_t			*uuid = &mp->m_sb.sb_uuid;
> +	int			hole, i;
> +
> +	if (mp->m_flags & XFS_MOUNT_NOUUID)
> +		return 0;
> +
> +	if (uuid_is_nil(uuid)) {
> +		cmn_err(CE_WARN,
> +			"XFS: Filesystem %s has nil UUID - can't mount",
> +			mp->m_fsname);
> +		return XFS_ERROR(EINVAL);
> +	}
> +
> +	mutex_lock(&xfs_uuid_table_mutex);
> +	for (i = 0, hole = -1; i < xfs_uuid_table_size; i++) {
> +		if (uuid_is_nil(&xfs_uuid_table[i])) {
> +			hole = i;
> +			continue;
> +		}
> +		if (uuid_equal(uuid, &xfs_uuid_table[i]))
> +			goto out_duplicate;
> +	}
> +
> +	if (hole < 0) {
> +		xfs_uuid_table = kmem_realloc(xfs_uuid_table,
> +			(xfs_uuid_table_size + 1) * sizeof(*xfs_uuid_table),
> +			xfs_uuid_table_size  * sizeof(*xfs_uuid_table),
> +			KM_SLEEP);
> +		hole = xfs_uuid_table_size++;
> +	}
> +	xfs_uuid_table[hole] = *uuid;
> +	mutex_unlock(&xfs_uuid_table_mutex);
> +
> +	return 0;
> +
> + out_duplicate:
> +	mutex_unlock(&xfs_uuid_table_mutex);
> +	cmn_err(CE_WARN, "XFS: Filesystem %s has duplicate UUID - can't mount",
> +			 mp->m_fsname);
> +	return XFS_ERROR(EINVAL);
> +}
> +
> +STATIC void
> +xfs_uuid_unmount(
> +	struct xfs_mount	*mp)
> +{
> +	uuid_t			*uuid = &mp->m_sb.sb_uuid;
> +	int			i;
> +
> +	if (mp->m_flags & XFS_MOUNT_NOUUID)
> +		return;
> +
> +	mutex_lock(&xfs_uuid_table_mutex);
> +	for (i = 0; i < xfs_uuid_table_size; i++) {
> +		if (uuid_is_nil(&xfs_uuid_table[i]))
> +			continue;
> +		if (!uuid_equal(uuid, &xfs_uuid_table[i]))
> +			continue;
> +		memset(&xfs_uuid_table[i], 0, sizeof(uuid_t));
> +		break;
> +	}
> +	ASSERT(i < xfs_uuid_table_size);
> +	mutex_unlock(&xfs_uuid_table_mutex);
> +}
> +
> +
>  /*
>   * Free up the resources associated with a mount structure.  Assume that
>   * the structure was initially zeroed, so we can tell which fields got
> @@ -1016,18 +1093,9 @@ xfs_mountfs(
>  
>  	mp->m_maxioffset = xfs_max_file_offset(sbp->sb_blocklog);
>  
> -	/*
> -	 * XFS uses the uuid from the superblock as the unique
> -	 * identifier for fsid.  We can not use the uuid from the volume
> -	 * since a single partition filesystem is identical to a single
> -	 * partition volume/filesystem.
> -	 */
> -	if (!(mp->m_flags & XFS_MOUNT_NOUUID)) {
> -		if (xfs_uuid_mount(mp)) {
> -			error = XFS_ERROR(EINVAL);
> -			goto out;
> -		}
> -	}
> +	error = xfs_uuid_mount(mp);
> +	if (error)
> +		goto out;
>  
>  	/*
>  	 * Set the minimum read and write sizes
> @@ -1275,8 +1343,7 @@ xfs_mountfs(
>   out_free_perag:
>  	xfs_free_perag(mp);
>   out_remove_uuid:
> -	if (!(mp->m_flags & XFS_MOUNT_NOUUID))
> -		uuid_table_remove(&mp->m_sb.sb_uuid);
> +	xfs_uuid_unmount(mp);
>   out:
>  	return error;
>  }
> @@ -1351,9 +1418,7 @@ xfs_unmountfs(
>  	xfs_unmountfs_wait(mp); 		/* wait for async bufs */
>  	xfs_log_unmount_write(mp);
>  	xfs_log_unmount(mp);
> -
> -	if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0)
> -		uuid_table_remove(&mp->m_sb.sb_uuid);
> +	xfs_uuid_unmount(mp);
>  
>  #if defined(DEBUG)
>  	xfs_errortag_clearall(mp, 0);
> @@ -1855,29 +1920,6 @@ xfs_freesb(
>  }
>  
>  /*
> - * See if the UUID is unique among mounted XFS filesystems.
> - * Mount fails if UUID is nil or a FS with the same UUID is already mounted.
> - */
> -STATIC int
> -xfs_uuid_mount(
> -	xfs_mount_t	*mp)
> -{
> -	if (uuid_is_nil(&mp->m_sb.sb_uuid)) {
> -		cmn_err(CE_WARN,
> -			"XFS: Filesystem %s has nil UUID - can't mount",
> -			mp->m_fsname);
> -		return -1;
> -	}
> -	if (!uuid_table_insert(&mp->m_sb.sb_uuid)) {
> -		cmn_err(CE_WARN,
> -			"XFS: Filesystem %s has duplicate UUID - can't mount",
> -			mp->m_fsname);
> -		return -1;
> -	}
> -	return 0;
> -}
> -
> -/*
>   * Used to log changes to the superblock unit and width fields which could
>   * be altered by the mount options, as well as any potential sb_features2
>   * fixup. Only the first superblock is updated.
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
---end quoted text---

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 4/5] xfs: remove m_litino
  2009-03-26 22:41   ` Felix Blyakher
@ 2009-03-29  7:48     ` Christoph Hellwig
  0 siblings, 0 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-29  7:48 UTC (permalink / raw)
  To: Felix Blyakher; +Cc: Christoph Hellwig, xfs

On Thu, Mar 26, 2009 at 05:41:16PM -0500, Felix Blyakher wrote:
>
> On Mar 18, 2009, at 4:41 AM, Christoph Hellwig wrote:
>
>> With the upcoming v3 inodes the inode data/attr area size needs to be
>> calculated for each specific inode, so we can't cache it in the  
>> superblock
>> anymore.
>
> The change looks fine. But what is "v3 inodes"? I'm sure it's been
> mentioned on the list, I'm just missing the history.

It's the new inode format including a crc and uuid in the CRC patches.
Because it has a larger core dinode the litoral area calculcations need
to be more dynamic.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 5/5] xfs: remove m_attroffset
  2009-03-26 19:42   ` Josef 'Jeff' Sipek
@ 2009-03-29  7:50     ` Christoph Hellwig
  0 siblings, 0 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-29  7:50 UTC (permalink / raw)
  To: Josef 'Jeff' Sipek; +Cc: Christoph Hellwig, xfs

On Thu, Mar 26, 2009 at 03:42:06PM -0400, Josef 'Jeff' Sipek wrote:
> On Wed, Mar 18, 2009 at 05:41:24AM -0400, Christoph Hellwig wrote:
> > With the upcoming v3 inodes the default attroffset needs to be calculated
> > for each specific inode, so we can't cache it in the superblock anymore.
> > 
> > Also replace the assert for wrong inode sizes with a proper error check
> > also included in non-debug builds.  Note that the ENOSYS retourn for
>                                                            ^^^^^^^
> 
> Typo.
> 
> Otherwise it makes sense.
> 
> Josef 'Jeff' Sipek.
> 
> P.S. feel free to consider this an acked-by

Acked or reviewed?  This matters as I still need a formal review for
this one..

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] A couple more patches for 2.6.30
  2009-03-18  9:41 [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
                   ` (4 preceding siblings ...)
  2009-03-18  9:41 ` [PATCH 5/5] xfs: remove m_attroffset Christoph Hellwig
@ 2009-03-29  9:28 ` Christoph Hellwig
  5 siblings, 0 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-03-29  9:28 UTC (permalink / raw)
  To: xfs

I pushed out the patches that go review, plus Hisashi Hifumi's pagecache
usage optimization and Malcolm Parsons' typo fixes to

	git://git.kernel.org/pub/scm/fs/xfs/xfs.git

I still need a couple more reviews and we also need to decide how to
pull in Dave's patches.

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 1/5] xfs: cleanup uuid handling
  2009-03-18  9:41 ` [PATCH 1/5] xfs: cleanup uuid handling Christoph Hellwig
  2009-03-29  7:45   ` Christoph Hellwig
@ 2009-03-30  6:06   ` Felix Blyakher
  1 sibling, 0 replies; 25+ messages in thread
From: Felix Blyakher @ 2009-03-30  6:06 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs


On Mar 18, 2009, at 4:41 AM, Christoph Hellwig wrote:

> The uuid table handling should not be part of a semi-generic uuid  
> library
> but in the XFS code using it, so move those bits to xfs_mount.c and
> refactor the whole glob to give a proper abstraction.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Felix Blyakher <felixb@sgi.com>

>
>
> Index: xfs/fs/xfs/support/uuid.c
> ===================================================================
> --- xfs.orig/fs/xfs/support/uuid.c	2009-02-15 19:40:08.564944522 +0100
> +++ xfs/fs/xfs/support/uuid.c	2009-02-24 21:50:49.051029140 +0100
> @@ -17,10 +17,6 @@
>  */
> #include <xfs.h>
>
> -static DEFINE_MUTEX(uuid_monitor);
> -static int	uuid_table_size;
> -static uuid_t	*uuid_table;
> -
> /* IRIX interpretation of an uuid_t */
> typedef struct {
> 	__be32	uu_timelow;
> @@ -46,12 +42,6 @@ uuid_getnodeuniq(uuid_t *uuid, int fsid
> 	fsid[1] = be32_to_cpu(uup->uu_timelow);
> }
>
> -void
> -uuid_create_nil(uuid_t *uuid)
> -{
> -	memset(uuid, 0, sizeof(*uuid));
> -}
> -
> int
> uuid_is_nil(uuid_t *uuid)
> {
> @@ -71,64 +61,3 @@ uuid_equal(uuid_t *uuid1, uuid_t *uuid2)
> {
> 	return memcmp(uuid1, uuid2, sizeof(uuid_t)) ? 0 : 1;
> }
> -
> -/*
> - * Given a 128-bit uuid, return a 64-bit value by adding the top  
> and bottom
> - * 64-bit words.  NOTE: This function can not be changed EVER.   
> Although
> - * brain-dead, some applications depend on this 64-bit value  
> remaining
> - * persistent.  Specifically, DMI vendors store the value as a  
> persistent
> - * filehandle.
> - */
> -__uint64_t
> -uuid_hash64(uuid_t *uuid)
> -{
> -	__uint64_t	*sp = (__uint64_t *)uuid;
> -
> -	return sp[0] + sp[1];
> -}
> -
> -int
> -uuid_table_insert(uuid_t *uuid)
> -{
> -	int	i, hole;
> -
> -	mutex_lock(&uuid_monitor);
> -	for (i = 0, hole = -1; i < uuid_table_size; i++) {
> -		if (uuid_is_nil(&uuid_table[i])) {
> -			hole = i;
> -			continue;
> -		}
> -		if (uuid_equal(uuid, &uuid_table[i])) {
> -			mutex_unlock(&uuid_monitor);
> -			return 0;
> -		}
> -	}
> -	if (hole < 0) {
> -		uuid_table = kmem_realloc(uuid_table,
> -			(uuid_table_size + 1) * sizeof(*uuid_table),
> -			uuid_table_size  * sizeof(*uuid_table),
> -			KM_SLEEP);
> -		hole = uuid_table_size++;
> -	}
> -	uuid_table[hole] = *uuid;
> -	mutex_unlock(&uuid_monitor);
> -	return 1;
> -}
> -
> -void
> -uuid_table_remove(uuid_t *uuid)
> -{
> -	int	i;
> -
> -	mutex_lock(&uuid_monitor);
> -	for (i = 0; i < uuid_table_size; i++) {
> -		if (uuid_is_nil(&uuid_table[i]))
> -			continue;
> -		if (!uuid_equal(uuid, &uuid_table[i]))
> -			continue;
> -		uuid_create_nil(&uuid_table[i]);
> -		break;
> -	}
> -	ASSERT(i < uuid_table_size);
> -	mutex_unlock(&uuid_monitor);
> -}
> Index: xfs/fs/xfs/support/uuid.h
> ===================================================================
> --- xfs.orig/fs/xfs/support/uuid.h	2009-02-15 19:40:08.569944670 +0100
> +++ xfs/fs/xfs/support/uuid.h	2009-02-24 21:50:37.206029255 +0100
> @@ -22,12 +22,8 @@ typedef struct {
> 	unsigned char	__u_bits[16];
> } uuid_t;
>
> -extern void uuid_create_nil(uuid_t *uuid);
> extern int uuid_is_nil(uuid_t *uuid);
> extern int uuid_equal(uuid_t *uuid1, uuid_t *uuid2);
> extern void uuid_getnodeuniq(uuid_t *uuid, int fsid [2]);
> -extern __uint64_t uuid_hash64(uuid_t *uuid);
> -extern int uuid_table_insert(uuid_t *uuid);
> -extern void uuid_table_remove(uuid_t *uuid);
>
> #endif	/* __XFS_SUPPORT_UUID_H__ */
> Index: xfs/fs/xfs/xfs_mount.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_mount.c	2009-02-24 15:32:35.871518446 +0100
> +++ xfs/fs/xfs/xfs_mount.c	2009-02-24 21:51:03.558027729 +0100
> @@ -45,7 +45,6 @@
> #include "xfs_fsops.h"
> #include "xfs_utils.h"
>
> -STATIC int	xfs_uuid_mount(xfs_mount_t *);
> STATIC void	xfs_unmountfs_wait(xfs_mount_t *);
>
>
> @@ -121,6 +120,84 @@ static const struct {
>     { sizeof(xfs_sb_t),			 0 }
> };
>
> +static DEFINE_MUTEX(xfs_uuid_table_mutex);
> +static int xfs_uuid_table_size;
> +static uuid_t *xfs_uuid_table;
> +
> +/*
> + * See if the UUID is unique among mounted XFS filesystems.
> + * Mount fails if UUID is nil or a FS with the same UUID is already  
> mounted.
> + */
> +STATIC int
> +xfs_uuid_mount(
> +	struct xfs_mount	*mp)
> +{
> +	uuid_t			*uuid = &mp->m_sb.sb_uuid;
> +	int			hole, i;
> +
> +	if (mp->m_flags & XFS_MOUNT_NOUUID)
> +		return 0;
> +
> +	if (uuid_is_nil(uuid)) {
> +		cmn_err(CE_WARN,
> +			"XFS: Filesystem %s has nil UUID - can't mount",
> +			mp->m_fsname);
> +		return XFS_ERROR(EINVAL);
> +	}
> +
> +	mutex_lock(&xfs_uuid_table_mutex);
> +	for (i = 0, hole = -1; i < xfs_uuid_table_size; i++) {
> +		if (uuid_is_nil(&xfs_uuid_table[i])) {
> +			hole = i;
> +			continue;
> +		}
> +		if (uuid_equal(uuid, &xfs_uuid_table[i]))
> +			goto out_duplicate;
> +	}
> +
> +	if (hole < 0) {
> +		xfs_uuid_table = kmem_realloc(xfs_uuid_table,
> +			(xfs_uuid_table_size + 1) * sizeof(*xfs_uuid_table),
> +			xfs_uuid_table_size  * sizeof(*xfs_uuid_table),
> +			KM_SLEEP);
> +		hole = xfs_uuid_table_size++;
> +	}
> +	xfs_uuid_table[hole] = *uuid;
> +	mutex_unlock(&xfs_uuid_table_mutex);
> +
> +	return 0;
> +
> + out_duplicate:
> +	mutex_unlock(&xfs_uuid_table_mutex);
> +	cmn_err(CE_WARN, "XFS: Filesystem %s has duplicate UUID - can't  
> mount",
> +			 mp->m_fsname);
> +	return XFS_ERROR(EINVAL);
> +}
> +
> +STATIC void
> +xfs_uuid_unmount(
> +	struct xfs_mount	*mp)
> +{
> +	uuid_t			*uuid = &mp->m_sb.sb_uuid;
> +	int			i;
> +
> +	if (mp->m_flags & XFS_MOUNT_NOUUID)
> +		return;
> +
> +	mutex_lock(&xfs_uuid_table_mutex);
> +	for (i = 0; i < xfs_uuid_table_size; i++) {
> +		if (uuid_is_nil(&xfs_uuid_table[i]))
> +			continue;
> +		if (!uuid_equal(uuid, &xfs_uuid_table[i]))
> +			continue;
> +		memset(&xfs_uuid_table[i], 0, sizeof(uuid_t));
> +		break;
> +	}
> +	ASSERT(i < xfs_uuid_table_size);
> +	mutex_unlock(&xfs_uuid_table_mutex);
> +}
> +
> +
> /*
>  * Free up the resources associated with a mount structure.  Assume  
> that
>  * the structure was initially zeroed, so we can tell which fields got
> @@ -1016,18 +1093,9 @@ xfs_mountfs(
>
> 	mp->m_maxioffset = xfs_max_file_offset(sbp->sb_blocklog);
>
> -	/*
> -	 * XFS uses the uuid from the superblock as the unique
> -	 * identifier for fsid.  We can not use the uuid from the volume
> -	 * since a single partition filesystem is identical to a single
> -	 * partition volume/filesystem.
> -	 */
> -	if (!(mp->m_flags & XFS_MOUNT_NOUUID)) {
> -		if (xfs_uuid_mount(mp)) {
> -			error = XFS_ERROR(EINVAL);
> -			goto out;
> -		}
> -	}
> +	error = xfs_uuid_mount(mp);
> +	if (error)
> +		goto out;
>
> 	/*
> 	 * Set the minimum read and write sizes
> @@ -1275,8 +1343,7 @@ xfs_mountfs(
>  out_free_perag:
> 	xfs_free_perag(mp);
>  out_remove_uuid:
> -	if (!(mp->m_flags & XFS_MOUNT_NOUUID))
> -		uuid_table_remove(&mp->m_sb.sb_uuid);
> +	xfs_uuid_unmount(mp);
>  out:
> 	return error;
> }
> @@ -1351,9 +1418,7 @@ xfs_unmountfs(
> 	xfs_unmountfs_wait(mp); 		/* wait for async bufs */
> 	xfs_log_unmount_write(mp);
> 	xfs_log_unmount(mp);
> -
> -	if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0)
> -		uuid_table_remove(&mp->m_sb.sb_uuid);
> +	xfs_uuid_unmount(mp);
>
> #if defined(DEBUG)
> 	xfs_errortag_clearall(mp, 0);
> @@ -1855,29 +1920,6 @@ xfs_freesb(
> }
>
> /*
> - * See if the UUID is unique among mounted XFS filesystems.
> - * Mount fails if UUID is nil or a FS with the same UUID is already  
> mounted.
> - */
> -STATIC int
> -xfs_uuid_mount(
> -	xfs_mount_t	*mp)
> -{
> -	if (uuid_is_nil(&mp->m_sb.sb_uuid)) {
> -		cmn_err(CE_WARN,
> -			"XFS: Filesystem %s has nil UUID - can't mount",
> -			mp->m_fsname);
> -		return -1;
> -	}
> -	if (!uuid_table_insert(&mp->m_sb.sb_uuid)) {
> -		cmn_err(CE_WARN,
> -			"XFS: Filesystem %s has duplicate UUID - can't mount",
> -			mp->m_fsname);
> -		return -1;
> -	}
> -	return 0;
> -}
> -
> -/*
>  * Used to log changes to the superblock unit and width fields which  
> could
>  * be altered by the mount options, as well as any potential  
> sb_features2
>  * fixup. Only the first superblock is updated.
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 5/5] xfs: remove m_attroffset
  2009-03-18  9:41 ` [PATCH 5/5] xfs: remove m_attroffset Christoph Hellwig
  2009-03-26 19:42   ` Josef 'Jeff' Sipek
@ 2009-04-06 22:11   ` Felix Blyakher
  2009-04-07 16:01     ` Christoph Hellwig
  1 sibling, 1 reply; 25+ messages in thread
From: Felix Blyakher @ 2009-04-06 22:11 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs


On Mar 18, 2009, at 4:41 AM, Christoph Hellwig wrote:

> With the upcoming v3 inodes the default attroffset needs to be  
> calculated
> for each specific inode, so we can't cache it in the superblock  
> anymore.
>
> Also replace the assert for wrong inode sizes with a proper error  
> check
> also included in non-debug builds.  Note that the ENOSYS retourn for
> that might seem odd, but that error is returned by  
> xfs_mount_validate_sb
> for all theoretically valid but not supported filesystem geometries.
>
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Felix Blyakher <sgi.com>

>
>
> Index: xfs/fs/xfs/xfs_mount.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_mount.c	2009-03-18 07:37:20.566978952 +0100
> +++ xfs/fs/xfs/xfs_mount.c	2009-03-18 07:47:49.573979000 +0100
> @@ -333,6 +333,22 @@ xfs_mount_validate_sb(
> 		return XFS_ERROR(ENOSYS);
> 	}
>
> +	/*
> +	 * Currently only very few inode sizes are supported.
> +	 */
> +	switch (sbp->sb_inodesize) {
> +	case 256:
> +	case 512:
> +	case 1024:
> +	case 2048:
> +		break;
> +	default:
> +		xfs_fs_mount_cmn_err(flags,
> +			"inode size of %d bytes not supported",
> +			sbp->sb_inodesize);
> +		return XFS_ERROR(ENOSYS);
> +	}
> +
> 	if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) ||
> 	    xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) {
> 		xfs_fs_mount_cmn_err(flags,
> @@ -655,27 +671,6 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb
> 	mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG;
> 	mp->m_blockwmask = mp->m_blockwsize - 1;
>
> -	/*
> -	 * Setup for attributes, in case they get created.
> -	 * This value is for inodes getting attributes for the first time,
> -	 * the per-inode value is for old attribute values.
> -	 */
> -	ASSERT(sbp->sb_inodesize >= 256 && sbp->sb_inodesize <= 2048);
> -	switch (sbp->sb_inodesize) {
> -	case 256:
> -		mp->m_attroffset = XFS_LITINO(mp) -
> -				   XFS_BMDR_SPACE_CALC(MINABTPTRS);
> -		break;
> -	case 512:
> -	case 1024:
> -	case 2048:
> -		mp->m_attroffset = XFS_BMDR_SPACE_CALC(6 * MINABTPTRS);
> -		break;
> -	default:
> -		ASSERT(0);
> -	}
> -	ASSERT(mp->m_attroffset < XFS_LITINO(mp));
> -
> 	mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 1);
> 	mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 0);
> 	mp->m_alloc_mnr[0] = mp->m_alloc_mxr[0] / 2;
> Index: xfs/fs/xfs/xfs_attr_leaf.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_attr_leaf.c	2009-03-18 07:37:20.570978763  
> +0100
> +++ xfs/fs/xfs/xfs_attr_leaf.c	2009-03-18 07:37:23.768978423 +0100
> @@ -155,7 +155,8 @@ xfs_attr_shortform_bytesfit(xfs_inode_t
> 		 * minimum offset only needs to be the space required for
> 		 * the btree root.
> 		 */
> -		if (!dp->i_d.di_forkoff && dp->i_df.if_bytes > mp->m_attroffset)
> +		if (!dp->i_d.di_forkoff && dp->i_df.if_bytes >
> +		    xfs_default_attroffset(dp))
> 			dsize = XFS_BMDR_SPACE_CALC(MINDBTPTRS);
> 		break;
> 		
> Index: xfs/fs/xfs/xfs_bmap.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_bmap.c	2009-03-18 07:37:20.575978772 +0100
> +++ xfs/fs/xfs/xfs_bmap.c	2009-03-18 07:37:23.770978468 +0100
> @@ -3569,6 +3569,27 @@ xfs_bmap_extents_to_btree(
> }
>
> /*
> + * Calculate the default attribute fork offset for newly created  
> inodes.
> + */
> +uint
> +xfs_default_attroffset(
> +	struct xfs_inode	*ip)
> +{
> +	struct xfs_mount	*mp = ip->i_mount;
> +	uint			offset;
> +
> +	if (mp->m_sb.sb_inodesize == 256) {
> +		offset = XFS_LITINO(mp) -
> +				XFS_BMDR_SPACE_CALC(MINABTPTRS);
> +	} else {
> +		offset = XFS_BMDR_SPACE_CALC(6 * MINABTPTRS);
> +	}
> +
> +	ASSERT(offset < XFS_LITINO(mp));
> +	return offset;
> +}
> +
> +/*
>  * Helper routine to reset inode di_forkoff field when switching
>  * attribute fork from local to extent format - we reset it where
>  * possible to make space available for inline data fork extents.
> @@ -3580,15 +3601,18 @@ xfs_bmap_forkoff_reset(
> 	int		whichfork)
> {
> 	if (whichfork == XFS_ATTR_FORK &&
> -	    (ip->i_d.di_format != XFS_DINODE_FMT_DEV) &&
> -	    (ip->i_d.di_format != XFS_DINODE_FMT_UUID) &&
> -	    (ip->i_d.di_format != XFS_DINODE_FMT_BTREE) &&
> -	    ((mp->m_attroffset >> 3) > ip->i_d.di_forkoff)) {
> -		ip->i_d.di_forkoff = mp->m_attroffset >> 3;
> -		ip->i_df.if_ext_max = XFS_IFORK_DSIZE(ip) /
> -					(uint)sizeof(xfs_bmbt_rec_t);
> -		ip->i_afp->if_ext_max = XFS_IFORK_ASIZE(ip) /
> -					(uint)sizeof(xfs_bmbt_rec_t);
> +	    ip->i_d.di_format != XFS_DINODE_FMT_DEV &&
> +	    ip->i_d.di_format != XFS_DINODE_FMT_UUID &&
> +	    ip->i_d.di_format != XFS_DINODE_FMT_BTREE) {
> +		uint	dfl_forkoff = xfs_default_attroffset(ip) >> 3;
> +
> +		if (dfl_forkoff > ip->i_d.di_forkoff) {
> +			ip->i_d.di_forkoff = dfl_forkoff;
> +			ip->i_df.if_ext_max =
> +				XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t);
> +			ip->i_afp->if_ext_max =
> +				XFS_IFORK_ASIZE(ip) / sizeof(xfs_bmbt_rec_t);
> +		}
> 	}
> }
>
> @@ -4057,7 +4081,7 @@ xfs_bmap_add_attrfork(
> 	case XFS_DINODE_FMT_BTREE:
> 		ip->i_d.di_forkoff = xfs_attr_shortform_bytesfit(ip, size);
> 		if (!ip->i_d.di_forkoff)
> -			ip->i_d.di_forkoff = mp->m_attroffset >> 3;
> +			ip->i_d.di_forkoff = xfs_default_attroffset(ip) >> 3;
> 		else if (mp->m_flags & XFS_MOUNT_ATTR2)
> 			version = 2;
> 		break;
> @@ -4204,12 +4228,12 @@ xfs_bmap_compute_maxlevels(
> 	 * (a signed 16-bit number, xfs_aextnum_t).
> 	 *
> 	 * Note that we can no longer assume that if we are in ATTR1 that
> -	 * the fork offset of all the inodes will be (m_attroffset >> 3)
> -	 * because we could have mounted with ATTR2 and then mounted back
> -	 * with ATTR1, keeping the di_forkoff's fixed but probably at
> -	 * various positions. Therefore, for both ATTR1 and ATTR2
> -	 * we have to assume the worst case scenario of a minimum size
> -	 * available.
> +	 * the fork offset of all the inodes will be
> +	 * (xfs_default_attroffset(ip) >> 3) because we could have mounted
> +	 * with ATTR2 and then mounted back with ATTR1, keeping the
> +	 * di_forkoff's fixed but probably at various positions. Therefore,
> +	 * for both ATTR1 and ATTR2 we have to assume the worst case  
> scenario
> +	 * of a minimum size available.
> 	 */
> 	if (whichfork == XFS_DATA_FORK) {
> 		maxleafents = MAXEXTNUM;
> Index: xfs/fs/xfs/xfs_bmap.h
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_bmap.h	2009-03-18 07:37:20.579979142 +0100
> +++ xfs/fs/xfs/xfs_bmap.h	2009-03-18 07:37:23.772979002 +0100
> @@ -338,6 +338,10 @@ xfs_check_nostate_extents(
> 	xfs_extnum_t		idx,
> 	xfs_extnum_t		num);
>
> +uint
> +xfs_default_attroffset(
> +	struct xfs_inode	*ip);
> +
> #ifdef __KERNEL__
>
> /*
> Index: xfs/fs/xfs/xfs_mount.h
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_mount.h	2009-03-18 07:37:20.585978718 +0100
> +++ xfs/fs/xfs/xfs_mount.h	2009-03-18 07:37:23.772979002 +0100
> @@ -198,7 +198,6 @@ typedef struct xfs_mount {
> 	int			m_fixedfsid[2];	/* unchanged for life of FS */
> 	uint			m_dmevmask;	/* DMI events for this FS */
> 	__uint64_t		m_flags;	/* global mount flags */
> -	uint			m_attroffset;	/* inode attribute offset */
> 	uint			m_dir_node_ents; /* #entries in a dir danode */
> 	uint			m_attr_node_ents; /* #entries in attr danode */
> 	int			m_ialloc_inos;	/* inodes in inode allocation */
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 5/5] xfs: remove m_attroffset
  2009-04-06 22:11   ` Felix Blyakher
@ 2009-04-07 16:01     ` Christoph Hellwig
  0 siblings, 0 replies; 25+ messages in thread
From: Christoph Hellwig @ 2009-04-07 16:01 UTC (permalink / raw)
  To: Felix Blyakher; +Cc: Christoph Hellwig, xfs

This one already was in the last pull request :)

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2009-04-07 16:01 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-18  9:41 [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig
2009-03-18  9:41 ` [PATCH 1/5] xfs: cleanup uuid handling Christoph Hellwig
2009-03-29  7:45   ` Christoph Hellwig
2009-03-30  6:06   ` Felix Blyakher
2009-03-18  9:41 ` [PATCH 2/5] xfs: kill mutex_t typedef Christoph Hellwig
2009-03-21  3:51   ` Eric Sandeen
2009-03-26 22:31   ` Felix Blyakher
2009-03-18  9:41 ` [PATCH 3/5] xfs: kill ino64 mount option Christoph Hellwig
2009-03-21  3:54   ` Eric Sandeen
2009-03-21 20:08     ` Christoph Hellwig
2009-03-21 22:12       ` Eric Sandeen
2009-03-24  8:30         ` Dave Chinner
2009-03-24 13:11           ` Eric Sandeen
2009-03-26 22:37             ` Felix Blyakher
2009-03-18  9:41 ` [PATCH 4/5] xfs: remove m_litino Christoph Hellwig
2009-03-21  3:57   ` Eric Sandeen
2009-03-21 20:09     ` Christoph Hellwig
2009-03-26 22:41   ` Felix Blyakher
2009-03-29  7:48     ` Christoph Hellwig
2009-03-18  9:41 ` [PATCH 5/5] xfs: remove m_attroffset Christoph Hellwig
2009-03-26 19:42   ` Josef 'Jeff' Sipek
2009-03-29  7:50     ` Christoph Hellwig
2009-04-06 22:11   ` Felix Blyakher
2009-04-07 16:01     ` Christoph Hellwig
2009-03-29  9:28 ` [PATCH 0/5] A couple more patches for 2.6.30 Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox