linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ray Bryant <raybry@sgi.com>
To: Hirokazu Takahashi <taka@valinux.co.jp>,
	Marcello Tosatti <marcello@cyclades.com>, Andi Kleen <ak@suse.de>,
	Dave Hansen <haveblue@us.ibm.com>
Cc: Ray Bryant <raybry@sgi.com>, Ray Bryant <raybry@austin.rr.com>,
	linux-mm <linux-mm@kvack.org>
Subject: [PATCH_FOR_REVIEW 2.6.12-rc1 1/3] fs: manual page migration-rc1 -- extended attribute system.migration for XFS
Date: Tue, 5 Apr 2005 21:16:44 -0700 (PDT)	[thread overview]
Message-ID: <20050406041644.25060.37619.68257@jackhammer.engr.sgi.com> (raw)
In-Reply-To: <20050406041633.25060.64831.21849@jackhammer.engr.sgi.com>

This patch is from Nathan Scott of SGI and adds the extended
attribute system.migration for xfs.  At the moment, there is
no protection checking being done here (according to Nathan),
so this would have to be added if we finally agree to go this
way.  However, since there are currently alternative proposals
(e. g. Christoph Hellwig's suggestion of modifying the dynamic
loader) this is good enough for now.

Signed-off-by: Ray Bryant <raybry@sgi.com>

Index: linux/fs/xfs/xfs_attr.c
===================================================================
--- linux/fs/xfs.orig/xfs_attr.c
+++ linux/fs/xfs/xfs_attr.c
@@ -2398,7 +2398,53 @@
 	return xfs_acl_vhasacl_default(vp);
 }
 
-struct attrnames posix_acl_access = {
+#define _MIGRATE	"SGI_NUMA_MIGRATE"
+
+STATIC int
+numa_migration_set(
+	vnode_t	*vp, char *name, void *data, size_t size, int xflags)
+{
+	int error;
+
+	VOP_ATTR_SET(vp, _MIGRATE, data, size, ATTR_ROOT, sys_cred, error);
+	return -error;
+}
+
+STATIC int
+numa_migration_get(
+	vnode_t *vp, char *name, void *data, size_t size, int xflags)
+{
+	int error, flags = ATTR_ROOT;
+
+	if (!size)
+		flags |= ATTR_KERNOVAL;
+	VOP_ATTR_GET(vp, _MIGRATE, data, &size, flags, sys_cred, error);
+	if (!error)
+		return size;
+	return -error;
+}
+
+STATIC int
+numa_migration_remove(
+	struct vnode *vp, char *name, int xflags)
+{
+	int error;
+
+	VOP_ATTR_REMOVE(vp, _MIGRATE, ATTR_ROOT, sys_cred, error);
+	return (error == ENOATTR) ? 0 : -error;
+}
+
+STATIC int
+numa_migration_exists(
+	vnode_t *vp)
+{
+	int	error, len, flags = ATTR_ROOT|ATTR_KERNOVAL;
+
+	VOP_ATTR_GET(vp, _MIGRATE, NULL, &len, flags, sys_cred, error);
+	return (error == 0);
+}
+
+STATIC struct attrnames posix_acl_access = {
 	.attr_name	= "posix_acl_access",
 	.attr_namelen	= sizeof("posix_acl_access") - 1,
 	.attr_get	= posix_acl_access_get,
@@ -2407,7 +2453,7 @@
 	.attr_exists	= posix_acl_access_exists,
 };
 
-struct attrnames posix_acl_default = {
+STATIC struct attrnames posix_acl_default = {
 	.attr_name	= "posix_acl_default",
 	.attr_namelen	= sizeof("posix_acl_default") - 1,
 	.attr_get	= posix_acl_default_get,
@@ -2416,8 +2462,19 @@
 	.attr_exists	= posix_acl_default_exists,
 };
 
-struct attrnames *attr_system_names[] =
-	{ &posix_acl_access, &posix_acl_default };
+STATIC struct attrnames numa_migration = {
+	.attr_name	= "migration",
+	.attr_namelen	= sizeof("migration") - 1,
+	.attr_get	= numa_migration_get,
+	.attr_set	= numa_migration_set,
+	.attr_remove	= numa_migration_remove,
+	.attr_exists	= numa_migration_exists,
+};
+
+struct attrnames *attr_system_names[] = {
+	&posix_acl_access, &posix_acl_default,
+	&numa_migration,
+};
 
 
 /*========================================================================
Index: linux/fs/xfs/xfs_attr.h
===================================================================
--- linux/fs/xfs.orig/xfs_attr.h
+++ linux/fs/xfs/xfs_attr.h
@@ -76,9 +76,7 @@
 extern struct attrnames attr_trusted;
 extern struct attrnames *attr_namespaces[ATTR_NAMECOUNT];
 
-#define ATTR_SYSCOUNT	2
-extern struct attrnames posix_acl_access;
-extern struct attrnames posix_acl_default;
+#define ATTR_SYSCOUNT	3
 extern struct attrnames *attr_system_names[ATTR_SYSCOUNT];
 
 extern attrnames_t *attr_lookup_namespace(char *, attrnames_t **, int);


-- 
Best Regards,
Ray
-----------------------------------------------
Ray Bryant                       raybry@sgi.com
The box said: "Requires Windows 98 or better",
           so I installed Linux.
-----------------------------------------------
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-04-06  4:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-06  4:16 [PATCH_FOR_REVIEW 2.6.12-rc1 0/3] mm: manual page migration-rc1 -- overview Ray Bryant
2005-04-06  4:16 ` Ray Bryant [this message]
2005-04-06  4:17 ` [PATCH_FOR_REVIEW 2.6.12-rc1 2/3] mm: manual page migration-rc1 -- add node_map arg to try_to_migrate_pages() Ray Bryant
2005-04-06 15:39   ` Dave Hansen
2005-04-07  0:51     ` Ray Bryant
2005-04-06  4:17 ` [PATCH_FOR_REVIEW 2.6.12-rc1 3/3] mm: manual page migration-rc1 -- sys_migrate_pages Ray Bryant

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20050406041644.25060.37619.68257@jackhammer.engr.sgi.com \
    --to=raybry@sgi.com \
    --cc=ak@suse.de \
    --cc=haveblue@us.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=marcello@cyclades.com \
    --cc=raybry@austin.rr.com \
    --cc=taka@valinux.co.jp \
    /path/to/YOUR_REPLY

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

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