Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138861
b: refs/heads/master
c: a41f1a4
h: refs/heads/master
i:
  138859: b1db877
v: v3
  • Loading branch information
Jeff Mahoney authored and Linus Torvalds committed Mar 30, 2009
1 parent 047dc58 commit 2367be5
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 301 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: 0ab2621ebd9a28bf7a524ecd50d492a10579dfcc
refs/heads/master: a41f1a4715f26f7bc4d047d0bc7710145c8e69c7
28 changes: 15 additions & 13 deletions trunk/fs/reiserfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry,

#define store_ih(where,what) copy_item_head (where, what)

//
static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent,
filldir_t filldir, loff_t *pos)
{
struct inode *inode = filp->f_path.dentry->d_inode;
struct inode *inode = dentry->d_inode;
struct cpu_key pos_key; /* key of current position in the directory (key of directory entry) */
INITIALIZE_PATH(path_to_entry);
struct buffer_head *bh;
Expand All @@ -64,13 +64,9 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)

/* form key for search the next directory entry using f_pos field of
file structure */
make_cpu_key(&pos_key, inode,
(filp->f_pos) ? (filp->f_pos) : DOT_OFFSET, TYPE_DIRENTRY,
3);
make_cpu_key(&pos_key, inode, *pos ?: DOT_OFFSET, TYPE_DIRENTRY, 3);
next_pos = cpu_key_k_offset(&pos_key);

/* reiserfs_warning (inode->i_sb, "reiserfs_readdir 1: f_pos = %Ld", filp->f_pos); */

path_to_entry.reada = PATH_READA;
while (1) {
research:
Expand Down Expand Up @@ -144,7 +140,7 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
/* Ignore the .reiserfs_priv entry */
if (reiserfs_xattrs(inode->i_sb) &&
!old_format_only(inode->i_sb) &&
filp->f_path.dentry == inode->i_sb->s_root &&
dentry == inode->i_sb->s_root &&
REISERFS_SB(inode->i_sb)->priv_root &&
REISERFS_SB(inode->i_sb)->priv_root->d_inode
&& deh_objectid(deh) ==
Expand All @@ -156,7 +152,7 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
}

d_off = deh_offset(deh);
filp->f_pos = d_off;
*pos = d_off;
d_ino = deh_objectid(deh);
if (d_reclen <= 32) {
local_buf = small_buf;
Expand Down Expand Up @@ -223,15 +219,21 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)

} /* while */

end:
filp->f_pos = next_pos;
end:
*pos = next_pos;
pathrelse(&path_to_entry);
reiserfs_check_path(&path_to_entry);
out:
out:
reiserfs_write_unlock(inode->i_sb);
return ret;
}

static int reiserfs_readdir(struct file *file, void *dirent, filldir_t filldir)
{
struct dentry *dentry = file->f_path.dentry;
return reiserfs_readdir_dentry(dentry, dirent, filldir, &file->f_pos);
}

/* compose directory item containing "." and ".." entries (entries are
not aligned to 4 byte boundary) */
/* the last four params are LE */
Expand Down
Loading

0 comments on commit 2367be5

Please sign in to comment.