Commit e182f57ac019b034b40d16f3c6d8e86826aecd56

Authored by Christoph Hellwig
Committed by Niv Sardi
1 parent 90ad58a83a

[XFS] attrmulti cleanup

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>

Showing 3 changed files with 4 additions and 17 deletions Side-by-side Diff

fs/xfs/linux-2.6/xfs_ioctl.c
... ... @@ -593,7 +593,7 @@
593 593 goto out;
594 594  
595 595 error = E2BIG;
596   - size = am_hreq.opcount * sizeof(attr_multiop_t);
  596 + size = am_hreq.opcount * sizeof(xfs_attr_multiop_t);
597 597 if (!size || size > 16 * PAGE_SIZE)
598 598 goto out_vn_rele;
599 599  
... ... @@ -85,22 +85,6 @@
85 85 &((char *)buffer)[ ((attrlist_t *)(buffer))->al_offset[index] ])
86 86  
87 87 /*
88   - * Multi-attribute operation vector.
89   - */
90   -typedef struct attr_multiop {
91   - int am_opcode; /* operation to perform (ATTR_OP_GET, etc.) */
92   - int am_error; /* [out arg] result of this sub-op (an errno) */
93   - char *am_attrname; /* attribute name to work with */
94   - char *am_attrvalue; /* [in/out arg] attribute value (raw bytes) */
95   - int am_length; /* [in/out arg] length of value */
96   - int am_flags; /* bitwise OR of attr API flags defined above */
97   -} attr_multiop_t;
98   -
99   -#define ATTR_OP_GET 1 /* return the indicated attr's value */
100   -#define ATTR_OP_SET 2 /* set/create the indicated attr/value pair */
101   -#define ATTR_OP_REMOVE 3 /* remove the indicated attr */
102   -
103   -/*
104 88 * Kernel-internal version of the attrlist cursor.
105 89 */
106 90 typedef struct attrlist_cursor_kern {
... ... @@ -372,6 +372,9 @@
372 372  
373 373 typedef struct xfs_attr_multiop {
374 374 __u32 am_opcode;
  375 +#define ATTR_OP_GET 1 /* return the indicated attr's value */
  376 +#define ATTR_OP_SET 2 /* set/create the indicated attr/value pair */
  377 +#define ATTR_OP_REMOVE 3 /* remove the indicated attr */
375 378 __s32 am_error;
376 379 void __user *am_attrname;
377 380 void __user *am_attrvalue;