/*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
- * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
#include <linux/buffer_head.h>
#include <linux/xattr.h>
#include <linux/gfs2_ondisk.h>
-#include <asm/semaphore.h>
#include <asm/uaccess.h>
#include "gfs2.h"
return error;
}
-
-static int gfs2_ea_repack_i(struct gfs2_inode *ip)
-{
- return -EOPNOTSUPP;
-}
-
-int gfs2_ea_repack(struct gfs2_inode *ip)
-{
- struct gfs2_holder gh;
- int error;
-
- error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
- if (error)
- return error;
-
- /* Some sort of permissions checking would be nice */
-
- error = gfs2_ea_repack_i(ip);
-
- gfs2_glock_dq_uninit(&gh);
-
- return error;
-}
-
struct ea_list {
struct gfs2_ea_request *ei_er;
unsigned int ei_size;
{
struct ea_list *ei = private;
struct gfs2_ea_request *er = ei->ei_er;
- unsigned int ea_size = GFS2_EA_STRLEN(ea);
+ unsigned int ea_size = gfs2_ea_strlen(ea);
if (ea->ea_type == GFS2_EATYPE_UNUSED)
return 0;
if (ei->ei_size + ea_size > er->er_data_len)
return -ERANGE;
- if (ea->ea_type == GFS2_EATYPE_USR) {
+ switch (ea->ea_type) {
+ case GFS2_EATYPE_USR:
prefix = "user.";
l = 5;
- } else {
+ break;
+ case GFS2_EATYPE_SYS:
prefix = "system.";
l = 7;
+ break;
+ case GFS2_EATYPE_SECURITY:
+ prefix = "security.";
+ l = 9;
+ break;
+ default:
+ break;
}
memcpy(er->er_data + ei->ei_size,