Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
f39afb82
Commit
f39afb82
authored
Aug 22, 2002
by
Neil Brown
Committed by
Linus Torvalds
Aug 22, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] md: Remove used_slot field from per-personality info
This is equivalent to ->rdev != NULL, so it isn't needed.
parent
3e98f2fb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
58 deletions
+20
-58
drivers/md/multipath.c
drivers/md/multipath.c
+5
-9
drivers/md/raid1.c
drivers/md/raid1.c
+9
-19
drivers/md/raid5.c
drivers/md/raid5.c
+6
-25
include/linux/raid/multipath.h
include/linux/raid/multipath.h
+0
-2
include/linux/raid/raid1.h
include/linux/raid/raid1.h
+0
-2
include/linux/raid/raid5.h
include/linux/raid/raid5.h
+0
-1
No files found.
drivers/md/multipath.c
View file @
f39afb82
...
...
@@ -288,11 +288,10 @@ static void print_multipath_conf (multipath_conf_t *conf)
for
(
i
=
0
;
i
<
MD_SB_DISKS
;
i
++
)
{
tmp
=
conf
->
multipaths
+
i
;
if
(
tmp
->
operational
||
tmp
->
used_slot
)
printk
(
" disk%d, o:%d,
us:%d
dev:%s
\n
"
,
if
(
tmp
->
rdev
)
printk
(
" disk%d, o:%d, dev:%s
\n
"
,
i
,
tmp
->
operational
,
tmp
->
used_slot
,
bdev_partition_name
(
tmp
->
rdev
->
bdev
));
bdev_partition_name
(
tmp
->
rdev
->
bdev
));
}
}
...
...
@@ -305,10 +304,9 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
print_multipath_conf
(
conf
);
spin_lock_irq
(
&
conf
->
device_lock
);
if
(
!
p
->
used_slot
)
{
if
(
!
p
->
rdev
)
{
p
->
rdev
=
rdev
;
p
->
operational
=
1
;
p
->
used_slot
=
1
;
conf
->
working_disks
++
;
err
=
0
;
}
...
...
@@ -329,7 +327,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
print_multipath_conf
(
conf
);
spin_lock_irq
(
&
conf
->
device_lock
);
if
(
p
->
used_slot
)
{
if
(
p
->
rdev
)
{
if
(
p
->
operational
||
(
p
->
rdev
&&
atomic_read
(
&
p
->
rdev
->
nr_pending
)))
{
printk
(
KERN_ERR
"hot-remove-disk, slot %d is identified but is still operational!
\n
"
,
number
);
...
...
@@ -337,7 +335,6 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
goto
abort
;
}
p
->
rdev
=
NULL
;
p
->
used_slot
=
0
;
err
=
0
;
}
if
(
err
)
...
...
@@ -497,7 +494,6 @@ static int multipath_run (mddev_t *mddev)
*/
disk
->
rdev
=
rdev
;
disk
->
operational
=
1
;
disk
->
used_slot
=
1
;
num_rdevs
++
;
}
...
...
drivers/md/raid1.c
View file @
f39afb82
...
...
@@ -652,10 +652,10 @@ static void print_conf(conf_t *conf)
for
(
i
=
0
;
i
<
MD_SB_DISKS
;
i
++
)
{
tmp
=
conf
->
mirrors
+
i
;
printk
(
" disk %d, s:%d, o:%d, us:%d dev:%s
\n
"
,
i
,
tmp
->
spare
,
tmp
->
operational
,
tmp
->
used_slot
,
bdev_partition_name
(
tmp
->
rdev
->
bdev
));
if
(
tmp
->
rdev
)
printk
(
" disk %d, s:%d, o:%d, dev:%s
\n
"
,
i
,
tmp
->
spare
,
tmp
->
operational
,
bdev_partition_name
(
tmp
->
rdev
->
bdev
));
}
}
...
...
@@ -690,7 +690,7 @@ static int raid1_spare_active(mddev_t *mddev)
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
{
tmp
=
conf
->
mirrors
+
i
;
if
((
!
tmp
->
operational
&&
!
tmp
->
spare
)
||
!
tmp
->
used_slot
)
{
!
tmp
->
rdev
)
{
failed_disk
=
i
;
break
;
}
...
...
@@ -740,8 +740,6 @@ static int raid1_spare_active(mddev_t *mddev)
* disk. (this means we switch back these values)
*/
if
(
!
sdisk
->
rdev
)
sdisk
->
used_slot
=
0
;
/*
* this really activates the spare.
*/
...
...
@@ -813,12 +811,11 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
print_conf
(
conf
);
spin_lock_irq
(
&
conf
->
device_lock
);
if
(
!
p
->
used_slot
)
{
if
(
!
p
->
rdev
)
{
p
->
rdev
=
rdev
;
p
->
operational
=
0
;
p
->
write_only
=
0
;
p
->
spare
=
1
;
p
->
used_slot
=
1
;
p
->
head_position
=
0
;
err
=
0
;
}
...
...
@@ -838,14 +835,13 @@ static int raid1_remove_disk(mddev_t *mddev, int number)
print_conf
(
conf
);
spin_lock_irq
(
&
conf
->
device_lock
);
if
(
p
->
used_slot
)
{
if
(
p
->
rdev
)
{
if
(
p
->
operational
||
(
p
->
rdev
&&
atomic_read
(
&
p
->
rdev
->
nr_pending
)))
{
err
=
-
EBUSY
;
goto
abort
;
}
p
->
rdev
=
NULL
;
p
->
used_slot
=
0
;
err
=
0
;
}
if
(
err
)
...
...
@@ -1265,7 +1261,6 @@ static int run(mddev_t *mddev)
disk
->
operational
=
0
;
disk
->
write_only
=
0
;
disk
->
spare
=
0
;
disk
->
used_slot
=
1
;
disk
->
head_position
=
0
;
continue
;
}
...
...
@@ -1282,7 +1277,6 @@ static int run(mddev_t *mddev)
disk
->
operational
=
1
;
disk
->
write_only
=
0
;
disk
->
spare
=
0
;
disk
->
used_slot
=
1
;
disk
->
head_position
=
0
;
conf
->
working_disks
++
;
}
else
{
...
...
@@ -1294,7 +1288,6 @@ static int run(mddev_t *mddev)
disk
->
operational
=
0
;
disk
->
write_only
=
0
;
disk
->
spare
=
1
;
disk
->
used_slot
=
1
;
disk
->
head_position
=
0
;
}
}
...
...
@@ -1316,16 +1309,13 @@ static int run(mddev_t *mddev)
disk
=
conf
->
mirrors
+
i
;
if
(
!
disk
->
used_slot
)
{
disk
->
rdev
=
NULL
;
if
(
!
disk
->
rdev
)
{
disk
->
operational
=
0
;
disk
->
write_only
=
0
;
disk
->
spare
=
0
;
disk
->
used_slot
=
1
;
disk
->
head_position
=
0
;
}
if
(
!
disk
->
used_slot
)
mddev
->
degraded
++
;
}
}
/*
...
...
drivers/md/raid5.c
View file @
f39afb82
...
...
@@ -1423,7 +1423,6 @@ static int run (mddev_t *mddev)
disk
->
operational
=
0
;
disk
->
write_only
=
0
;
disk
->
spare
=
0
;
disk
->
used_slot
=
1
;
continue
;
}
if
(
rdev
->
in_sync
)
{
...
...
@@ -1435,7 +1434,6 @@ static int run (mddev_t *mddev)
disk
->
rdev
=
rdev
;
disk
->
operational
=
1
;
disk
->
used_slot
=
1
;
conf
->
working_disks
++
;
}
else
{
...
...
@@ -1448,20 +1446,16 @@ static int run (mddev_t *mddev)
disk
->
operational
=
0
;
disk
->
write_only
=
0
;
disk
->
spare
=
1
;
disk
->
used_slot
=
1
;
}
}
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
{
disk
=
conf
->
disks
+
i
;
if
(
!
disk
->
used_slot
)
{
disk
->
rdev
=
NULL
;
if
(
!
disk
->
rdev
)
{
disk
->
operational
=
0
;
disk
->
write_only
=
0
;
disk
->
spare
=
0
;
disk
->
used_slot
=
1
;
}
}
...
...
@@ -1476,14 +1470,6 @@ static int run (mddev_t *mddev)
conf
->
algorithm
=
mddev
->
layout
;
conf
->
max_nr_stripes
=
NR_STRIPES
;
#if 0
for (i = 0; i < conf->raid_disks; i++) {
if (!conf->disks[i].used_slot) {
MD_BUG();
goto abort;
}
}
#endif
if
(
!
conf
->
chunk_size
||
conf
->
chunk_size
%
4
)
{
printk
(
KERN_ERR
"raid5: invalid chunk size %d for md%d
\n
"
,
conf
->
chunk_size
,
mdidx
(
mddev
));
goto
abort
;
...
...
@@ -1634,9 +1620,9 @@ static void print_raid5_conf (raid5_conf_t *conf)
for
(
i
=
0
;
i
<
conf
->
working_disks
+
conf
->
failed_disks
;
i
++
)
{
#endif
tmp
=
conf
->
disks
+
i
;
printk
(
" disk %d, s:%d, o:%d, us:%d dev:%s
\n
"
,
if
(
tmp
->
rdev
)
printk
(
" disk %d, s:%d, o:%d, dev:%s
\n
"
,
i
,
tmp
->
spare
,
tmp
->
operational
,
tmp
->
used_slot
,
bdev_partition_name
(
tmp
->
rdev
->
bdev
));
}
}
...
...
@@ -1654,7 +1640,7 @@ static int raid5_spare_active(mddev_t *mddev)
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
{
tmp
=
conf
->
disks
+
i
;
if
((
!
tmp
->
operational
&&
!
tmp
->
spare
)
||
!
tmp
->
used_slot
)
{
!
tmp
->
rdev
)
{
failed_disk
=
i
;
break
;
}
...
...
@@ -1704,9 +1690,6 @@ static int raid5_spare_active(mddev_t *mddev)
* disk. (this means we switch back these values)
*/
if
(
!
sdisk
->
rdev
)
sdisk
->
used_slot
=
0
;
/*
* this really activates the spare.
*/
...
...
@@ -1782,14 +1765,13 @@ static int raid5_remove_disk(mddev_t *mddev, int number)
print_raid5_conf
(
conf
);
spin_lock_irq
(
&
conf
->
device_lock
);
if
(
p
->
used_slot
)
{
if
(
p
->
rdev
)
{
if
(
p
->
operational
||
atomic_read
(
&
p
->
rdev
->
nr_pending
))
{
err
=
-
EBUSY
;
goto
abort
;
}
p
->
rdev
=
NULL
;
p
->
used_slot
=
0
;
err
=
0
;
}
if
(
err
)
...
...
@@ -1812,13 +1794,12 @@ static int raid5_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
* find the disk ...
*/
if
(
!
p
->
used_slot
)
{
if
(
!
p
->
rdev
)
{
/* it will be held open by rdev */
p
->
rdev
=
rdev
;
p
->
operational
=
0
;
p
->
write_only
=
0
;
p
->
spare
=
1
;
p
->
used_slot
=
1
;
err
=
0
;
}
if
(
err
)
...
...
include/linux/raid/multipath.h
View file @
f39afb82
...
...
@@ -11,8 +11,6 @@ struct multipath_info {
* State bits:
*/
int
operational
;
int
used_slot
;
};
struct
multipath_private_data
{
...
...
include/linux/raid/raid1.h
View file @
f39afb82
...
...
@@ -15,8 +15,6 @@ struct mirror_info {
int
operational
;
int
write_only
;
int
spare
;
int
used_slot
;
};
typedef
struct
r1bio_s
r1bio_t
;
...
...
include/linux/raid/raid5.h
View file @
f39afb82
...
...
@@ -196,7 +196,6 @@ struct disk_info {
int
operational
;
int
write_only
;
int
spare
;
int
used_slot
;
};
struct
raid5_private_data
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment