[5/3] libxfs: rename bli_format to avoid confusion with bli_formats
diff mbox series

Message ID d8f37464-9d76-2b09-f458-e236ef9afd95@redhat.com
State Superseded
Headers show
Series
  • xfsprogs: more libxfs/ spring cleaning
Related show

Commit Message

Eric Sandeen May 16, 2019, 8:39 p.m. UTC
Rename the bli_format structure to __bli_format to avoid
accidently confusing them with the bli_formats pointer.

(nb: userspace currently has no bli_formats pointer)

Source kernel commit: b94381737e9c4d014a4003e8ece9ba88670a2dd4

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 include/xfs_trans.h | 2 +-
 libxfs/logitem.c    | 6 +++---
 libxfs/trans.c      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

Comments

Allison Collins May 17, 2019, 10:29 p.m. UTC | #1
On 5/16/19 1:39 PM, Eric Sandeen wrote:
> Rename the bli_format structure to __bli_format to avoid
> accidently confusing them with the bli_formats pointer.
> 
> (nb: userspace currently has no bli_formats pointer)
> 
> Source kernel commit: b94381737e9c4d014a4003e8ece9ba88670a2dd4
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>   include/xfs_trans.h | 2 +-
>   libxfs/logitem.c    | 6 +++---
>   libxfs/trans.c      | 4 ++--
>   3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/xfs_trans.h b/include/xfs_trans.h
> index 953da5d1..fe03ba64 100644
> --- a/include/xfs_trans.h
> +++ b/include/xfs_trans.h
> @@ -39,7 +39,7 @@ typedef struct xfs_buf_log_item {
>   	struct xfs_buf		*bli_buf;	/* real buffer pointer */
>   	unsigned int		bli_flags;	/* misc flags */
>   	unsigned int		bli_recur;	/* recursion count */
> -	xfs_buf_log_format_t	bli_format;	/* in-log header */
> +	xfs_buf_log_format_t	__bli_format;	/* in-log header */
>   } xfs_buf_log_item_t;
>   
>   #define XFS_BLI_DIRTY			(1<<0)
> diff --git a/libxfs/logitem.c b/libxfs/logitem.c
> index 4da9bc1b..e862ab4f 100644
> --- a/libxfs/logitem.c
> +++ b/libxfs/logitem.c
> @@ -107,9 +107,9 @@ xfs_buf_item_init(
>   	bip->bli_item.li_mountp = mp;
>   	INIT_LIST_HEAD(&bip->bli_item.li_trans);
>   	bip->bli_buf = bp;
> -	bip->bli_format.blf_type = XFS_LI_BUF;
> -	bip->bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
> -	bip->bli_format.blf_len = (unsigned short)BTOBB(bp->b_bcount);
> +	bip->__bli_format.blf_type = XFS_LI_BUF;
> +	bip->__bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
> +	bip->__bli_format.blf_len = (unsigned short)BTOBB(bp->b_bcount);
>   	bp->b_log_item = bip;

I had a look around this area of code, and I see where the bli_format is 
getting referenced, but I don't see a bli_formats.  So I feel like I'm 
missing the motivation for the change.  Did I miss the bli_formats 
somewhere?  Thanks!

Allison

>   }
>   
> diff --git a/libxfs/trans.c b/libxfs/trans.c
> index 6967a1de..f3c28fa7 100644
> --- a/libxfs/trans.c
> +++ b/libxfs/trans.c
> @@ -531,8 +531,8 @@ xfs_trans_binval(
>   	xfs_buf_stale(bp);
>   	bip->bli_flags |= XFS_BLI_STALE;
>   	bip->bli_flags &= ~XFS_BLI_DIRTY;
> -	bip->bli_format.blf_flags &= ~XFS_BLF_INODE_BUF;
> -	bip->bli_format.blf_flags |= XFS_BLF_CANCEL;
> +	bip->__bli_format.blf_flags &= ~XFS_BLF_INODE_BUF;
> +	bip->__bli_format.blf_flags |= XFS_BLF_CANCEL;
>   	set_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags);
>   	tp->t_flags |= XFS_TRANS_DIRTY;
>   }
>
Eric Sandeen May 17, 2019, 11:01 p.m. UTC | #2
On 5/17/19 5:29 PM, Allison Collins wrote:
> On 5/16/19 1:39 PM, Eric Sandeen wrote:
>> Rename the bli_format structure to __bli_format to avoid
>> accidently confusing them with the bli_formats pointer.
>>
>> (nb: userspace currently has no bli_formats pointer)
>>
>> Source kernel commit: b94381737e9c4d014a4003e8ece9ba88670a2dd4
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>   include/xfs_trans.h | 2 +-
>>   libxfs/logitem.c    | 6 +++---
>>   libxfs/trans.c      | 4 ++--
>>   3 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/include/xfs_trans.h b/include/xfs_trans.h
>> index 953da5d1..fe03ba64 100644
>> --- a/include/xfs_trans.h
>> +++ b/include/xfs_trans.h
>> @@ -39,7 +39,7 @@ typedef struct xfs_buf_log_item {
>>       struct xfs_buf        *bli_buf;    /* real buffer pointer */
>>       unsigned int        bli_flags;    /* misc flags */
>>       unsigned int        bli_recur;    /* recursion count */
>> -    xfs_buf_log_format_t    bli_format;    /* in-log header */
>> +    xfs_buf_log_format_t    __bli_format;    /* in-log header */
>>   } xfs_buf_log_item_t;
>>     #define XFS_BLI_DIRTY            (1<<0)
>> diff --git a/libxfs/logitem.c b/libxfs/logitem.c
>> index 4da9bc1b..e862ab4f 100644
>> --- a/libxfs/logitem.c
>> +++ b/libxfs/logitem.c
>> @@ -107,9 +107,9 @@ xfs_buf_item_init(
>>       bip->bli_item.li_mountp = mp;
>>       INIT_LIST_HEAD(&bip->bli_item.li_trans);
>>       bip->bli_buf = bp;
>> -    bip->bli_format.blf_type = XFS_LI_BUF;
>> -    bip->bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
>> -    bip->bli_format.blf_len = (unsigned short)BTOBB(bp->b_bcount);
>> +    bip->__bli_format.blf_type = XFS_LI_BUF;
>> +    bip->__bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
>> +    bip->__bli_format.blf_len = (unsigned short)BTOBB(bp->b_bcount);
>>       bp->b_log_item = bip;
> 
> I had a look around this area of code, and I see where the bli_format is getting referenced, but I don't see a bli_formats.  So I feel like I'm missing the motivation for the change.  Did I miss the bli_formats somewhere?  Thanks!

see above :)

