Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67737
b: refs/heads/master
c: e7b3401
h: refs/heads/master
i:
  67735: 8aff0cc
v: v3
  • Loading branch information
Mark Fasheh committed Oct 12, 2007
1 parent 69edda3 commit 7605f87
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 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: 5b6a3a2b4a5f071d170f8122038dd647a84810a8
refs/heads/master: e7b34019606ab1dd06196635e931b0c302799228
33 changes: 22 additions & 11 deletions trunk/fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ int __ocfs2_add_entry(handle_t *handle,
static int ocfs2_dir_foreach_blk_id(struct inode *inode,
unsigned long *f_version,
loff_t *f_pos, void *priv,
filldir_t filldir)
filldir_t filldir, int *filldir_err)
{
int ret, i, filldir_ret;
unsigned long offset = *f_pos;
Expand Down Expand Up @@ -659,8 +659,11 @@ static int ocfs2_dir_foreach_blk_id(struct inode *inode,
*f_pos,
le64_to_cpu(de->inode),
d_type);
if (filldir_ret)
if (filldir_ret) {
if (filldir_err)
*filldir_err = filldir_ret;
break;
}
if (version != *f_version)
goto revalidate;
}
Expand All @@ -676,7 +679,7 @@ static int ocfs2_dir_foreach_blk_id(struct inode *inode,
static int ocfs2_dir_foreach_blk_el(struct inode *inode,
unsigned long *f_version,
loff_t *f_pos, void *priv,
filldir_t filldir)
filldir_t filldir, int *filldir_err)
{
int error = 0;
unsigned long offset, blk, last_ra_blk = 0;
Expand Down Expand Up @@ -775,8 +778,11 @@ static int ocfs2_dir_foreach_blk_el(struct inode *inode,
*f_pos,
le64_to_cpu(de->inode),
d_type);
if (error)
if (error) {
if (filldir_err)
*filldir_err = error;
break;
}
if (version != *f_version)
goto revalidate;
stored ++;
Expand All @@ -793,13 +799,15 @@ static int ocfs2_dir_foreach_blk_el(struct inode *inode,
}

static int ocfs2_dir_foreach_blk(struct inode *inode, unsigned long *f_version,
loff_t *f_pos, void *priv, filldir_t filldir)
loff_t *f_pos, void *priv, filldir_t filldir,
int *filldir_err)
{
if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
return ocfs2_dir_foreach_blk_id(inode, f_version, f_pos, priv,
filldir);
filldir, filldir_err);

return ocfs2_dir_foreach_blk_el(inode, f_version, f_pos, priv, filldir);
return ocfs2_dir_foreach_blk_el(inode, f_version, f_pos, priv, filldir,
filldir_err);
}

/*
Expand All @@ -809,16 +817,19 @@ static int ocfs2_dir_foreach_blk(struct inode *inode, unsigned long *f_version,
int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv,
filldir_t filldir)
{
int ret = 0;
int ret = 0, filldir_err = 0;
unsigned long version = inode->i_version;

while (*f_pos < i_size_read(inode)) {
ret = ocfs2_dir_foreach_blk(inode, &version, f_pos, priv,
filldir);
if (ret)
filldir, &filldir_err);
if (ret || filldir_err)
break;
}

if (ret > 0)
ret = -EIO;

return 0;
}

Expand Down Expand Up @@ -852,7 +863,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
}

error = ocfs2_dir_foreach_blk(inode, &filp->f_version, &filp->f_pos,
dirent, filldir);
dirent, filldir, NULL);

ocfs2_meta_unlock(inode, lock_level);

Expand Down

0 comments on commit 7605f87

Please sign in to comment.