Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377535
b: refs/heads/master
c: cd62cda
h: refs/heads/master
i:
  377533: ff80d38
  377531: e7d6f5b
  377527: 3d3eda5
  377519: f42aec9
  377503: f4c59ba
  377471: 82a3a99
v: v3
  • Loading branch information
Al Viro committed Jun 29, 2013
1 parent e566d50 commit 005edad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 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: 99ce4169a9ff1c6ecdcccf01638eb6d76e5d84d1
refs/heads/master: cd62cdae0bd7fb76cae66347dc4fc00e87ffc1c4
5 changes: 2 additions & 3 deletions trunk/fs/reiserfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ static inline bool is_privroot_deh(struct inode *dir, struct reiserfs_de_head *d
deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid);
}

int reiserfs_readdir_dentry(struct dentry *dentry, struct dir_context *ctx)
int reiserfs_readdir_inode(struct inode *inode, struct dir_context *ctx)
{
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 Down Expand Up @@ -243,7 +242,7 @@ int reiserfs_readdir_dentry(struct dentry *dentry, struct dir_context *ctx)

static int reiserfs_readdir(struct file *file, struct dir_context *ctx)
{
return reiserfs_readdir_dentry(file->f_path.dentry, ctx);
return reiserfs_readdir_inode(file_inode(file), ctx);
}

/* compose directory item containing "." and ".." entries (entries are
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/reiserfs/reiserfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2709,7 +2709,7 @@ extern const struct inode_operations reiserfs_dir_inode_operations;
extern const struct inode_operations reiserfs_symlink_inode_operations;
extern const struct inode_operations reiserfs_special_inode_operations;
extern const struct file_operations reiserfs_dir_operations;
int reiserfs_readdir_dentry(struct dentry *, struct dir_context *);
int reiserfs_readdir_inode(struct inode *, struct dir_context *);

/* tail_conversion.c */
int direct2indirect(struct reiserfs_transaction_handle *, struct inode *,
Expand Down
25 changes: 12 additions & 13 deletions trunk/fs/reiserfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,28 +249,27 @@ static int reiserfs_for_each_xattr(struct inode *inode,
reiserfs_write_lock(inode->i_sb);

buf.xadir = dir;
err = reiserfs_readdir_dentry(dir, &buf.ctx);
while ((err == 0 || err == -ENOSPC) && buf.count) {
err = 0;

for (i = 0; i < buf.count && buf.dentries[i]; i++) {
int lerr = 0;
while (1) {
err = reiserfs_readdir_inode(dir->d_inode, &buf.ctx);
if (err)
break;
if (!buf.count)
break;
for (i = 0; !err && i < buf.count && buf.dentries[i]; i++) {
struct dentry *dentry = buf.dentries[i];

if (err == 0 && !S_ISDIR(dentry->d_inode->i_mode))
lerr = action(dentry, data);
if (!S_ISDIR(dentry->d_inode->i_mode))
err = action(dentry, data);

dput(dentry);
buf.dentries[i] = NULL;
err = lerr ?: err;
}
if (err)
break;
buf.count = 0;
if (!err)
err = reiserfs_readdir_dentry(dir, &buf.ctx);
}
mutex_unlock(&dir->d_inode->i_mutex);

/* Clean up after a failed readdir */
cleanup_dentry_buf(&buf);

if (!err) {
Expand Down Expand Up @@ -868,7 +867,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size)
}

mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_XATTR);
err = reiserfs_readdir_dentry(dir, &buf.ctx);
err = reiserfs_readdir_inode(dir->d_inode, &buf.ctx);
mutex_unlock(&dir->d_inode->i_mutex);

if (!err)
Expand Down

0 comments on commit 005edad

Please sign in to comment.