aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr.c
diff options
context:
space:
mode:
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 8c4cf273c672..d78089690965 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -98,14 +98,12 @@ static int xattr_rmdir(struct inode *dir, struct dentry *dentry)
98 98
99 reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex, 99 reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex,
100 I_MUTEX_CHILD, dir->i_sb); 100 I_MUTEX_CHILD, dir->i_sb);
101 dentry_unhash(dentry);
102 error = dir->i_op->rmdir(dir, dentry); 101 error = dir->i_op->rmdir(dir, dentry);
103 if (!error) 102 if (!error)
104 dentry->d_inode->i_flags |= S_DEAD; 103 dentry->d_inode->i_flags |= S_DEAD;
105 mutex_unlock(&dentry->d_inode->i_mutex); 104 mutex_unlock(&dentry->d_inode->i_mutex);
106 if (!error) 105 if (!error)
107 d_delete(dentry); 106 d_delete(dentry);
108 dput(dentry);
109 107
110 return error; 108 return error;
111} 109}
@@ -396,7 +394,7 @@ static struct page *reiserfs_get_page(struct inode *dir, size_t n)
396 struct address_space *mapping = dir->i_mapping; 394 struct address_space *mapping = dir->i_mapping;
397 struct page *page; 395 struct page *page;
398 /* We can deadlock if we try to free dentries, 396 /* We can deadlock if we try to free dentries,
399 and an unlink/rmdir has just occured - GFP_NOFS avoids this */ 397 and an unlink/rmdir has just occurred - GFP_NOFS avoids this */
400 mapping_set_gfp_mask(mapping, GFP_NOFS); 398 mapping_set_gfp_mask(mapping, GFP_NOFS);
401 page = read_mapping_page(mapping, n >> PAGE_CACHE_SHIFT, NULL); 399 page = read_mapping_page(mapping, n >> PAGE_CACHE_SHIFT, NULL);
402 if (!IS_ERR(page)) { 400 if (!IS_ERR(page)) {
@@ -418,13 +416,11 @@ static inline __u32 xattr_hash(const char *msg, int len)
418 416
419int reiserfs_commit_write(struct file *f, struct page *page, 417int reiserfs_commit_write(struct file *f, struct page *page,
420 unsigned from, unsigned to); 418 unsigned from, unsigned to);
421int reiserfs_prepare_write(struct file *f, struct page *page,
422 unsigned from, unsigned to);
423 419
424static void update_ctime(struct inode *inode) 420static void update_ctime(struct inode *inode)
425{ 421{
426 struct timespec now = current_fs_time(inode->i_sb); 422 struct timespec now = current_fs_time(inode->i_sb);
427 if (hlist_unhashed(&inode->i_hash) || !inode->i_nlink || 423 if (inode_unhashed(inode) || !inode->i_nlink ||
428 timespec_equal(&inode->i_ctime, &now)) 424 timespec_equal(&inode->i_ctime, &now))
429 return; 425 return;
430 426
@@ -532,8 +528,7 @@ reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *th,
532 rxh->h_hash = cpu_to_le32(xahash); 528 rxh->h_hash = cpu_to_le32(xahash);
533 } 529 }
534 530
535 err = reiserfs_prepare_write(NULL, page, page_offset, 531 err = __reiserfs_write_begin(page, page_offset, chunk + skip);
536 page_offset + chunk + skip);
537 if (!err) { 532 if (!err) {
538 if (buffer) 533 if (buffer)
539 memcpy(data + skip, buffer + buffer_pos, chunk); 534 memcpy(data + skip, buffer + buffer_pos, chunk);
@@ -873,11 +868,14 @@ out:
873 return err; 868 return err;
874} 869}
875 870
876static int reiserfs_check_acl(struct inode *inode, int mask) 871static int reiserfs_check_acl(struct inode *inode, int mask, unsigned int flags)
877{ 872{
878 struct posix_acl *acl; 873 struct posix_acl *acl;
879 int error = -EAGAIN; /* do regular unix permission checks by default */ 874 int error = -EAGAIN; /* do regular unix permission checks by default */
880 875
876 if (flags & IPERM_FLAG_RCU)
877 return -ECHILD;
878
881 acl = reiserfs_get_acl(inode, ACL_TYPE_ACCESS); 879 acl = reiserfs_get_acl(inode, ACL_TYPE_ACCESS);
882 880
883 if (acl) { 881 if (acl) {
@@ -954,7 +952,7 @@ static int xattr_mount_check(struct super_block *s)
954 return 0; 952 return 0;
955} 953}
956 954
957int reiserfs_permission(struct inode *inode, int mask) 955int reiserfs_permission(struct inode *inode, int mask, unsigned int flags)
958{ 956{
959 /* 957 /*
960 * We don't do permission checks on the internal objects. 958 * We don't do permission checks on the internal objects.
@@ -968,9 +966,10 @@ int reiserfs_permission(struct inode *inode, int mask)
968 * Stat data v1 doesn't support ACLs. 966 * Stat data v1 doesn't support ACLs.
969 */ 967 */
970 if (get_inode_sd_version(inode) != STAT_DATA_V1) 968 if (get_inode_sd_version(inode) != STAT_DATA_V1)
971 return generic_permission(inode, mask, reiserfs_check_acl); 969 return generic_permission(inode, mask, flags,
970 reiserfs_check_acl);
972#endif 971#endif
973 return generic_permission(inode, mask, NULL); 972 return generic_permission(inode, mask, flags, NULL);
974} 973}
975 974
976static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd) 975static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd)
@@ -993,7 +992,7 @@ int reiserfs_lookup_privroot(struct super_block *s)
993 strlen(PRIVROOT_NAME)); 992 strlen(PRIVROOT_NAME));
994 if (!IS_ERR(dentry)) { 993 if (!IS_ERR(dentry)) {
995 REISERFS_SB(s)->priv_root = dentry; 994 REISERFS_SB(s)->priv_root = dentry;
996 dentry->d_op = &xattr_lookup_poison_ops; 995 d_set_d_op(dentry, &xattr_lookup_poison_ops);
997 if (dentry->d_inode) 996 if (dentry->d_inode)
998 dentry->d_inode->i_flags |= S_PRIVATE; 997 dentry->d_inode->i_flags |= S_PRIVATE;
999 } else 998 } else