From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 10 May 2005 21:38:02 -0700 (PDT) From: Ray Bryant Message-Id: <20050511043802.10876.60521.51027@jackhammer.engr.sgi.com> In-Reply-To: <20050511043756.10876.72079.60115@jackhammer.engr.sgi.com> References: <20050511043756.10876.72079.60115@jackhammer.engr.sgi.com> Subject: [PATCH 2.6.12-rc3 1/8] mm: manual page migration-rc2 -- xfs-extended-attributes-rc2.patch Sender: owner-linux-mm@kvack.org Return-Path: To: Hirokazu Takahashi , Marcelo Tosatti , Andi Kleen , Dave Hansen Cc: Christoph Hellwig , linux-mm , Nathan Scott , Ray Bryant , lhms-devel@lists.sourceforge.net, Ray Bryant List-ID: 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. Signed-off-by: Ray Bryant xfs_attr.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- xfs_attr.h | 4 --- 2 files changed, 62 insertions(+), 7 deletions(-) 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: aart@kvack.org