Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 216791
b: refs/heads/master
c: fe2fd9e
h: refs/heads/master
i:
  216789: 7e9cdea
  216787: 6169169
  216783: 25be194
v: v3
  • Loading branch information
Boaz Harrosh committed Oct 25, 2010
1 parent a8fb43a commit 92bb128
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 571f7f46bf367b29f574ca51a9ca1db5035602bb
refs/heads/master: fe2fd9ed5bf184f797412be8b86f4589d1b77bb8
28 changes: 9 additions & 19 deletions trunk/fs/exofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,10 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino)
int __exofs_wait_obj_created(struct exofs_i_info *oi)
{
if (!obj_created(oi)) {
EXOFS_DBGMSG("!obj_created\n");
BUG_ON(!obj_2bcreated(oi));
wait_event(oi->i_wq, obj_created(oi));
EXOFS_DBGMSG("wait_event done\n");
}
return unlikely(is_bad_inode(&oi->vfs_inode)) ? -EIO : 0;
}
Expand Down Expand Up @@ -1102,7 +1104,6 @@ static void create_done(struct exofs_io_state *ios, void *p)

set_obj_created(oi);

atomic_dec(&inode->i_count);
wake_up(&oi->i_wq);
}

Expand Down Expand Up @@ -1153,17 +1154,11 @@ struct inode *exofs_new_inode(struct inode *dir, int mode)
ios->obj.id = exofs_oi_objno(oi);
exofs_make_credential(oi->i_cred, &ios->obj);

/* increment the refcount so that the inode will still be around when we
* reach the callback
*/
atomic_inc(&inode->i_count);

ios->done = create_done;
ios->private = inode;
ios->cred = oi->i_cred;
ret = exofs_sbi_create(ios);
if (ret) {
atomic_dec(&inode->i_count);
exofs_put_io_state(ios);
return ERR_PTR(ret);
}
Expand Down Expand Up @@ -1253,12 +1248,7 @@ static int exofs_update_inode(struct inode *inode, int do_sync)
ios->out_attr_len = 1;
ios->out_attr = &attr;

if (!obj_created(oi)) {
EXOFS_DBGMSG("!obj_created\n");
BUG_ON(!obj_2bcreated(oi));
wait_event(oi->i_wq, obj_created(oi));
EXOFS_DBGMSG("wait_event done\n");
}
wait_obj_created(oi);

if (!do_sync) {
args->sbi = sbi;
Expand Down Expand Up @@ -1321,12 +1311,12 @@ void exofs_evict_inode(struct inode *inode)
inode->i_size = 0;
end_writeback(inode);

/* if we are deleting an obj that hasn't been created yet, wait */
if (!obj_created(oi)) {
BUG_ON(!obj_2bcreated(oi));
wait_event(oi->i_wq, obj_created(oi));
/* ignore the error attempt a remove anyway */
}
/* if we are deleting an obj that hasn't been created yet, wait.
* This also makes sure that create_done cannot be called with an
* already evicted inode.
*/
wait_obj_created(oi);
/* ignore the error, attempt a remove anyway */

/* Now Remove the OSD objects */
ret = exofs_get_io_state(&sbi->layout, &ios);
Expand Down

0 comments on commit 92bb128

Please sign in to comment.