Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
GFS2: Use DEFINE_SPINLOCK
GFS2: cleanup file_operations mess
GFS2: Move umount flush rwsem
GFS2: Fix symlink creation race
GFS2: Make quotad's waiting interruptible

+24 -21
+5 -5
fs/gfs2/glock.c
··· 597 597 598 598 GLOCK_BUG_ON(gl, test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)); 599 599 600 - down_read(&gfs2_umount_flush_sem); 601 600 if (test_bit(GLF_DEMOTE, &gl->gl_flags) && 602 601 gl->gl_demote_state != gl->gl_state) { 603 602 if (find_first_holder(gl)) ··· 613 614 if (ret == 0) 614 615 goto out_unlock; 615 616 if (ret == 2) 616 - goto out_sem; 617 + goto out; 617 618 gh = find_first_waiter(gl); 618 619 gl->gl_target = gh->gh_state; 619 620 if (!(gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))) 620 621 do_error(gl, 0); /* Fail queued try locks */ 621 622 } 622 623 do_xmote(gl, gh, gl->gl_target); 623 - out_sem: 624 - up_read(&gfs2_umount_flush_sem); 624 + out: 625 625 return; 626 626 627 627 out_sched: ··· 629 631 gfs2_glock_put(gl); 630 632 out_unlock: 631 633 clear_bit(GLF_LOCK, &gl->gl_flags); 632 - goto out_sem; 634 + goto out; 633 635 } 634 636 635 637 static void glock_work_func(struct work_struct *work) ··· 639 641 640 642 if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) 641 643 finish_xmote(gl, gl->gl_reply); 644 + down_read(&gfs2_umount_flush_sem); 642 645 spin_lock(&gl->gl_spin); 643 646 if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && 644 647 gl->gl_state != LM_ST_UNLOCKED && ··· 652 653 } 653 654 run_queue(gl, 0); 654 655 spin_unlock(&gl->gl_spin); 656 + up_read(&gfs2_umount_flush_sem); 655 657 if (!delay || 656 658 queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0) 657 659 gfs2_glock_put(gl);
+4 -4
fs/gfs2/inode.c
··· 137 137 if (S_ISREG(mode)) { 138 138 inode->i_op = &gfs2_file_iops; 139 139 if (gfs2_localflocks(sdp)) 140 - inode->i_fop = gfs2_file_fops_nolock; 140 + inode->i_fop = &gfs2_file_fops_nolock; 141 141 else 142 - inode->i_fop = gfs2_file_fops; 142 + inode->i_fop = &gfs2_file_fops; 143 143 } else if (S_ISDIR(mode)) { 144 144 inode->i_op = &gfs2_dir_iops; 145 145 if (gfs2_localflocks(sdp)) 146 - inode->i_fop = gfs2_dir_fops_nolock; 146 + inode->i_fop = &gfs2_dir_fops_nolock; 147 147 else 148 - inode->i_fop = gfs2_dir_fops; 148 + inode->i_fop = &gfs2_dir_fops; 149 149 } else if (S_ISLNK(mode)) { 150 150 inode->i_op = &gfs2_symlink_iops; 151 151 } else {
+8 -6
fs/gfs2/inode.h
··· 101 101 extern const struct inode_operations gfs2_file_iops; 102 102 extern const struct inode_operations gfs2_dir_iops; 103 103 extern const struct inode_operations gfs2_symlink_iops; 104 - extern const struct file_operations *gfs2_file_fops_nolock; 105 - extern const struct file_operations *gfs2_dir_fops_nolock; 104 + extern const struct file_operations gfs2_file_fops_nolock; 105 + extern const struct file_operations gfs2_dir_fops_nolock; 106 106 107 107 extern void gfs2_set_inode_flags(struct inode *inode); 108 108 109 109 #ifdef CONFIG_GFS2_FS_LOCKING_DLM 110 - extern const struct file_operations *gfs2_file_fops; 111 - extern const struct file_operations *gfs2_dir_fops; 110 + extern const struct file_operations gfs2_file_fops; 111 + extern const struct file_operations gfs2_dir_fops; 112 + 112 113 static inline int gfs2_localflocks(const struct gfs2_sbd *sdp) 113 114 { 114 115 return sdp->sd_args.ar_localflocks; 115 116 } 116 117 #else /* Single node only */ 117 - #define gfs2_file_fops NULL 118 - #define gfs2_dir_fops NULL 118 + #define gfs2_file_fops gfs2_file_fops_nolock 119 + #define gfs2_dir_fops gfs2_dir_fops_nolock 120 + 119 121 static inline int gfs2_localflocks(const struct gfs2_sbd *sdp) 120 122 { 121 123 return 1;
+4 -4
fs/gfs2/ops_file.c
··· 705 705 } 706 706 } 707 707 708 - const struct file_operations *gfs2_file_fops = &(const struct file_operations){ 708 + const struct file_operations gfs2_file_fops = { 709 709 .llseek = gfs2_llseek, 710 710 .read = do_sync_read, 711 711 .aio_read = generic_file_aio_read, ··· 723 723 .setlease = gfs2_setlease, 724 724 }; 725 725 726 - const struct file_operations *gfs2_dir_fops = &(const struct file_operations){ 726 + const struct file_operations gfs2_dir_fops = { 727 727 .readdir = gfs2_readdir, 728 728 .unlocked_ioctl = gfs2_ioctl, 729 729 .open = gfs2_open, ··· 735 735 736 736 #endif /* CONFIG_GFS2_FS_LOCKING_DLM */ 737 737 738 - const struct file_operations *gfs2_file_fops_nolock = &(const struct file_operations){ 738 + const struct file_operations gfs2_file_fops_nolock = { 739 739 .llseek = gfs2_llseek, 740 740 .read = do_sync_read, 741 741 .aio_read = generic_file_aio_read, ··· 751 751 .setlease = generic_setlease, 752 752 }; 753 753 754 - const struct file_operations *gfs2_dir_fops_nolock = &(const struct file_operations){ 754 + const struct file_operations gfs2_dir_fops_nolock = { 755 755 .readdir = gfs2_readdir, 756 756 .unlocked_ioctl = gfs2_ioctl, 757 757 .open = gfs2_open,
+1
fs/gfs2/ops_inode.c
··· 371 371 ip = ghs[1].gh_gl->gl_object; 372 372 373 373 ip->i_disksize = size; 374 + i_size_write(inode, size); 374 375 375 376 error = gfs2_meta_inode_buffer(ip, &dibh); 376 377
+2 -2
fs/gfs2/quota.c
··· 81 81 82 82 static LIST_HEAD(qd_lru_list); 83 83 static atomic_t qd_lru_count = ATOMIC_INIT(0); 84 - static spinlock_t qd_lru_lock = SPIN_LOCK_UNLOCKED; 84 + static DEFINE_SPINLOCK(qd_lru_lock); 85 85 86 86 int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask) 87 87 { ··· 1364 1364 refrigerator(); 1365 1365 t = min(quotad_timeo, statfs_timeo); 1366 1366 1367 - prepare_to_wait(&sdp->sd_quota_wait, &wait, TASK_UNINTERRUPTIBLE); 1367 + prepare_to_wait(&sdp->sd_quota_wait, &wait, TASK_INTERRUPTIBLE); 1368 1368 spin_lock(&sdp->sd_trunc_lock); 1369 1369 empty = list_empty(&sdp->sd_trunc_list); 1370 1370 spin_unlock(&sdp->sd_trunc_lock);