> (nb: userspace currently has no bli_formats pointer) 

(I guess copying the kernel commit log added confusion even w/ the note)

-Eric
Allison Collins May 17, 2019, 11:41 p.m. UTC | #3
On 5/17/19 4:01 PM, Eric Sandeen wrote:
> On 5/17/19 5:29 PM, Allison Collins wrote:
>> On 5/16/19 1:39 PM, Eric Sandeen wrote:
>>> Rename the bli_format structure to __bli_format to avoid
>>> accidently confusing them with the bli_formats pointer.
>>>
>>> (nb: userspace currently has no bli_formats pointer)
>>>
>>> Source kernel commit: b94381737e9c4d014a4003e8ece9ba88670a2dd4
>>>
>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>> ---
>>>    include/xfs_trans.h | 2 +-
>>>    libxfs/logitem.c    | 6 +++---
>>>    libxfs/trans.c      | 4 ++--
>>>    3 files changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/include/xfs_trans.h b/include/xfs_trans.h
>>> index 953da5d1..fe03ba64 100644
>>> --- a/include/xfs_trans.h
>>> +++ b/include/xfs_trans.h
>>> @@ -39,7 +39,7 @@ typedef struct xfs_buf_log_item {
>>>        struct xfs_buf        *bli_buf;    /* real buffer pointer */
>>>        unsigned int        bli_flags;    /* misc flags */
>>>        unsigned int        bli_recur;    /* recursion count */
>>> -    xfs_buf_log_format_t    bli_format;    /* in-log header */
>>> +    xfs_buf_log_format_t    __bli_format;    /* in-log header */
>>>    } xfs_buf_log_item_t;
>>>      #define XFS_BLI_DIRTY            (1<<0)
>>> diff --git a/libxfs/logitem.c b/libxfs/logitem.c
>>> index 4da9bc1b..e862ab4f 100644
>>> --- a/libxfs/logitem.c
>>> +++ b/libxfs/logitem.c
>>> @@ -107,9 +107,9 @@ xfs_buf_item_init(
>>>        bip->bli_item.li_mountp = mp;
>>>        INIT_LIST_HEAD(&bip->bli_item.li_trans);
>>>        bip->bli_buf = bp;
>>> -    bip->bli_format.blf_type = XFS_LI_BUF;
>>> -    bip->bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
>>> -    bip->bli_format.blf_len = (unsigned short)BTOBB(bp->b_bcount);
>>> +    bip->__bli_format.blf_type = XFS_LI_BUF;
>>> +    bip->__bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
>>> +    bip->__bli_format.blf_len = (unsigned short)BTOBB(bp->b_bcount);
>>>        bp->b_log_item = bip;
>>
>> I had a look around this area of code, and I see where the bli_format is getting referenced, but I don't see a bli_formats.  So I feel like I'm missing the motivation for the change.  Did I miss the bli_formats somewhere?  Thanks!
> 
> see above :)
> 
>> (nb: userspace currently has no bli_formats pointer)
> 
> (I guess copying the kernel commit log added confusion even w/ the note)
> 
> -Eric

Oh I see.  No I think it's ok, I overlooked it.  You can add my review  :-)

Reviewed-by: Allison Collins <allison.henderson@oracle.com>

>

Patch
diff mbox series

diff --git a/include/xfs_trans.h b/include/xfs_trans.h
index 953da5d1..fe03ba64 100644
--- a/include/xfs_trans.h
+++ b/include/xfs_trans.h
@@ -39,7 +39,7 @@  typedef struct xfs_buf_log_item {
 	struct xfs_buf		*bli_buf;	/* real buffer pointer */
 	unsigned int		bli_flags;	/* misc flags */
 	unsigned int		bli_recur;	/* recursion count */
-	xfs_buf_log_format_t	bli_format;	/* in-log header */
+	xfs_buf_log_format_t	__bli_format;	/* in-log header */
 } xfs_buf_log_item_t;
 
 #define XFS_BLI_DIRTY			(1<<0)
diff --git a/libxfs/logitem.c b/libxfs/logitem.c
index 4da9bc1b..e862ab4f 100644
--- a/libxfs/logitem.c
+++ b/libxfs/logitem.c
@@ -107,9 +107,9 @@  xfs_buf_item_init(
 	bip->bli_item.li_mountp = mp;
 	INIT_LIST_HEAD(&bip->bli_item.li_trans);
 	bip->bli_buf = bp;
-	bip->bli_format.blf_type = XFS_LI_BUF;
-	bip->bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
-	bip->bli_format.blf_len = (unsigned short)BTOBB(bp->b_bcount);
+	bip->__bli_format.blf_type = XFS_LI_BUF;
+	bip->__bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
+	bip->__bli_format.blf_len = (unsigned short)BTOBB(bp->b_bcount);
 	bp->b_log_item = bip;
 }
 
diff --git a/libxfs/trans.c b/libxfs/trans.c
index 6967a1de..f3c28fa7 100644
--- a/libxfs/trans.c
+++ b/libxfs/trans.c
@@ -531,8 +531,8 @@  xfs_trans_binval(
 	xfs_buf_stale(bp);
 	bip->bli_flags |= XFS_BLI_STALE;
 	bip->bli_flags &= ~XFS_BLI_DIRTY;
-	bip->bli_format.blf_flags &= ~XFS_BLF_INODE_BUF;
-	bip->bli_format.blf_flags |= XFS_BLF_CANCEL;
+	bip->__bli_format.blf_flags &= ~XFS_BLF_INODE_BUF;
+	bip->__bli_format.blf_flags |= XFS_BLF_CANCEL;
 	set_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags);
 	tp->t_flags |= XFS_TRANS_DIRTY;
 }