diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-06 07:43:13 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-06 07:43:13 -0500 |
commit | b2faf597d93bdf5e2d12d93ea0815935a73f749e (patch) | |
tree | 1876616290ff282b8a0814e2429d23e0104f3701 /fs/xfs/linux-2.6 | |
parent | 638e174688f58200d0deb7435093435e7d737b09 (diff) | |
parent | 410c05427a69f53851637ccb85c2212131409fbd (diff) |
Merge branch 'origin'
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 1 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 8 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 50 |
3 files changed, 41 insertions, 18 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 120626789406..9892268e3005 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -1462,4 +1462,5 @@ struct address_space_operations linvfs_aops = { | |||
1462 | .commit_write = generic_commit_write, | 1462 | .commit_write = generic_commit_write, |
1463 | .bmap = linvfs_bmap, | 1463 | .bmap = linvfs_bmap, |
1464 | .direct_IO = linvfs_direct_IO, | 1464 | .direct_IO = linvfs_direct_IO, |
1465 | .migratepage = buffer_migrate_page, | ||
1465 | }; | 1466 | }; |
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index e44b7c1a3a36..bfb4f2917bb6 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -822,6 +822,13 @@ xfs_buf_rele( | |||
822 | 822 | ||
823 | XB_TRACE(bp, "rele", bp->b_relse); | 823 | XB_TRACE(bp, "rele", bp->b_relse); |
824 | 824 | ||
825 | if (unlikely(!hash)) { | ||
826 | ASSERT(!bp->b_relse); | ||
827 | if (atomic_dec_and_test(&bp->b_hold)) | ||
828 | xfs_buf_free(bp); | ||
829 | return; | ||
830 | } | ||
831 | |||
825 | if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) { | 832 | if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) { |
826 | if (bp->b_relse) { | 833 | if (bp->b_relse) { |
827 | atomic_inc(&bp->b_hold); | 834 | atomic_inc(&bp->b_hold); |
@@ -1514,6 +1521,7 @@ xfs_mapping_buftarg( | |||
1514 | struct address_space *mapping; | 1521 | struct address_space *mapping; |
1515 | static struct address_space_operations mapping_aops = { | 1522 | static struct address_space_operations mapping_aops = { |
1516 | .sync_page = block_sync_page, | 1523 | .sync_page = block_sync_page, |
1524 | .migratepage = fail_migrate_page, | ||
1517 | }; | 1525 | }; |
1518 | 1526 | ||
1519 | inode = new_inode(bdev->bd_inode->i_sb); | 1527 | inode = new_inode(bdev->bd_inode->i_sb); |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 76c6df34d0db..eda7919b70a1 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -262,6 +262,31 @@ has_fs_struct(struct task_struct *task) | |||
262 | return (task->fs != init_task.fs); | 262 | return (task->fs != init_task.fs); |
263 | } | 263 | } |
264 | 264 | ||
265 | STATIC inline void | ||
266 | cleanup_inode( | ||
267 | vnode_t *dvp, | ||
268 | vnode_t *vp, | ||
269 | struct dentry *dentry, | ||
270 | int mode) | ||
271 | { | ||
272 | struct dentry teardown = {}; | ||
273 | int err2; | ||
274 | |||
275 | /* Oh, the horror. | ||
276 | * If we can't add the ACL or we fail in | ||
277 | * linvfs_init_security we must back out. | ||
278 | * ENOSPC can hit here, among other things. | ||
279 | */ | ||
280 | teardown.d_inode = LINVFS_GET_IP(vp); | ||
281 | teardown.d_name = dentry->d_name; | ||
282 | |||
283 | if (S_ISDIR(mode)) | ||
284 | VOP_RMDIR(dvp, &teardown, NULL, err2); | ||
285 | else | ||
286 | VOP_REMOVE(dvp, &teardown, NULL, err2); | ||
287 | VN_RELE(vp); | ||
288 | } | ||
289 | |||
265 | STATIC int | 290 | STATIC int |
266 | linvfs_mknod( | 291 | linvfs_mknod( |
267 | struct inode *dir, | 292 | struct inode *dir, |
@@ -316,30 +341,19 @@ linvfs_mknod( | |||
316 | } | 341 | } |
317 | 342 | ||
318 | if (!error) | 343 | if (!error) |
344 | { | ||
319 | error = linvfs_init_security(vp, dir); | 345 | error = linvfs_init_security(vp, dir); |
346 | if (error) | ||
347 | cleanup_inode(dvp, vp, dentry, mode); | ||
348 | } | ||
320 | 349 | ||
321 | if (default_acl) { | 350 | if (default_acl) { |
322 | if (!error) { | 351 | if (!error) { |
323 | error = _ACL_INHERIT(vp, &va, default_acl); | 352 | error = _ACL_INHERIT(vp, &va, default_acl); |
324 | if (!error) { | 353 | if (!error) |
325 | VMODIFY(vp); | 354 | VMODIFY(vp); |
326 | } else { | 355 | else |
327 | struct dentry teardown = {}; | 356 | cleanup_inode(dvp, vp, dentry, mode); |
328 | int err2; | ||
329 | |||
330 | /* Oh, the horror. | ||
331 | * If we can't add the ACL we must back out. | ||
332 | * ENOSPC can hit here, among other things. | ||
333 | */ | ||
334 | teardown.d_inode = ip = LINVFS_GET_IP(vp); | ||
335 | teardown.d_name = dentry->d_name; | ||
336 | |||
337 | if (S_ISDIR(mode)) | ||
338 | VOP_RMDIR(dvp, &teardown, NULL, err2); | ||
339 | else | ||
340 | VOP_REMOVE(dvp, &teardown, NULL, err2); | ||
341 | VN_RELE(vp); | ||
342 | } | ||
343 | } | 357 | } |
344 | _ACL_FREE(default_acl); | 358 | _ACL_FREE(default_acl); |
345 | } | 359 | } |