Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144806
b: refs/heads/master
c: 677c9b2
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Mahoney authored and Al Viro committed May 9, 2009
1 parent d9036d4 commit 32ac9b8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 29 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: b82bb72ba7df473461c5e2368a4e7497c8ce76e9
refs/heads/master: 677c9b2e393a0cd203bd54e9c18b012b2c73305a
24 changes: 13 additions & 11 deletions trunk/fs/reiserfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry,

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

static inline bool is_privroot_deh(struct dentry *dir,
struct reiserfs_de_head *deh)
{
int ret = 0;
#ifdef CONFIG_REISERFS_FS_XATTR
struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root;
ret = (dir == dir->d_parent && privroot->d_inode &&
deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid);
#endif
return ret;
}

int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent,
filldir_t filldir, loff_t *pos)
{
Expand Down Expand Up @@ -138,18 +150,8 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent,
}

/* Ignore the .reiserfs_priv entry */
if (reiserfs_xattrs(inode->i_sb) &&
!old_format_only(inode->i_sb) &&
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) ==
le32_to_cpu(INODE_PKEY
(REISERFS_SB(inode->i_sb)->
priv_root->d_inode)->
k_objectid)) {
if (is_privroot_deh(dentry, deh))
continue;
}

d_off = deh_offset(deh);
*pos = d_off;
Expand Down
17 changes: 2 additions & 15 deletions trunk/fs/reiserfs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,21 +338,8 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry,
&path_to_entry, &de);
pathrelse(&path_to_entry);
if (retval == NAME_FOUND) {
/* Hide the .reiserfs_priv directory */
if (reiserfs_xattrs(dir->i_sb) &&
!old_format_only(dir->i_sb) &&
REISERFS_SB(dir->i_sb)->priv_root &&
REISERFS_SB(dir->i_sb)->priv_root->d_inode &&
de.de_objectid ==
le32_to_cpu(INODE_PKEY
(REISERFS_SB(dir->i_sb)->priv_root->d_inode)->
k_objectid)) {
reiserfs_write_unlock(dir->i_sb);
return ERR_PTR(-EACCES);
}

inode =
reiserfs_iget(dir->i_sb, (struct cpu_key *)&(de.de_dir_id));
inode = reiserfs_iget(dir->i_sb,
(struct cpu_key *)&(de.de_dir_id));
if (!inode || IS_ERR(inode)) {
reiserfs_write_unlock(dir->i_sb);
return ERR_PTR(-EACCES);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/reiserfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size)
if (!dentry->d_inode)
return -EINVAL;

if (!reiserfs_xattrs(dentry->d_sb) ||
if (!dentry->d_sb->s_xattr ||
get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1)
return -EOPNOTSUPP;

Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/reiserfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ enum reiserfs_mount_options {
#define reiserfs_data_log(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_LOG))
#define reiserfs_data_ordered(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_ORDERED))
#define reiserfs_data_writeback(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_WRITEBACK))
#define reiserfs_xattrs(s) ((s)->s_xattr != NULL)
#define reiserfs_xattrs_user(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS_USER))
#define reiserfs_posixacl(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_POSIXACL))
#define reiserfs_xattrs_optional(s) (reiserfs_xattrs_user(s) || reiserfs_posixacl(s))
Expand Down

0 comments on commit 32ac9b8

Please sign in to comment.