aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_utils.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 16:37:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 16:37:53 -0400
commit37cd9600a9e20359b0283983c9e3a55d84347168 (patch)
treefea12ce0ecbaf417b0d835b3cbee14e973103fad /fs/xfs/xfs_utils.c
parent95b18e69950ca7fd9acfa55964e929f58bec9379 (diff)
parent9a57fa8ee7c29e11c2a29ce058573ba99157eda7 (diff)
Merge tag 'for-linus-v3.6-rc1' of git://oss.sgi.com/xfs/xfs
Pull xfs update from Ben Myers: "Numerous cleanups and several bug fixes. Here are some highlights: - Discontiguous directory buffer support - Inode allocator refactoring - Removal of the IO lock in inode reclaim - Implementation of .update_time - Fix for handling of EOF in xfs_vm_writepage - Fix for races in xfsaild, and idle mode is re-enabled - Fix for a crash in xfs_buf completion handlers on unmount." Fix up trivial conflicts in fs/xfs/{xfs_buf.c,xfs_log.c,xfs_log_priv.h} due to duplicate patches that had already been merged for 3.5. * tag 'for-linus-v3.6-rc1' of git://oss.sgi.com/xfs/xfs: (44 commits) xfs: wait for the write the superblock on unmount xfs: re-enable xfsaild idle mode and fix associated races xfs: remove iolock lock classes xfs: avoid the iolock in xfs_free_eofblocks for evicted inodes xfs: do not take the iolock in xfs_inactive xfs: remove xfs_inactive_attrs xfs: clean up xfs_inactive xfs: do not read the AGI buffer in xfs_dialloc until nessecary xfs: refactor xfs_ialloc_ag_select xfs: add a short cut to xfs_dialloc for the non-NULL agbp case xfs: remove the alloc_done argument to xfs_dialloc xfs: split xfs_dialloc xfs: remove xfs_ialloc_find_free Prefix IO_XX flags with XFS_IO_XX to avoid namespace colision. xfs: remove xfs_inotobp xfs: merge xfs_itobp into xfs_imap_to_bp xfs: handle EOF correctly in xfs_vm_writepage xfs: implement ->update_time xfs: fix comment typo of struct xfs_da_blkinfo. xfs: do not call xfs_bdstrat_cb in xfs_buf_iodone_callbacks ...
Diffstat (limited to 'fs/xfs/xfs_utils.c')
-rw-r--r--fs/xfs/xfs_utils.c17
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;