diff options
Diffstat (limited to 'fs/xfs/xfs_utils.c')
-rw-r--r-- | fs/xfs/xfs_utils.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c index 4e5b9ad5cb97..0025c78ac03c 100644 --- a/fs/xfs/xfs_utils.c +++ b/fs/xfs/xfs_utils.c | |||
@@ -65,7 +65,6 @@ xfs_dir_ialloc( | |||
65 | xfs_trans_t *ntp; | 65 | xfs_trans_t *ntp; |
66 | xfs_inode_t *ip; | 66 | xfs_inode_t *ip; |
67 | xfs_buf_t *ialloc_context = NULL; | 67 | xfs_buf_t *ialloc_context = NULL; |
68 | boolean_t call_again = B_FALSE; | ||
69 | int code; | 68 | int code; |
70 | uint log_res; | 69 | uint log_res; |
71 | uint log_count; | 70 | uint log_count; |
@@ -91,7 +90,7 @@ xfs_dir_ialloc( | |||
91 | * the inode(s) that we've just allocated. | 90 | * the inode(s) that we've just allocated. |
92 | */ | 91 | */ |
93 | code = xfs_ialloc(tp, dp, mode, nlink, rdev, prid, okalloc, | 92 | code = xfs_ialloc(tp, dp, mode, nlink, rdev, prid, okalloc, |
94 | &ialloc_context, &call_again, &ip); | 93 | &ialloc_context, &ip); |
95 | 94 | ||
96 | /* | 95 | /* |
97 | * Return an error if we were unable to allocate a new inode. | 96 | * Return an error if we were unable to allocate a new inode. |
@@ -102,19 +101,18 @@ xfs_dir_ialloc( | |||
102 | *ipp = NULL; | 101 | *ipp = NULL; |
103 | return code; | 102 | return code; |
104 | } | 103 | } |
105 | if (!call_again && (ip == NULL)) { | 104 | if (!ialloc_context && !ip) { |
106 | *ipp = NULL; | 105 | *ipp = NULL; |
107 | return XFS_ERROR(ENOSPC); | 106 | return XFS_ERROR(ENOSPC); |
108 | } | 107 | } |
109 | 108 | ||
110 | /* | 109 | /* |
111 | * If call_again is set, then we were unable to get an | 110 | * If the AGI buffer is non-NULL, then we were unable to get an |
112 | * inode in one operation. We need to commit the current | 111 | * inode in one operation. We need to commit the current |
113 | * transaction and call xfs_ialloc() again. It is guaranteed | 112 | * transaction and call xfs_ialloc() again. It is guaranteed |
114 | * to succeed the second time. | 113 | * to succeed the second time. |
115 | */ | 114 | */ |
116 | if (call_again) { | 115 | if (ialloc_context) { |
117 | |||
118 | /* | 116 | /* |
119 | * Normally, xfs_trans_commit releases all the locks. | 117 | * Normally, xfs_trans_commit releases all the locks. |
120 | * We call bhold to hang on to the ialloc_context across | 118 | * We call bhold to hang on to the ialloc_context across |
@@ -195,7 +193,7 @@ xfs_dir_ialloc( | |||
195 | * this call should always succeed. | 193 | * this call should always succeed. |
196 | */ | 194 | */ |
197 | code = xfs_ialloc(tp, dp, mode, nlink, rdev, prid, | 195 | code = xfs_ialloc(tp, dp, mode, nlink, rdev, prid, |
198 | okalloc, &ialloc_context, &call_again, &ip); | 196 | okalloc, &ialloc_context, &ip); |
199 | 197 | ||
200 | /* | 198 | /* |
201 | * If we get an error at this point, return to the caller | 199 | * If we get an error at this point, return to the caller |
@@ -206,12 +204,11 @@ xfs_dir_ialloc( | |||
206 | *ipp = NULL; | 204 | *ipp = NULL; |
207 | return code; | 205 | return code; |
208 | } | 206 | } |
209 | ASSERT ((!call_again) && (ip != NULL)); | 207 | ASSERT(!ialloc_context && ip); |
210 | 208 | ||
211 | } else { | 209 | } else { |
212 | if (committed != NULL) { | 210 | if (committed != NULL) |
213 | *committed = 0; | 211 | *committed = 0; |
214 | } | ||
215 | } | 212 | } |
216 | 213 | ||
217 | *ipp = ip; | 214 | *ipp = ip; |