linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] xfs: move & sync up xfs_trans_inode with userspace
@ 2019-07-12 17:43 Eric Sandeen
  2019-07-12 17:44 ` [PATCH 1/2] xfs: move xfs_trans_inode.c to libxfs/ Eric Sandeen
  2019-07-12 17:46 ` [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace Eric Sandeen
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Sandeen @ 2019-07-12 17:43 UTC (permalink / raw)
  To: linux-xfs

userspace moved xfs_trans_inode.c to libxfs after doing enough mangling
to share it, so do the same in the kernel now.

Add the CRTIME handling as well, since userspace has that, even though the
kernel doesn't use it for now.

-Eric

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] xfs: move xfs_trans_inode.c to libxfs/
  2019-07-12 17:43 [PATCH 0/2] xfs: move & sync up xfs_trans_inode with userspace Eric Sandeen
@ 2019-07-12 17:44 ` Eric Sandeen
  2019-07-15 11:29   ` Brian Foster
  2019-07-12 17:46 ` [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace Eric Sandeen
  1 sibling, 1 reply; 10+ messages in thread
From: Eric Sandeen @ 2019-07-12 17:44 UTC (permalink / raw)
  To: Eric Sandeen, linux-xfs

Userspace now has an identical xfs_trans_inode.c which it has already
moved to libxfs/ so do the same move for kernelspace.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index b74a47169297..06b68b6115bc 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -49,6 +49,7 @@ xfs-y				+= $(addprefix libxfs/, \
 				   xfs_refcount_btree.o \
 				   xfs_sb.o \
 				   xfs_symlink_remote.o \
+				   xfs_trans_inode.o \
 				   xfs_trans_resv.o \
 				   xfs_types.o \
 				   )
@@ -107,8 +108,7 @@ xfs-y				+= xfs_log.o \
 				   xfs_rmap_item.o \
 				   xfs_log_recover.o \
 				   xfs_trans_ail.o \
-				   xfs_trans_buf.o \
-				   xfs_trans_inode.o
+				   xfs_trans_buf.o
 
 # optional features
 xfs-$(CONFIG_XFS_QUOTA)		+= xfs_dquot.o \
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
similarity index 100%
rename from fs/xfs/xfs_trans_inode.c
rename to fs/xfs/libxfs/xfs_trans_inode.c

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace
  2019-07-12 17:43 [PATCH 0/2] xfs: move & sync up xfs_trans_inode with userspace Eric Sandeen
  2019-07-12 17:44 ` [PATCH 1/2] xfs: move xfs_trans_inode.c to libxfs/ Eric Sandeen
@ 2019-07-12 17:46 ` Eric Sandeen
  2019-07-15 11:30   ` Brian Foster
  2019-07-15 22:22   ` Dave Chinner
  1 sibling, 2 replies; 10+ messages in thread
From: Eric Sandeen @ 2019-07-12 17:46 UTC (permalink / raw)
  To: Eric Sandeen, linux-xfs

Add an XFS_ICHGTIME_CREATE case to xfs_trans_ichgtime() to keep in
sync with userspace.  (Currently no kernel caller sends this flag.)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
index 93d14e47269d..a9ad90926b87 100644
--- a/fs/xfs/libxfs/xfs_trans_inode.c
+++ b/fs/xfs/libxfs/xfs_trans_inode.c
@@ -66,6 +66,10 @@ xfs_trans_ichgtime(
 		inode->i_mtime = tv;
 	if (flags & XFS_ICHGTIME_CHG)
 		inode->i_ctime = tv;
+	if (flags & XFS_ICHGTIME_CREATE) {
+		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
+		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
+	}
 }
 
 /*

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] xfs: move xfs_trans_inode.c to libxfs/
  2019-07-12 17:44 ` [PATCH 1/2] xfs: move xfs_trans_inode.c to libxfs/ Eric Sandeen
@ 2019-07-15 11:29   ` Brian Foster
  0 siblings, 0 replies; 10+ messages in thread
From: Brian Foster @ 2019-07-15 11:29 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Fri, Jul 12, 2019 at 12:44:48PM -0500, Eric Sandeen wrote:
> Userspace now has an identical xfs_trans_inode.c which it has already
> moved to libxfs/ so do the same move for kernelspace.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

> 
> diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> index b74a47169297..06b68b6115bc 100644
> --- a/fs/xfs/Makefile
> +++ b/fs/xfs/Makefile
> @@ -49,6 +49,7 @@ xfs-y				+= $(addprefix libxfs/, \
>  				   xfs_refcount_btree.o \
>  				   xfs_sb.o \
>  				   xfs_symlink_remote.o \
> +				   xfs_trans_inode.o \
>  				   xfs_trans_resv.o \
>  				   xfs_types.o \
>  				   )
> @@ -107,8 +108,7 @@ xfs-y				+= xfs_log.o \
>  				   xfs_rmap_item.o \
>  				   xfs_log_recover.o \
>  				   xfs_trans_ail.o \
> -				   xfs_trans_buf.o \
> -				   xfs_trans_inode.o
> +				   xfs_trans_buf.o
>  
>  # optional features
>  xfs-$(CONFIG_XFS_QUOTA)		+= xfs_dquot.o \
> diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
> similarity index 100%
> rename from fs/xfs/xfs_trans_inode.c
> rename to fs/xfs/libxfs/xfs_trans_inode.c
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace
  2019-07-12 17:46 ` [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace Eric Sandeen
@ 2019-07-15 11:30   ` Brian Foster
  2019-07-15 15:09     ` Darrick J. Wong
  2019-07-15 22:22   ` Dave Chinner
  1 sibling, 1 reply; 10+ messages in thread
From: Brian Foster @ 2019-07-15 11:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Fri, Jul 12, 2019 at 12:46:17PM -0500, Eric Sandeen wrote:
> Add an XFS_ICHGTIME_CREATE case to xfs_trans_ichgtime() to keep in
> sync with userspace.  (Currently no kernel caller sends this flag.)
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
> index 93d14e47269d..a9ad90926b87 100644
> --- a/fs/xfs/libxfs/xfs_trans_inode.c
> +++ b/fs/xfs/libxfs/xfs_trans_inode.c
> @@ -66,6 +66,10 @@ xfs_trans_ichgtime(
>  		inode->i_mtime = tv;
>  	if (flags & XFS_ICHGTIME_CHG)
>  		inode->i_ctime = tv;
> +	if (flags & XFS_ICHGTIME_CREATE) {
> +		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
> +		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
> +	}

Could we add a "for libxfs" or some such one liner comment to this so
long as this is unused in the kernel? With that:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  }
>  
>  /*
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace
  2019-07-15 11:30   ` Brian Foster
@ 2019-07-15 15:09     ` Darrick J. Wong
  0 siblings, 0 replies; 10+ messages in thread
From: Darrick J. Wong @ 2019-07-15 15:09 UTC (permalink / raw)
  To: Brian Foster; +Cc: Eric Sandeen, linux-xfs

On Mon, Jul 15, 2019 at 07:30:08AM -0400, Brian Foster wrote:
> On Fri, Jul 12, 2019 at 12:46:17PM -0500, Eric Sandeen wrote:
> > Add an XFS_ICHGTIME_CREATE case to xfs_trans_ichgtime() to keep in
> > sync with userspace.  (Currently no kernel caller sends this flag.)
> > 
> > Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> > ---
> > 
> > diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
> > index 93d14e47269d..a9ad90926b87 100644
> > --- a/fs/xfs/libxfs/xfs_trans_inode.c
> > +++ b/fs/xfs/libxfs/xfs_trans_inode.c
> > @@ -66,6 +66,10 @@ xfs_trans_ichgtime(
> >  		inode->i_mtime = tv;
> >  	if (flags & XFS_ICHGTIME_CHG)
> >  		inode->i_ctime = tv;
> > +	if (flags & XFS_ICHGTIME_CREATE) {
> > +		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
> > +		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
> > +	}
> 
> Could we add a "for libxfs" or some such one liner comment to this so
> long as this is unused in the kernel? With that:

FWIW I was planning (5.4) to fix xfs_ialloc to use ICHGTIME_CREATE, so
it won't be "for libxfs only" for long. :)

--D

> Reviewed-by: Brian Foster <bfoster@redhat.com>
> 
> >  }
> >  
> >  /*
> > 
> > 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace
  2019-07-12 17:46 ` [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace Eric Sandeen
  2019-07-15 11:30   ` Brian Foster
@ 2019-07-15 22:22   ` Dave Chinner
  2019-07-16  0:03     ` Darrick J. Wong
  2019-07-16  0:05     ` Eric Sandeen
  1 sibling, 2 replies; 10+ messages in thread
From: Dave Chinner @ 2019-07-15 22:22 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Fri, Jul 12, 2019 at 12:46:17PM -0500, Eric Sandeen wrote:
> Add an XFS_ICHGTIME_CREATE case to xfs_trans_ichgtime() to keep in
> sync with userspace.  (Currently no kernel caller sends this flag.)
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
> index 93d14e47269d..a9ad90926b87 100644
> --- a/fs/xfs/libxfs/xfs_trans_inode.c
> +++ b/fs/xfs/libxfs/xfs_trans_inode.c
> @@ -66,6 +66,10 @@ xfs_trans_ichgtime(
>  		inode->i_mtime = tv;
>  	if (flags & XFS_ICHGTIME_CHG)
>  		inode->i_ctime = tv;
> +	if (flags & XFS_ICHGTIME_CREATE) {
> +		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
> +		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
> +	}

Please use the same format as the rest of the function. i.e.

	if (flags & XFS_ICHGTIME_CREATE)
		ip->i_d.di_crtime = tv;

And convert userspace over to the same :P

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace
  2019-07-15 22:22   ` Dave Chinner
@ 2019-07-16  0:03     ` Darrick J. Wong
  2019-07-16  0:06       ` Eric Sandeen
  2019-07-16  0:05     ` Eric Sandeen
  1 sibling, 1 reply; 10+ messages in thread
From: Darrick J. Wong @ 2019-07-16  0:03 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Eric Sandeen, linux-xfs

On Tue, Jul 16, 2019 at 08:22:09AM +1000, Dave Chinner wrote:
> On Fri, Jul 12, 2019 at 12:46:17PM -0500, Eric Sandeen wrote:
> > Add an XFS_ICHGTIME_CREATE case to xfs_trans_ichgtime() to keep in
> > sync with userspace.  (Currently no kernel caller sends this flag.)
> > 
> > Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> > ---
> > 
> > diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
> > index 93d14e47269d..a9ad90926b87 100644
> > --- a/fs/xfs/libxfs/xfs_trans_inode.c
> > +++ b/fs/xfs/libxfs/xfs_trans_inode.c
> > @@ -66,6 +66,10 @@ xfs_trans_ichgtime(
> >  		inode->i_mtime = tv;
> >  	if (flags & XFS_ICHGTIME_CHG)
> >  		inode->i_ctime = tv;
> > +	if (flags & XFS_ICHGTIME_CREATE) {
> > +		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
> > +		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
> > +	}
> 
> Please use the same format as the rest of the function. i.e.
> 
> 	if (flags & XFS_ICHGTIME_CREATE)
> 		ip->i_d.di_crtime = tv;
> 
> And convert userspace over to the same :P

How about promoting crtime to struct inode while we're at it?

(That said I think Eric was going for the quick resync now to keep
kernel libxfs in sync with xfsprogs libxfs...)

--D

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace
  2019-07-15 22:22   ` Dave Chinner
  2019-07-16  0:03     ` Darrick J. Wong
@ 2019-07-16  0:05     ` Eric Sandeen
  1 sibling, 0 replies; 10+ messages in thread
From: Eric Sandeen @ 2019-07-16  0:05 UTC (permalink / raw)
  To: Dave Chinner, Eric Sandeen; +Cc: linux-xfs



On 7/15/19 5:22 PM, Dave Chinner wrote:
> On Fri, Jul 12, 2019 at 12:46:17PM -0500, Eric Sandeen wrote:
>> Add an XFS_ICHGTIME_CREATE case to xfs_trans_ichgtime() to keep in
>> sync with userspace.  (Currently no kernel caller sends this flag.)
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
>> diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
>> index 93d14e47269d..a9ad90926b87 100644
>> --- a/fs/xfs/libxfs/xfs_trans_inode.c
>> +++ b/fs/xfs/libxfs/xfs_trans_inode.c
>> @@ -66,6 +66,10 @@ xfs_trans_ichgtime(
>>  		inode->i_mtime = tv;
>>  	if (flags & XFS_ICHGTIME_CHG)
>>  		inode->i_ctime = tv;
>> +	if (flags & XFS_ICHGTIME_CREATE) {
>> +		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
>> +		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
>> +	}
> 
> Please use the same format as the rest of the function. i.e.
> 
> 	if (flags & XFS_ICHGTIME_CREATE)
> 		ip->i_d.di_crtime = tv;

        struct timespec64 tv;


        struct timespec64       i_atime;
        struct timespec64       i_mtime;
        struct timespec64       i_ctime;

...

        xfs_timestamp_t di_crtime;      /* time created */


bzzzzt.

will take a bit more work I think :(




> And convert userspace over to the same :P
> 
> Cheers,
> 
> Dave.
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace
  2019-07-16  0:03     ` Darrick J. Wong
@ 2019-07-16  0:06       ` Eric Sandeen
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Sandeen @ 2019-07-16  0:06 UTC (permalink / raw)
  To: Darrick J. Wong, Dave Chinner; +Cc: Eric Sandeen, linux-xfs



On 7/15/19 7:03 PM, Darrick J. Wong wrote:
> On Tue, Jul 16, 2019 at 08:22:09AM +1000, Dave Chinner wrote:
>> On Fri, Jul 12, 2019 at 12:46:17PM -0500, Eric Sandeen wrote:
>>> Add an XFS_ICHGTIME_CREATE case to xfs_trans_ichgtime() to keep in
>>> sync with userspace.  (Currently no kernel caller sends this flag.)
>>>
>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>> ---
>>>
>>> diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
>>> index 93d14e47269d..a9ad90926b87 100644
>>> --- a/fs/xfs/libxfs/xfs_trans_inode.c
>>> +++ b/fs/xfs/libxfs/xfs_trans_inode.c
>>> @@ -66,6 +66,10 @@ xfs_trans_ichgtime(
>>>  		inode->i_mtime = tv;
>>>  	if (flags & XFS_ICHGTIME_CHG)
>>>  		inode->i_ctime = tv;
>>> +	if (flags & XFS_ICHGTIME_CREATE) {
>>> +		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
>>> +		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
>>> +	}
>>
>> Please use the same format as the rest of the function. i.e.
>>
>> 	if (flags & XFS_ICHGTIME_CREATE)
>> 		ip->i_d.di_crtime = tv;
>>
>> And convert userspace over to the same :P
> 
> How about promoting crtime to struct inode while we're at it?
> 
> (That said I think Eric was going for the quick resync now to keep
> kernel libxfs in sync with xfsprogs libxfs...)

well, yeah but we don't have to pollute crap just to save 4 lines in a diff.
I'm ok with moving the file and leaving this delta there for now if we need
to work harder on those last 4 lines of diff ;)

-Eric

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-16  0:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-12 17:43 [PATCH 0/2] xfs: move & sync up xfs_trans_inode with userspace Eric Sandeen
2019-07-12 17:44 ` [PATCH 1/2] xfs: move xfs_trans_inode.c to libxfs/ Eric Sandeen
2019-07-15 11:29   ` Brian Foster
2019-07-12 17:46 ` [PATCH 2/2] xfs: sync up xfs_trans_inode with userspace Eric Sandeen
2019-07-15 11:30   ` Brian Foster
2019-07-15 15:09     ` Darrick J. Wong
2019-07-15 22:22   ` Dave Chinner
2019-07-16  0:03     ` Darrick J. Wong
2019-07-16  0:06       ` Eric Sandeen
2019-07-16  0:05     ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).