summaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-05-17 22:58:58 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 12:56:51 +0400
commitcd62cdae0bd7fb76cae66347dc4fc00e87ffc1c4 (patch)
treeda8c125f785a28479685078620fd0d46d9c071b0 /fs/reiserfs/xattr.c
parent99ce4169a9ff1c6ecdcccf01638eb6d76e5d84d1 (diff)
reiserfs: switch reiserfs_readdir_dentry to inode
... and clean the callers up a bit Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/reiserfs/xattr.c')
-rw-r--r--fs/reiserfs/xattr.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 26648a451e8..c69cdd749f0 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -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) {
@@ -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)