aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3')
-rw-r--r--fs/ext3/ialloc.c8
-rw-r--r--fs/ext3/ioctl.c3
-rw-r--r--fs/ext3/namei.c4
-rw-r--r--fs/ext3/super.c26
4 files changed, 19 insertions, 22 deletions
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
index 5655fbcbd11f..8de6c720e510 100644
--- a/fs/ext3/ialloc.c
+++ b/fs/ext3/ialloc.c
@@ -559,12 +559,8 @@ got:
559 ei->i_dir_start_lookup = 0; 559 ei->i_dir_start_lookup = 0;
560 ei->i_disksize = 0; 560 ei->i_disksize = 0;
561 561
562 ei->i_flags = EXT3_I(dir)->i_flags & ~EXT3_INDEX_FL; 562 ei->i_flags =
563 if (S_ISLNK(mode)) 563 ext3_mask_flags(mode, EXT3_I(dir)->i_flags & EXT3_FL_INHERITED);
564 ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
565 /* dirsync only applies to directories */
566 if (!S_ISDIR(mode))
567 ei->i_flags &= ~EXT3_DIRSYNC_FL;
568#ifdef EXT3_FRAGMENTS 564#ifdef EXT3_FRAGMENTS
569 ei->i_faddr = 0; 565 ei->i_faddr = 0;
570 ei->i_frag_no = 0; 566 ei->i_frag_no = 0;
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
index b7394d05ee8e..5e86ce9a86e0 100644
--- a/fs/ext3/ioctl.c
+++ b/fs/ext3/ioctl.c
@@ -53,8 +53,7 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
53 goto flags_out; 53 goto flags_out;
54 } 54 }
55 55
56 if (!S_ISDIR(inode->i_mode)) 56 flags = ext3_mask_flags(inode->i_mode, flags);
57 flags &= ~EXT3_DIRSYNC_FL;
58 57
59 mutex_lock(&inode->i_mutex); 58 mutex_lock(&inode->i_mutex);
60 /* Is it quota file? Do not allow user to mess with it */ 59 /* Is it quota file? Do not allow user to mess with it */
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 2c2d700c1ccf..69a3d19ca9fd 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -74,10 +74,6 @@ static struct buffer_head *ext3_append(handle_t *handle,
74#define assert(test) J_ASSERT(test) 74#define assert(test) J_ASSERT(test)
75#endif 75#endif
76 76
77#ifndef swap
78#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
79#endif
80
81#ifdef DX_DEBUG 77#ifdef DX_DEBUG
82#define dxtrace(command) command 78#define dxtrace(command) command
83#else 79#else
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 6900ff05e3ab..5d047a030a73 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -439,6 +439,7 @@ static void ext3_put_super (struct super_block * sb)
439 ext3_blkdev_remove(sbi); 439 ext3_blkdev_remove(sbi);
440 } 440 }
441 sb->s_fs_info = NULL; 441 sb->s_fs_info = NULL;
442 kfree(sbi->s_blockgroup_lock);
442 kfree(sbi); 443 kfree(sbi);
443 return; 444 return;
444} 445}
@@ -733,7 +734,9 @@ static struct dquot_operations ext3_quota_operations = {
733 .acquire_dquot = ext3_acquire_dquot, 734 .acquire_dquot = ext3_acquire_dquot,
734 .release_dquot = ext3_release_dquot, 735 .release_dquot = ext3_release_dquot,
735 .mark_dirty = ext3_mark_dquot_dirty, 736 .mark_dirty = ext3_mark_dquot_dirty,
736 .write_info = ext3_write_info 737 .write_info = ext3_write_info,
738 .alloc_dquot = dquot_alloc,
739 .destroy_dquot = dquot_destroy,
737}; 740};
738 741
739static struct quotactl_ops ext3_qctl_operations = { 742static struct quotactl_ops ext3_qctl_operations = {
@@ -1056,8 +1059,7 @@ static int parse_options (char *options, struct super_block *sb,
1056 case Opt_grpjquota: 1059 case Opt_grpjquota:
1057 qtype = GRPQUOTA; 1060 qtype = GRPQUOTA;
1058set_qf_name: 1061set_qf_name:
1059 if ((sb_any_quota_enabled(sb) || 1062 if (sb_any_quota_loaded(sb) &&
1060 sb_any_quota_suspended(sb)) &&
1061 !sbi->s_qf_names[qtype]) { 1063 !sbi->s_qf_names[qtype]) {
1062 printk(KERN_ERR 1064 printk(KERN_ERR
1063 "EXT3-fs: Cannot change journaled " 1065 "EXT3-fs: Cannot change journaled "
@@ -1096,8 +1098,7 @@ set_qf_name:
1096 case Opt_offgrpjquota: 1098 case Opt_offgrpjquota:
1097 qtype = GRPQUOTA; 1099 qtype = GRPQUOTA;
1098clear_qf_name: 1100clear_qf_name:
1099 if ((sb_any_quota_enabled(sb) || 1101 if (sb_any_quota_loaded(sb) &&
1100 sb_any_quota_suspended(sb)) &&
1101 sbi->s_qf_names[qtype]) { 1102 sbi->s_qf_names[qtype]) {
1102 printk(KERN_ERR "EXT3-fs: Cannot change " 1103 printk(KERN_ERR "EXT3-fs: Cannot change "
1103 "journaled quota options when " 1104 "journaled quota options when "
@@ -1116,8 +1117,7 @@ clear_qf_name:
1116 case Opt_jqfmt_vfsv0: 1117 case Opt_jqfmt_vfsv0:
1117 qfmt = QFMT_VFS_V0; 1118 qfmt = QFMT_VFS_V0;
1118set_qf_format: 1119set_qf_format:
1119 if ((sb_any_quota_enabled(sb) || 1120 if (sb_any_quota_loaded(sb) &&
1120 sb_any_quota_suspended(sb)) &&
1121 sbi->s_jquota_fmt != qfmt) { 1121 sbi->s_jquota_fmt != qfmt) {
1122 printk(KERN_ERR "EXT3-fs: Cannot change " 1122 printk(KERN_ERR "EXT3-fs: Cannot change "
1123 "journaled quota options when " 1123 "journaled quota options when "
@@ -1136,8 +1136,7 @@ set_qf_format:
1136 set_opt(sbi->s_mount_opt, GRPQUOTA); 1136 set_opt(sbi->s_mount_opt, GRPQUOTA);
1137 break; 1137 break;
1138 case Opt_noquota: 1138 case Opt_noquota:
1139 if (sb_any_quota_enabled(sb) || 1139 if (sb_any_quota_loaded(sb)) {
1140 sb_any_quota_suspended(sb)) {
1141 printk(KERN_ERR "EXT3-fs: Cannot change quota " 1140 printk(KERN_ERR "EXT3-fs: Cannot change quota "
1142 "options when quota turned on.\n"); 1141 "options when quota turned on.\n");
1143 return 0; 1142 return 0;
@@ -1569,6 +1568,13 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
1569 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); 1568 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
1570 if (!sbi) 1569 if (!sbi)
1571 return -ENOMEM; 1570 return -ENOMEM;
1571
1572 sbi->s_blockgroup_lock =
1573 kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL);
1574 if (!sbi->s_blockgroup_lock) {
1575 kfree(sbi);
1576 return -ENOMEM;
1577 }
1572 sb->s_fs_info = sbi; 1578 sb->s_fs_info = sbi;
1573 sbi->s_mount_opt = 0; 1579 sbi->s_mount_opt = 0;
1574 sbi->s_resuid = EXT3_DEF_RESUID; 1580 sbi->s_resuid = EXT3_DEF_RESUID;
@@ -1821,7 +1827,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
1821 goto failed_mount; 1827 goto failed_mount;
1822 } 1828 }
1823 1829
1824 bgl_lock_init(&sbi->s_blockgroup_lock); 1830 bgl_lock_init(sbi->s_blockgroup_lock);
1825 1831
1826 for (i = 0; i < db_count; i++) { 1832 for (i = 0; i < db_count; i++) {
1827 block = descriptor_loc(sb, logic_sb_block, i); 1833 block = descriptor_loc(sb, logic_sb_block, i);