diff options
author | NeilBrown <neilb@suse.de> | 2006-07-10 07:44:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-10 16:24:17 -0400 |
commit | 80ca3a44f563a763fa872390dcb393f2d82027bf (patch) | |
tree | f11e4756575cf2d85ae4d3bba17634eaa933a475 | |
parent | 5e3db645f890660ce8774a18bcd418570298937e (diff) |
[PATCH] md: unify usage of symbolic names for perms
Some places we use number (0660) someplaces names (S_IRUGO). Change all
numbers to be names, and change 0655 to be what it should be.
Also make some formatting more consistent.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/md/md.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 4bd3ccf363bd..c0da5eedc245 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -110,7 +110,7 @@ static ctl_table raid_table[] = { | |||
110 | .procname = "speed_limit_min", | 110 | .procname = "speed_limit_min", |
111 | .data = &sysctl_speed_limit_min, | 111 | .data = &sysctl_speed_limit_min, |
112 | .maxlen = sizeof(int), | 112 | .maxlen = sizeof(int), |
113 | .mode = 0644, | 113 | .mode = S_IRUGO|S_IWUSR, |
114 | .proc_handler = &proc_dointvec, | 114 | .proc_handler = &proc_dointvec, |
115 | }, | 115 | }, |
116 | { | 116 | { |
@@ -118,7 +118,7 @@ static ctl_table raid_table[] = { | |||
118 | .procname = "speed_limit_max", | 118 | .procname = "speed_limit_max", |
119 | .data = &sysctl_speed_limit_max, | 119 | .data = &sysctl_speed_limit_max, |
120 | .maxlen = sizeof(int), | 120 | .maxlen = sizeof(int), |
121 | .mode = 0644, | 121 | .mode = S_IRUGO|S_IWUSR, |
122 | .proc_handler = &proc_dointvec, | 122 | .proc_handler = &proc_dointvec, |
123 | }, | 123 | }, |
124 | { .ctl_name = 0 } | 124 | { .ctl_name = 0 } |
@@ -129,7 +129,7 @@ static ctl_table raid_dir_table[] = { | |||
129 | .ctl_name = DEV_RAID, | 129 | .ctl_name = DEV_RAID, |
130 | .procname = "raid", | 130 | .procname = "raid", |
131 | .maxlen = 0, | 131 | .maxlen = 0, |
132 | .mode = 0555, | 132 | .mode = S_IRUGO|S_IXUGO, |
133 | .child = raid_table, | 133 | .child = raid_table, |
134 | }, | 134 | }, |
135 | { .ctl_name = 0 } | 135 | { .ctl_name = 0 } |
@@ -1783,8 +1783,8 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
1783 | } | 1783 | } |
1784 | return err ? err : len; | 1784 | return err ? err : len; |
1785 | } | 1785 | } |
1786 | static struct rdev_sysfs_entry | 1786 | static struct rdev_sysfs_entry rdev_state = |
1787 | rdev_state = __ATTR(state, 0644, state_show, state_store); | 1787 | __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); |
1788 | 1788 | ||
1789 | static ssize_t | 1789 | static ssize_t |
1790 | super_show(mdk_rdev_t *rdev, char *page) | 1790 | super_show(mdk_rdev_t *rdev, char *page) |
@@ -1815,7 +1815,7 @@ errors_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
1815 | return -EINVAL; | 1815 | return -EINVAL; |
1816 | } | 1816 | } |
1817 | static struct rdev_sysfs_entry rdev_errors = | 1817 | static struct rdev_sysfs_entry rdev_errors = |
1818 | __ATTR(errors, 0644, errors_show, errors_store); | 1818 | __ATTR(errors, S_IRUGO|S_IWUSR, errors_show, errors_store); |
1819 | 1819 | ||
1820 | static ssize_t | 1820 | static ssize_t |
1821 | slot_show(mdk_rdev_t *rdev, char *page) | 1821 | slot_show(mdk_rdev_t *rdev, char *page) |
@@ -1849,7 +1849,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
1849 | 1849 | ||
1850 | 1850 | ||
1851 | static struct rdev_sysfs_entry rdev_slot = | 1851 | static struct rdev_sysfs_entry rdev_slot = |
1852 | __ATTR(slot, 0644, slot_show, slot_store); | 1852 | __ATTR(slot, S_IRUGO|S_IWUSR, slot_show, slot_store); |
1853 | 1853 | ||
1854 | static ssize_t | 1854 | static ssize_t |
1855 | offset_show(mdk_rdev_t *rdev, char *page) | 1855 | offset_show(mdk_rdev_t *rdev, char *page) |
@@ -1871,7 +1871,7 @@ offset_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
1871 | } | 1871 | } |
1872 | 1872 | ||
1873 | static struct rdev_sysfs_entry rdev_offset = | 1873 | static struct rdev_sysfs_entry rdev_offset = |
1874 | __ATTR(offset, 0644, offset_show, offset_store); | 1874 | __ATTR(offset, S_IRUGO|S_IWUSR, offset_show, offset_store); |
1875 | 1875 | ||
1876 | static ssize_t | 1876 | static ssize_t |
1877 | rdev_size_show(mdk_rdev_t *rdev, char *page) | 1877 | rdev_size_show(mdk_rdev_t *rdev, char *page) |
@@ -1895,7 +1895,7 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
1895 | } | 1895 | } |
1896 | 1896 | ||
1897 | static struct rdev_sysfs_entry rdev_size = | 1897 | static struct rdev_sysfs_entry rdev_size = |
1898 | __ATTR(size, 0644, rdev_size_show, rdev_size_store); | 1898 | __ATTR(size, S_IRUGO|S_IWUSR, rdev_size_show, rdev_size_store); |
1899 | 1899 | ||
1900 | static struct attribute *rdev_default_attrs[] = { | 1900 | static struct attribute *rdev_default_attrs[] = { |
1901 | &rdev_state.attr, | 1901 | &rdev_state.attr, |
@@ -2132,7 +2132,7 @@ safe_delay_store(mddev_t *mddev, const char *cbuf, size_t len) | |||
2132 | return len; | 2132 | return len; |
2133 | } | 2133 | } |
2134 | static struct md_sysfs_entry md_safe_delay = | 2134 | static struct md_sysfs_entry md_safe_delay = |
2135 | __ATTR(safe_mode_delay, 0644,safe_delay_show, safe_delay_store); | 2135 | __ATTR(safe_mode_delay, S_IRUGO|S_IWUSR,safe_delay_show, safe_delay_store); |
2136 | 2136 | ||
2137 | static ssize_t | 2137 | static ssize_t |
2138 | level_show(mddev_t *mddev, char *page) | 2138 | level_show(mddev_t *mddev, char *page) |
@@ -2167,7 +2167,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len) | |||
2167 | } | 2167 | } |
2168 | 2168 | ||
2169 | static struct md_sysfs_entry md_level = | 2169 | static struct md_sysfs_entry md_level = |
2170 | __ATTR(level, 0644, level_show, level_store); | 2170 | __ATTR(level, S_IRUGO|S_IWUSR, level_show, level_store); |
2171 | 2171 | ||
2172 | 2172 | ||
2173 | static ssize_t | 2173 | static ssize_t |
@@ -2192,7 +2192,7 @@ layout_store(mddev_t *mddev, const char *buf, size_t len) | |||
2192 | return len; | 2192 | return len; |
2193 | } | 2193 | } |
2194 | static struct md_sysfs_entry md_layout = | 2194 | static struct md_sysfs_entry md_layout = |
2195 | __ATTR(layout, 0655, layout_show, layout_store); | 2195 | __ATTR(layout, S_IRUGO|S_IWUSR, layout_show, layout_store); |
2196 | 2196 | ||
2197 | 2197 | ||
2198 | static ssize_t | 2198 | static ssize_t |
@@ -2223,7 +2223,7 @@ raid_disks_store(mddev_t *mddev, const char *buf, size_t len) | |||
2223 | return rv ? rv : len; | 2223 | return rv ? rv : len; |
2224 | } | 2224 | } |
2225 | static struct md_sysfs_entry md_raid_disks = | 2225 | static struct md_sysfs_entry md_raid_disks = |
2226 | __ATTR(raid_disks, 0644, raid_disks_show, raid_disks_store); | 2226 | __ATTR(raid_disks, S_IRUGO|S_IWUSR, raid_disks_show, raid_disks_store); |
2227 | 2227 | ||
2228 | static ssize_t | 2228 | static ssize_t |
2229 | chunk_size_show(mddev_t *mddev, char *page) | 2229 | chunk_size_show(mddev_t *mddev, char *page) |
@@ -2247,7 +2247,7 @@ chunk_size_store(mddev_t *mddev, const char *buf, size_t len) | |||
2247 | return len; | 2247 | return len; |
2248 | } | 2248 | } |
2249 | static struct md_sysfs_entry md_chunk_size = | 2249 | static struct md_sysfs_entry md_chunk_size = |
2250 | __ATTR(chunk_size, 0644, chunk_size_show, chunk_size_store); | 2250 | __ATTR(chunk_size, S_IRUGO|S_IWUSR, chunk_size_show, chunk_size_store); |
2251 | 2251 | ||
2252 | static ssize_t | 2252 | static ssize_t |
2253 | resync_start_show(mddev_t *mddev, char *page) | 2253 | resync_start_show(mddev_t *mddev, char *page) |
@@ -2271,7 +2271,7 @@ resync_start_store(mddev_t *mddev, const char *buf, size_t len) | |||
2271 | return len; | 2271 | return len; |
2272 | } | 2272 | } |
2273 | static struct md_sysfs_entry md_resync_start = | 2273 | static struct md_sysfs_entry md_resync_start = |
2274 | __ATTR(resync_start, 0644, resync_start_show, resync_start_store); | 2274 | __ATTR(resync_start, S_IRUGO|S_IWUSR, resync_start_show, resync_start_store); |
2275 | 2275 | ||
2276 | /* | 2276 | /* |
2277 | * The array state can be: | 2277 | * The array state can be: |
@@ -2441,7 +2441,8 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) | |||
2441 | else | 2441 | else |
2442 | return len; | 2442 | return len; |
2443 | } | 2443 | } |
2444 | static struct md_sysfs_entry md_array_state = __ATTR(array_state, 0644, array_state_show, array_state_store); | 2444 | static struct md_sysfs_entry md_array_state = |
2445 | __ATTR(array_state, S_IRUGO|S_IWUSR, array_state_show, array_state_store); | ||
2445 | 2446 | ||
2446 | static ssize_t | 2447 | static ssize_t |
2447 | null_show(mddev_t *mddev, char *page) | 2448 | null_show(mddev_t *mddev, char *page) |
@@ -2501,7 +2502,7 @@ new_dev_store(mddev_t *mddev, const char *buf, size_t len) | |||
2501 | } | 2502 | } |
2502 | 2503 | ||
2503 | static struct md_sysfs_entry md_new_device = | 2504 | static struct md_sysfs_entry md_new_device = |
2504 | __ATTR(new_dev, 0200, null_show, new_dev_store); | 2505 | __ATTR(new_dev, S_IWUSR, null_show, new_dev_store); |
2505 | 2506 | ||
2506 | static ssize_t | 2507 | static ssize_t |
2507 | size_show(mddev_t *mddev, char *page) | 2508 | size_show(mddev_t *mddev, char *page) |
@@ -2539,7 +2540,7 @@ size_store(mddev_t *mddev, const char *buf, size_t len) | |||
2539 | } | 2540 | } |
2540 | 2541 | ||
2541 | static struct md_sysfs_entry md_size = | 2542 | static struct md_sysfs_entry md_size = |
2542 | __ATTR(component_size, 0644, size_show, size_store); | 2543 | __ATTR(component_size, S_IRUGO|S_IWUSR, size_show, size_store); |
2543 | 2544 | ||
2544 | 2545 | ||
2545 | /* Metdata version. | 2546 | /* Metdata version. |
@@ -2587,7 +2588,7 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len) | |||
2587 | } | 2588 | } |
2588 | 2589 | ||
2589 | static struct md_sysfs_entry md_metadata = | 2590 | static struct md_sysfs_entry md_metadata = |
2590 | __ATTR(metadata_version, 0644, metadata_show, metadata_store); | 2591 | __ATTR(metadata_version, S_IRUGO|S_IWUSR, metadata_show, metadata_store); |
2591 | 2592 | ||
2592 | static ssize_t | 2593 | static ssize_t |
2593 | action_show(mddev_t *mddev, char *page) | 2594 | action_show(mddev_t *mddev, char *page) |
@@ -2655,12 +2656,11 @@ mismatch_cnt_show(mddev_t *mddev, char *page) | |||
2655 | (unsigned long long) mddev->resync_mismatches); | 2656 | (unsigned long long) mddev->resync_mismatches); |
2656 | } | 2657 | } |
2657 | 2658 | ||
2658 | static struct md_sysfs_entry | 2659 | static struct md_sysfs_entry md_scan_mode = |
2659 | md_scan_mode = __ATTR(sync_action, S_IRUGO|S_IWUSR, action_show, action_store); | 2660 | __ATTR(sync_action, S_IRUGO|S_IWUSR, action_show, action_store); |
2660 | 2661 | ||
2661 | 2662 | ||
2662 | static struct md_sysfs_entry | 2663 | static struct md_sysfs_entry md_mismatches = __ATTR_RO(mismatch_cnt); |
2663 | md_mismatches = __ATTR_RO(mismatch_cnt); | ||
2664 | 2664 | ||
2665 | static ssize_t | 2665 | static ssize_t |
2666 | sync_min_show(mddev_t *mddev, char *page) | 2666 | sync_min_show(mddev_t *mddev, char *page) |
@@ -2726,8 +2726,7 @@ sync_speed_show(mddev_t *mddev, char *page) | |||
2726 | return sprintf(page, "%ld\n", db/dt/2); /* K/sec */ | 2726 | return sprintf(page, "%ld\n", db/dt/2); /* K/sec */ |
2727 | } | 2727 | } |
2728 | 2728 | ||
2729 | static struct md_sysfs_entry | 2729 | static struct md_sysfs_entry md_sync_speed = __ATTR_RO(sync_speed); |
2730 | md_sync_speed = __ATTR_RO(sync_speed); | ||
2731 | 2730 | ||
2732 | static ssize_t | 2731 | static ssize_t |
2733 | sync_completed_show(mddev_t *mddev, char *page) | 2732 | sync_completed_show(mddev_t *mddev, char *page) |
@@ -2743,8 +2742,7 @@ sync_completed_show(mddev_t *mddev, char *page) | |||
2743 | return sprintf(page, "%lu / %lu\n", resync, max_blocks); | 2742 | return sprintf(page, "%lu / %lu\n", resync, max_blocks); |
2744 | } | 2743 | } |
2745 | 2744 | ||
2746 | static struct md_sysfs_entry | 2745 | static struct md_sysfs_entry md_sync_completed = __ATTR_RO(sync_completed); |
2747 | md_sync_completed = __ATTR_RO(sync_completed); | ||
2748 | 2746 | ||
2749 | static ssize_t | 2747 | static ssize_t |
2750 | suspend_lo_show(mddev_t *mddev, char *page) | 2748 | suspend_lo_show(mddev_t *mddev, char *page) |
@@ -5651,8 +5649,8 @@ static int set_ro(const char *val, struct kernel_param *kp) | |||
5651 | return -EINVAL; | 5649 | return -EINVAL; |
5652 | } | 5650 | } |
5653 | 5651 | ||
5654 | module_param_call(start_ro, set_ro, get_ro, NULL, 0600); | 5652 | module_param_call(start_ro, set_ro, get_ro, NULL, S_IRUSR|S_IWUSR); |
5655 | module_param(start_dirty_degraded, int, 0644); | 5653 | module_param(start_dirty_degraded, int, S_IRUGO|S_IWUSR); |
5656 | 5654 | ||
5657 | 5655 | ||
5658 | EXPORT_SYMBOL(register_md_personality); | 5656 | EXPORT_SYMBOL(register_md_personality); |