public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: Update inode alloc comments
@ 2012-10-20 14:08 Carlos Maiolino
  2012-10-23 12:23 ` Christoph Hellwig
  2012-11-02 22:12 ` Ben Myers
  0 siblings, 2 replies; 4+ messages in thread
From: Carlos Maiolino @ 2012-10-20 14:08 UTC (permalink / raw)
  To: xfs

I found some out of date comments while studying the inode allocation code, so I
believe it's worth to have these comments updated.

It basically rewrites the comment regarding to "call_again" variable, which is
not used anymore, but instead, callers of xfs_ialloc() decides if it needs to be
called again relying only if ialloc_context is NULL or not.

Also did some small changes in another comment that I thought to be pertinent
to the current behaviour of these functions and some alignment on both comments.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 fs/xfs/xfs_ialloc.c |  6 +++---
 fs/xfs/xfs_inode.c  | 18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 445bf1a..f1a6046 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -876,9 +876,9 @@ error0:
  * This function is designed to be called twice if it has to do an allocation
  * to make more free inodes.  On the first call, *IO_agbp should be set to NULL.
  * If an inode is available without having to performn an allocation, an inode
- * number is returned.  In this case, *IO_agbp would be NULL.  If an allocation
- * needes to be done, xfs_dialloc would return the current AGI buffer in
- * *IO_agbp.  The caller should then commit the current transaction, allocate a
+ * number is returned.  In this case, *IO_agbp is set to NULL.  If an allocation
+ * needes to be done, xfs_dialloc returns the current AGI buffer in *IO_agbp.
+ * The caller should then commit the current transaction, allocate a
  * new transaction, and call xfs_dialloc() again, passing in the previous value
  * of *IO_agbp.  IO_agbp should be held across the transactions. Since the AGI
  * buffer is locked across the two calls, the second call is guaranteed to have
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 2778258..07ddaf2 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -853,16 +853,16 @@ xfs_iread_extents(
  * set according to the contents of the given cred structure.
  *
  * Use xfs_dialloc() to allocate the on-disk inode. If xfs_dialloc()
- * has a free inode available, call xfs_iget()
- * to obtain the in-core version of the allocated inode.  Finally,
- * fill in the inode and log its initial contents.  In this case,
- * ialloc_context would be set to NULL and call_again set to false.
+ * has a free inode available, call xfs_iget() to obtain the in-core
+ * version of the allocated inode.  Finally, fill in the inode and
+ * log its initial contents.  In this case, ialloc_context would be
+ * set to NULL.
  *
- * If xfs_dialloc() does not have an available inode,
- * it will replenish its supply by doing an allocation. Since we can
- * only do one allocation within a transaction without deadlocks, we
- * must commit the current transaction before returning the inode itself.
- * In this case, therefore, we will set call_again to true and return.
+ * If xfs_dialloc() does not have an available inode, it will replenish
+ * its supply by doing an allocation. Since we can only do one
+ * allocation within a transaction without deadlocks, we must commit
+ * the current transaction before returning the inode itself.
+ * In this case, therefore, we will set ialloc_context and return.
  * The caller should then commit the current transaction, start a new
  * transaction, and call xfs_ialloc() again to actually get the inode.
  *
-- 
1.7.11.7

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfs: Update inode alloc comments
  2012-10-20 14:08 [PATCH] xfs: Update inode alloc comments Carlos Maiolino
@ 2012-10-23 12:23 ` Christoph Hellwig
  2012-11-02 22:12 ` Ben Myers
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2012-10-23 12:23 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: xfs

On Sat, Oct 20, 2012 at 11:08:19AM -0300, Carlos Maiolino wrote:
> I found some out of date comments while studying the inode allocation code, so I
> believe it's worth to have these comments updated.
> 
> It basically rewrites the comment regarding to "call_again" variable, which is
> not used anymore, but instead, callers of xfs_ialloc() decides if it needs to be
> called again relying only if ialloc_context is NULL or not.
> 
> Also did some small changes in another comment that I thought to be pertinent
> to the current behaviour of these functions and some alignment on both comments.
> 
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfs: Update inode alloc comments
  2012-10-20 14:08 [PATCH] xfs: Update inode alloc comments Carlos Maiolino
  2012-10-23 12:23 ` Christoph Hellwig
@ 2012-11-02 22:12 ` Ben Myers
  2012-11-08 17:45   ` Ben Myers
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Myers @ 2012-11-02 22:12 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: xfs

Hey Carlos,

On Sat, Oct 20, 2012 at 11:08:19AM -0300, Carlos Maiolino wrote:
> I found some out of date comments while studying the inode allocation code, so I
> believe it's worth to have these comments updated.
> 
> It basically rewrites the comment regarding to "call_again" variable, which is
> not used anymore, but instead, callers of xfs_ialloc() decides if it needs to be
> called again relying only if ialloc_context is NULL or not.
> 
> Also did some small changes in another comment that I thought to be pertinent
> to the current behaviour of these functions and some alignment on both comments.
> 
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
>  fs/xfs/xfs_ialloc.c |  6 +++---
>  fs/xfs/xfs_inode.c  | 18 +++++++++---------
>  2 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
> index 445bf1a..f1a6046 100644
> --- a/fs/xfs/xfs_ialloc.c
> +++ b/fs/xfs/xfs_ialloc.c
> @@ -876,9 +876,9 @@ error0:
>   * This function is designed to be called twice if it has to do an allocation
>   * to make more free inodes.  On the first call, *IO_agbp should be set to NULL.
>   * If an inode is available without having to performn an allocation, an inode
> - * number is returned.  In this case, *IO_agbp would be NULL.  If an allocation
> - * needes to be done, xfs_dialloc would return the current AGI buffer in
> - * *IO_agbp.  The caller should then commit the current transaction, allocate a
> + * number is returned.  In this case, *IO_agbp is set to NULL.  If an allocation
> + * needes to be done, xfs_dialloc returns the current AGI buffer in *IO_agbp.
      needs

Since we're at it.

Looks fine.

Reviewed-by: Ben Myers <bpm@sgi.com>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfs: Update inode alloc comments
  2012-11-02 22:12 ` Ben Myers
@ 2012-11-08 17:45   ` Ben Myers
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Myers @ 2012-11-08 17:45 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: xfs

On Fri, Nov 02, 2012 at 05:12:44PM -0500, Ben Myers wrote:
> Hey Carlos,
> 
> On Sat, Oct 20, 2012 at 11:08:19AM -0300, Carlos Maiolino wrote:
> > I found some out of date comments while studying the inode allocation code, so I
> > believe it's worth to have these comments updated.
> > 
> > It basically rewrites the comment regarding to "call_again" variable, which is
> > not used anymore, but instead, callers of xfs_ialloc() decides if it needs to be
> > called again relying only if ialloc_context is NULL or not.
> > 
> > Also did some small changes in another comment that I thought to be pertinent
> > to the current behaviour of these functions and some alignment on both comments.
> > 
> > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> > ---
> >  fs/xfs/xfs_ialloc.c |  6 +++---
> >  fs/xfs/xfs_inode.c  | 18 +++++++++---------
> >  2 files changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
> > index 445bf1a..f1a6046 100644
> > --- a/fs/xfs/xfs_ialloc.c
> > +++ b/fs/xfs/xfs_ialloc.c
> > @@ -876,9 +876,9 @@ error0:
> >   * This function is designed to be called twice if it has to do an allocation
> >   * to make more free inodes.  On the first call, *IO_agbp should be set to NULL.
> >   * If an inode is available without having to performn an allocation, an inode
> > - * number is returned.  In this case, *IO_agbp would be NULL.  If an allocation
> > - * needes to be done, xfs_dialloc would return the current AGI buffer in
> > - * *IO_agbp.  The caller should then commit the current transaction, allocate a
> > + * number is returned.  In this case, *IO_agbp is set to NULL.  If an allocation
> > + * needes to be done, xfs_dialloc returns the current AGI buffer in *IO_agbp.
>       needs
> 
> Since we're at it.
> 
> Looks fine.
> 
> Reviewed-by: Ben Myers <bpm@sgi.com>

Carlos,

Committed this to git://oss.sgi.com/xfs/xfs.git, master & for-next on Nov 2.

-Ben

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2012-11-08 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-20 14:08 [PATCH] xfs: Update inode alloc comments Carlos Maiolino
2012-10-23 12:23 ` Christoph Hellwig
2012-11-02 22:12 ` Ben Myers
2012-11-08 17:45   ` Ben Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox