]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[XFS] attrmulti cleanup
authorChristoph Hellwig <hch@infradead.org>
Fri, 27 Jun 2008 03:32:31 +0000 (13:32 +1000)
committerNiv Sardi <xaiki@debian.org>
Mon, 28 Jul 2008 06:59:09 +0000 (16:59 +1000)
xfs_attrmulti_by_handle currently request the size based on
sizeof(attr_multiop_t) but should be using sizeof(xfs_attr_multiop_t)
because that is what it is dealing with. Despite beeing wrong this
actually harmless in practice because both structures are the same size on
all platforms.

But this sizeof was the only user of struct attr_multiop so we can just
kill it. Also move the ATTR_OP_* defines xfs_attr.h into the struct
xfs_attr_multiop defintion in xfs_fs.h because they are only used with
that structure, and are part of the user ABI for the
XFS_IOC_ATTRMULTI_BY_HANDLE ioctl.

SGI-PV: 983508

SGI-Modid: xfs-linux-melb:xfs-kern:31352a

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/xfs_attr.h
fs/xfs/xfs_fs.h

index 993f5720200ac98bb38830a998a71e1e85d1e535..8eddaff368434fc4231e974a9e2dfad0aa7fcb21 100644 (file)
@@ -593,7 +593,7 @@ xfs_attrmulti_by_handle(
                goto out;
 
        error = E2BIG;
-       size = am_hreq.opcount * sizeof(attr_multiop_t);
+       size = am_hreq.opcount * sizeof(xfs_attr_multiop_t);
        if (!size || size > 16 * PAGE_SIZE)
                goto out_vn_rele;
 
index 3115dcc67236cd459ffbbbafdc6f345d1801e512..8b2d31c19e4dbd3b2abb6ccb8bb9921d2a447ff4 100644 (file)
@@ -84,22 +84,6 @@ typedef struct attrlist_ent {        /* data from attr_list() */
        ((attrlist_ent_t *)                     \
         &((char *)buffer)[ ((attrlist_t *)(buffer))->al_offset[index] ])
 
-/*
- * Multi-attribute operation vector.
- */
-typedef struct attr_multiop {
-       int     am_opcode;      /* operation to perform (ATTR_OP_GET, etc.) */
-       int     am_error;       /* [out arg] result of this sub-op (an errno) */
-       char    *am_attrname;   /* attribute name to work with */
-       char    *am_attrvalue;  /* [in/out arg] attribute value (raw bytes) */
-       int     am_length;      /* [in/out arg] length of value */
-       int     am_flags;       /* bitwise OR of attr API flags defined above */
-} attr_multiop_t;
-
-#define ATTR_OP_GET    1       /* return the indicated attr's value */
-#define ATTR_OP_SET    2       /* set/create the indicated attr/value pair */
-#define ATTR_OP_REMOVE 3       /* remove the indicated attr */
-
 /*
  * Kernel-internal version of the attrlist cursor.
  */
index 6ca749897c58e38cb173fd360eba69284c3710ed..01c0cc88d3f37055bc071dc545ca731509361bc6 100644 (file)
@@ -372,6 +372,9 @@ typedef struct xfs_fsop_attrlist_handlereq {
 
 typedef struct xfs_attr_multiop {
        __u32           am_opcode;
+#define ATTR_OP_GET    1       /* return the indicated attr's value */
+#define ATTR_OP_SET    2       /* set/create the indicated attr/value pair */
+#define ATTR_OP_REMOVE 3       /* remove the indicated attr */
        __s32           am_error;
        void            __user *am_attrname;
        void            __user *am_attrvalue;