Re: [PATCH 009/119] xfs: convert list of extents to free into a regular list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  {
> +	struct xfs_bmap_free_item	*new;		/* new element */
>  #ifdef DEBUG
>  	xfs_agnumber_t		agno;
>  	xfs_agblock_t		agbno;
> @@ -597,17 +595,7 @@ xfs_bmap_add_free(
>  	new = kmem_zone_alloc(xfs_bmap_free_item_zone, KM_SLEEP);
>  	new->xbfi_startblock = bno;
>  	new->xbfi_blockcount = (xfs_extlen_t)len;
> +	list_add(&new->xbfi_list, &flist->xbf_flist);
>  	flist->xbf_count++;

Please kill xbf_count while you're at it, it's entirely superflous.

> @@ -617,14 +605,10 @@ xfs_bmap_add_free(
>   */
>  void
>  xfs_bmap_del_free(
> -	xfs_bmap_free_t		*flist,	/* free item list header */
> -	xfs_bmap_free_item_t	*prev,	/* previous item on list, if any */
> -	xfs_bmap_free_item_t	*free)	/* list item to be freed */
> +	struct xfs_bmap_free		*flist,	/* free item list header */
> +	struct xfs_bmap_free_item	*free)	/* list item to be freed */

Which then also gets rid of the flist argument here.

> @@ -634,17 +618,16 @@ xfs_bmap_del_free(
>   */
>  void
>  xfs_bmap_cancel(
> +	struct xfs_bmap_free		*flist)	/* list of bmap_free_items */
>  {
> +	struct xfs_bmap_free_item	*free;	/* free list item */
>  
>  	if (flist->xbf_count == 0)
>  		return;
> +	while (!list_empty(&flist->xbf_flist)) {
> +		free = list_first_entry(&flist->xbf_flist,
> +				struct xfs_bmap_free_item, xbfi_list);

	while ((free = list_first_entry_or_null(...))

> +	list_sort((*tp)->t_mountp, &flist->xbf_flist, xfs_bmap_free_list_cmp);

Can you add a comment on why we are sorting the list?
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux