Commit cd856db6 authored by Carlos Maiolino's avatar Carlos Maiolino Committed by Ben Myers

xfs: Update inode alloc comments

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: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent 531c3bdc
...@@ -877,9 +877,9 @@ xfs_dialloc_ag( ...@@ -877,9 +877,9 @@ xfs_dialloc_ag(
* This function is designed to be called twice if it has to do an allocation * 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. * 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 * 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 * number is returned. In this case, *IO_agbp is set to NULL. If an allocation
* needes to be done, xfs_dialloc would return the current AGI buffer in * needs to be done, xfs_dialloc returns the current AGI buffer in *IO_agbp.
* *IO_agbp. The caller should then commit the current transaction, allocate a * The caller should then commit the current transaction, allocate a
* new transaction, and call xfs_dialloc() again, passing in the previous value * 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 * 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 * buffer is locked across the two calls, the second call is guaranteed to have
......
...@@ -1104,16 +1104,16 @@ xfs_iread_extents( ...@@ -1104,16 +1104,16 @@ xfs_iread_extents(
* set according to the contents of the given cred structure. * set according to the contents of the given cred structure.
* *
* Use xfs_dialloc() to allocate the on-disk inode. If xfs_dialloc() * Use xfs_dialloc() to allocate the on-disk inode. If xfs_dialloc()
* has a free inode available, call xfs_iget() * has a free inode available, call xfs_iget() to obtain the in-core
* to obtain the in-core version of the allocated inode. Finally, * version of the allocated inode. Finally, fill in the inode and
* fill in the inode and log its initial contents. In this case, * log its initial contents. In this case, ialloc_context would be
* ialloc_context would be set to NULL and call_again set to false. * set to NULL.
* *
* If xfs_dialloc() does not have an available inode, * If xfs_dialloc() does not have an available inode, it will replenish
* it will replenish its supply by doing an allocation. Since we can * its supply by doing an allocation. Since we can only do one
* only do one allocation within a transaction without deadlocks, we * allocation within a transaction without deadlocks, we must commit
* must commit the current transaction before returning the inode itself. * the current transaction before returning the inode itself.
* In this case, therefore, we will set call_again to true and return. * In this case, therefore, we will set ialloc_context and return.
* The caller should then commit the current transaction, start a new * The caller should then commit the current transaction, start a new
* transaction, and call xfs_ialloc() again to actually get the inode. * transaction, and call xfs_ialloc() again to actually get the inode.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment