reiserfs: eliminate per-super xattr lock
PATCH 3/11 reiserfs: eliminate per-super xattr lock
With the switch to using inode->i_mutex locking during lookups/creation in the xattr root, the per-super xattr lock is no longer needed.
This patch removes it.
fs/reiserfs/inode.c | 12 ------ fs/reiserfs/namei.c | 29 ---------------- fs/reiserfs/super.c | 2 - fs/reiserfs/xattr.c | 44 ++++-------------------- fs/reiserfs/xattr_acl.c | 74 ++++++++++++++++++----------------------- include/linux/reiserfs_fs.h | 3 - include/linux/reiserfs_fs_sb.h | 1 include/linux/reiserfs_xattr.h | 18 --------- 8 files changed, 42 insertions(+), 141 deletions(-)
Signed-off-by Jeff Mahoney <[email protected]>
fs/reiserfs/inode.c +1 -11
@@ -1987,17 +1987,7 @@ int reiserfs_new_inode(struct reiserfs_t out_inserted_sd: inode->i_nlink =0 ; th->t_trans_id =0 ;/* so the caller can't use this handle later */ - -/* If we were inheriting an ACL, we need to release the lock so that -* iput doesn't deadlock in reiserfs_delete_xattrs. The locking -* code really needs to be reworked, but this will take care of it -* for now. -jeffm */ -if (REISERFS_I (dir)->i_acl_default && !IS_ERR (REISERFS_I (dir)->i_acl_default)) { -reiserfs_write_unlock_xattrs (dir->i_sb); -iput (inode); -reiserfs_write_lock_xattrs (dir->i_sb); - }else -iput (inode); +iput (inode);return err; }
fs/reiserfs/namei.c +0 -29
@@ -626,9 +626,6 @@ static int reiserfs_create(struct inodereiserfs_write_lock (dir->i_sb); -if (locked) -reiserfs_write_lock_xattrs (dir->i_sb); - retval =journal_begin (&th, dir->i_sb, jbegin_count);if (retval) {drop_new_inode (inode);
@@ -641,11 +638,6 @@ static int reiserfs_create(struct inodeif (retval) goto out_failed; -if (locked) { -reiserfs_write_unlock_xattrs (dir->i_sb); - locked =0 ; - } - inode->i_op = &reiserfs_file_inode_operations; inode->i_fop = &reiserfs_file_operations; inode->i_mapping->a_ops = &reiserfs_address_space_operations;
@@ -670,8 +662,6 @@ static int reiserfs_create(struct inode retval =journal_end (&th, dir->i_sb, jbegin_count); out_failed: -if (locked) -reiserfs_write_unlock_xattrs (dir->i_sb);reiserfs_write_unlock (dir->i_sb);return retval; }
@@ -701,9 +691,6 @@ static int reiserfs_mknod(struct inode *reiserfs_write_lock (dir->i_sb); -if (locked) -reiserfs_write_lock_xattrs (dir->i_sb); - retval =journal_begin (&th, dir->i_sb, jbegin_count);if (retval) {drop_new_inode (inode);
@@ -717,11 +704,6 @@ static int reiserfs_mknod(struct inode * goto out_failed; } -if (locked) { -reiserfs_write_unlock_xattrs (dir->i_sb); - locked =0 ; - } - inode->i_op = &reiserfs_special_inode_operations;init_special_inode (inode, inode->i_mode, rdev);
@@ -749,8 +731,6 @@ static int reiserfs_mknod(struct inode * retval =journal_end (&th, dir->i_sb, jbegin_count); out_failed: -if (locked) -reiserfs_write_unlock_xattrs (dir->i_sb);reiserfs_write_unlock (dir->i_sb);return retval; }
@@ -780,8 +760,6 @@ static int reiserfs_mkdir(struct inode * locked =reiserfs_cache_default_acl (dir);reiserfs_write_lock (dir->i_sb); -if (locked) -reiserfs_write_lock_xattrs (dir->i_sb); retval =journal_begin (&th, dir->i_sb, jbegin_count);if (retval) {
@@ -803,11 +781,6 @@ static int reiserfs_mkdir(struct inode * goto out_failed; } -if (locked) { -reiserfs_write_unlock_xattrs (dir->i_sb); - locked =0 ; - } -reiserfs_update_inode_transaction (inode);reiserfs_update_inode_transaction (dir);
@@ -835,8 +808,6 @@ static int reiserfs_mkdir(struct inode *d_instantiate (dentry, inode); retval =journal_end (&th, dir->i_sb, jbegin_count); out_failed: -if (locked) -reiserfs_write_unlock_xattrs (dir->i_sb);reiserfs_write_unlock (dir->i_sb);return retval; }
fs/reiserfs/super.c +0 -2
@@ -1696,8 +1696,6 @@ static int reiserfs_fill_super(struct suREISERFS_SB (s)->s_alloc_options.preallocmin =0 ;/* Preallocate by 16 blocks (17-1) at once */ REISERFS_SB (s)->s_alloc_options.preallocsize =17 ; -/* Initialize the rwsem for xattr dir */ -init_rwsem (&REISERFS_SB (s)->xattr_dir_sem);/* setup default block allocator options */ reiserfs_init_alloc_options (s);
fs/reiserfs/xattr_acl.c +33 -41
136 lines not on this page · raw message
fs/reiserfs/xattr.c +8 -36
173 lines not on this page · raw message
include/linux/reiserfs_fs.h +0 -3
@@ -2180,7 +2180,4 @@ int reiserfs_ioctl(struct inode *inode,#define reiserfs_write_lock ( sb ) lock_kernel()#define reiserfs_write_unlock ( sb ) unlock_kernel() -/* xattr stuff */ -#define REISERFS_XATTR_DIR_SEM (s) (REISERFS_SB(s)->xattr_dir_sem) -#endif /* _LINUX_REISER_FS_H */
include/linux/reiserfs_fs_sb.h +0 -1
@@ -402,7 +402,6 @@ struct reiserfs_sb_info {spinlock_t bitmap_lock;/* this lock on now only used to protect reserved_blocks variable */ struct dentry *priv_root;/* root of /.reiserfs_priv */ struct dentry *xattr_root;/* root of /.reiserfs_priv/.xa */ -struct rw_semaphore xattr_dir_sem;int j_errno;#ifdef CONFIG_QUOTA
include/linux/reiserfs_xattr.h +0 -18
@@ -57,24 +57,6 @@ extern struct reiserfs_xattr_handler secint reiserfs_xattr_register_handlers (void )__init ;void reiserfs_xattr_unregister_handlers (void ); -static inline void reiserfs_write_lock_xattrs (struct super_block *sb) -{ -down_write (&REISERFS_XATTR_DIR_SEM (sb)); -} -static inline void reiserfs_write_unlock_xattrs (struct super_block *sb) -{ -up_write (&REISERFS_XATTR_DIR_SEM (sb)); -} -static inline void reiserfs_read_lock_xattrs (struct super_block *sb) -{ -down_read (&REISERFS_XATTR_DIR_SEM (sb)); -} - -static inline void reiserfs_read_unlock_xattrs (struct super_block *sb) -{ -up_read (&REISERFS_XATTR_DIR_SEM (sb)); -} -static inline void reiserfs_write_lock_xattr_i (struct inode *inode) {down_write (&REISERFS_I (inode)->xattr_sem);