diff options
author | Carlos Maiolino <cmaiolino@redhat.com> | 2012-10-20 10:08:19 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-11-02 18:13:12 -0400 |
commit | cd856db69c88db438215244571957d812bdc6813 (patch) | |
tree | bcd2dd9011439cb7ea072386c7f6575a225b7579 /fs/xfs | |
parent | 531c3bdc8662e1a83f8ec80dc3346b1284877c0a (diff) |
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: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_ialloc.c | 6 | ||||
-rw-r--r-- | 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 c5c4ef4f2bdb..37753e1c8537 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -877,9 +877,9 @@ error0: | |||
877 | * This function is designed to be called twice if it has to do an allocation | 877 | * This function is designed to be called twice if it has to do an allocation |
878 | * to make more free inodes. On the first call, *IO_agbp should be set to NULL. | 878 | * to make more free inodes. On the first call, *IO_agbp should be set to NULL. |
879 | * If an inode is available without having to performn an allocation, an inode | 879 | * If an inode is available without having to performn an allocation, an inode |
880 | * number is returned. In this case, *IO_agbp would be NULL. If an allocation | 880 | * number is returned. In this case, *IO_agbp is set to NULL. If an allocation |
881 | * needes to be done, xfs_dialloc would return the current AGI buffer in | 881 | * needs to be done, xfs_dialloc returns the current AGI buffer in *IO_agbp. |
882 | * *IO_agbp. The caller should then commit the current transaction, allocate a | 882 | * The caller should then commit the current transaction, allocate a |
883 | * new transaction, and call xfs_dialloc() again, passing in the previous value | 883 | * new transaction, and call xfs_dialloc() again, passing in the previous value |
884 | * of *IO_agbp. IO_agbp should be held across the transactions. Since the AGI | 884 | * of *IO_agbp. IO_agbp should be held across the transactions. Since the AGI |
885 | * buffer is locked across the two calls, the second call is guaranteed to have | 885 | * 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 bba8f37525b3..95f7a73b05cb 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -1104,16 +1104,16 @@ xfs_iread_extents( | |||
1104 | * set according to the contents of the given cred structure. | 1104 | * set according to the contents of the given cred structure. |
1105 | * | 1105 | * |
1106 | * Use xfs_dialloc() to allocate the on-disk inode. If xfs_dialloc() | 1106 | * Use xfs_dialloc() to allocate the on-disk inode. If xfs_dialloc() |
1107 | * has a free inode available, call xfs_iget() | 1107 | * has a free inode available, call xfs_iget() to obtain the in-core |
1108 | * to obtain the in-core version of the allocated inode. Finally, | 1108 | * version of the allocated inode. Finally, fill in the inode and |
1109 | * fill in the inode and log its initial contents. In this case, | 1109 | * log its initial contents. In this case, ialloc_context would be |
1110 | * ialloc_context would be set to NULL and call_again set to false. | 1110 | * set to NULL. |
1111 | * | 1111 | * |
1112 | * If xfs_dialloc() does not have an available inode, | 1112 | * If xfs_dialloc() does not have an available inode, it will replenish |
1113 | * it will replenish its supply by doing an allocation. Since we can | 1113 | * its supply by doing an allocation. Since we can only do one |
1114 | * only do one allocation within a transaction without deadlocks, we | 1114 | * allocation within a transaction without deadlocks, we must commit |
1115 | * must commit the current transaction before returning the inode itself. | 1115 | * the current transaction before returning the inode itself. |
1116 | * In this case, therefore, we will set call_again to true and return. | 1116 | * In this case, therefore, we will set ialloc_context and return. |
1117 | * The caller should then commit the current transaction, start a new | 1117 | * The caller should then commit the current transaction, start a new |
1118 | * transaction, and call xfs_ialloc() again to actually get the inode. | 1118 | * transaction, and call xfs_ialloc() again to actually get the inode. |
1119 | * | 1119 | * |