xfs
[Top] [All Lists]

Re: [PATCH] Clean up sparse warnings

To: David Chinner <dgc@xxxxxxx>
Subject: Re: [PATCH] Clean up sparse warnings
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 30 Oct 2007 10:05:23 +0000
Cc: xfs@xxxxxxxxxxx, xfs-dev@xxxxxxx
In-reply-to: <20071029233442.GP995458@xxxxxxx>
References: <20071029233442.GP995458@xxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.3i
On Tue, Oct 30, 2007 at 10:34:42AM +1100, David Chinner wrote:
> 
> Clean up most outstanding sparse warnings.
> 
> These are mostly locking annotations, marking things static,
> casts where needed and declaring stuff in header files.

Nice.  Note that once we start on making things static there's also a lot
of things not really used non-static but exported which we should cleanup
aswell.  I'll look at that when I get some time.

Note that we'll also always get tons of sparse warnings for debug builds
because STATIC is defined away..

> @@ -2733,21 +2733,13 @@ xlog_recover_do_efd_trans(
>                                * AIL lock.
>                                */
>                               xfs_trans_delete_ail(mp, lip);
> -                             break;
> +                             xfs_efi_item_free(efip);
> +                             return;
>                       }
>               }
>               lip = xfs_trans_next_ail(mp, lip, &gen, NULL);
>       }
> -
> -     /*
> -      * If we found it, then free it up.  If it wasn't there, it
> -      * must have been overwritten in the log.  Oh well.
> -      */
> -     if (lip != NULL) {
> -             xfs_efi_item_free(efip);
> -     } else {
> -             spin_unlock(&mp->m_ail_lock);
> -     }
> +     spin_unlock(&mp->m_ail_lock);

Imho non-trivial changes like this hunk always deserve beeing a patch of
it's own where they're described in details.


Note that I also get warnings from the lock annotations prover in sparse
about some conditional locking in xfs_mount.c.  I have patches I still need
to run through testing for those which clean the code up quite nicely aswell.


<Prev in Thread] Current Thread [Next in Thread>