]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: sync attr code with kernel
authorDave Chinner <dchinner@redhat.com>
Wed, 4 Sep 2013 22:05:13 +0000 (22:05 +0000)
committerRich Johnston <rjohnston@sgi.com>
Mon, 16 Sep 2013 20:14:40 +0000 (15:14 -0500)
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Review-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
libxfs/xfs_attr.c
libxfs/xfs_attr_leaf.c

index 6ef78094adabcb665d5a118ae0f0d2295afb58e6..c96083e1aadc2eb7e61e652b443ec200a2d191bb 100644 (file)
@@ -65,7 +65,7 @@ xfs_attr_name_to_xname(
        return 0;
 }
 
-STATIC int
+int
 xfs_inode_hasattr(
        struct xfs_inode        *ip)
 {
@@ -268,7 +268,6 @@ xfs_attr_set_int(
        if (rsvd)
                args.trans->t_flags |= XFS_TRANS_RESERVE;
 
-
        error = xfs_trans_reserve(args.trans, args.total,
                                  XFS_ATTRSETM_LOG_RES(mp) +
                                  XFS_ATTRSETRT_LOG_RES(mp) * args.total,
@@ -587,6 +586,7 @@ xfs_attr_remove(
        return xfs_attr_remove_int(dp, &xname, flags);
 }
 
+
 /*========================================================================
  * External routines when attribute list is inside the inode
  *========================================================================*/
@@ -854,7 +854,7 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
        error = xfs_attr3_leaf_lookup_int(bp, args);
        if (error == ENOATTR) {
                xfs_trans_brelse(args->trans, bp);
-               return(error);
+               return error;
        }
 
        xfs_attr3_leaf_remove(bp, args);
index 4e2951b6de8506825f67599300be38c0f4ba013e..49a17645b4178c5589ee3ec0d6c448008d9e6e44 100644 (file)
@@ -51,7 +51,6 @@ STATIC int xfs_attr3_leaf_figure_balance(xfs_da_state_t *state,
                        int *number_entries_in_blk1,
                        int *number_usedbytes_in_blk1);
 
-
 /*
  * Utility routines.
  */
@@ -1120,7 +1119,6 @@ xfs_attr3_leaf_add_work(
        struct xfs_attr_leaf_entry *entry;
        struct xfs_attr_leaf_name_local *name_loc;
        struct xfs_attr_leaf_name_remote *name_rmt;
-       struct xfs_attr_leaf_map *map;
        struct xfs_mount        *mp;
        int                     tmp;
        int                     i;
@@ -1219,7 +1217,7 @@ xfs_attr3_leaf_add_work(
        tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t)
                                        + xfs_attr3_leaf_hdr_size(leaf);
 
-       for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; map++, i++) {
+       for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
                if (ichdr->freemap[i].base == tmp) {
                        ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t);
                        ichdr->freemap[i].size -= sizeof(xfs_attr_leaf_entry_t);
@@ -2337,7 +2335,7 @@ xfs_attr3_leaf_moveents(
                 * Move the remaining entries down to fill the hole,
                 * then zero the entries at the top.
                 */
-               tmp  = (ichdr_s->count - count) - sizeof(xfs_attr_leaf_entry_t);
+               tmp  = (ichdr_s->count - count) * sizeof(xfs_attr_leaf_entry_t);
                entry_s = &xfs_attr3_leaf_entryp(leaf_s)[start_s + count];
                entry_d = &xfs_attr3_leaf_entryp(leaf_s)[start_s];
                memmove(entry_d, entry_s, tmp);
@@ -2431,6 +2429,7 @@ xfs_attr_leaf_newentsize(int namelen, int valuelen, int blocksize, int *local)
        return size;
 }
 
+
 /*========================================================================
  * Manage the INCOMPLETE flag in a leaf entry
  *========================================================================*/