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
nexedi
linux
Commits
45b3e77f
Commit
45b3e77f
authored
May 26, 2003
by
Neil Brown
Committed by
Linus Torvalds
May 26, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] md: Replace bdev_partition_name with calls to bdevname
parent
89670a77
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
82 deletions
+98
-82
drivers/md/linear.c
drivers/md/linear.c
+3
-2
drivers/md/md.c
drivers/md/md.c
+56
-42
drivers/md/multipath.c
drivers/md/multipath.c
+9
-5
drivers/md/raid0.c
drivers/md/raid0.c
+13
-9
drivers/md/raid1.c
drivers/md/raid1.c
+11
-6
drivers/md/raid5.c
drivers/md/raid5.c
+6
-3
include/linux/raid/md.h
include/linux/raid/md.h
+0
-15
No files found.
drivers/md/linear.c
View file @
45b3e77f
...
...
@@ -254,12 +254,13 @@ static void linear_status (struct seq_file *seq, mddev_t *mddev)
seq_printf
(
seq
,
" "
);
for
(
j
=
0
;
j
<
conf
->
nr_zones
;
j
++
)
{
char
b
[
BDEVNAME_SIZE
];
seq_printf
(
seq
,
"[%s"
,
bdev_partition_name
(
conf
->
hash_table
[
j
].
dev0
->
rdev
->
bdev
));
bdevname
(
conf
->
hash_table
[
j
].
dev0
->
rdev
->
bdev
,
b
));
if
(
conf
->
hash_table
[
j
].
dev1
)
seq_printf
(
seq
,
"/%s] "
,
bdev_partition_name
(
conf
->
hash_table
[
j
].
dev1
->
rdev
->
bdev
));
bdevname
(
conf
->
hash_table
[
j
].
dev1
->
rdev
->
bdev
,
b
));
else
seq_printf
(
seq
,
"] "
);
}
...
...
drivers/md/md.c
View file @
45b3e77f
This diff is collapsed.
Click to expand it.
drivers/md/multipath.c
View file @
45b3e77f
...
...
@@ -127,9 +127,10 @@ int multipath_end_request(struct bio *bio, unsigned int bytes_done, int error)
/*
* oops, IO error:
*/
char
b
[
BDEVNAME_SIZE
];
md_error
(
mp_bh
->
mddev
,
rdev
);
printk
(
KERN_ERR
"multipath: %s: rescheduling sector %llu
\n
"
,
bdev
_partition_name
(
rdev
->
bdev
),
bdev
name
(
rdev
->
bdev
,
b
),
(
unsigned
long
long
)
bio
->
bi_sector
);
multipath_reschedule_retry
(
mp_bh
);
}
...
...
@@ -220,6 +221,7 @@ static void multipath_error (mddev_t *mddev, mdk_rdev_t *rdev)
* Mark disk as unusable
*/
if
(
!
rdev
->
faulty
)
{
char
b
[
BDEVNAME_SIZE
];
rdev
->
in_sync
=
0
;
rdev
->
faulty
=
1
;
mddev
->
sb_dirty
=
1
;
...
...
@@ -227,7 +229,7 @@ static void multipath_error (mddev_t *mddev, mdk_rdev_t *rdev)
printk
(
KERN_ALERT
"multipath: IO failure on %s,"
" disabling IO path.
\n
Operation continuing"
" on %d IO paths.
\n
"
,
bdev
_partition_name
(
rdev
->
bdev
),
bdev
name
(
rdev
->
bdev
,
b
),
conf
->
working_disks
);
}
}
...
...
@@ -247,11 +249,12 @@ static void print_multipath_conf (multipath_conf_t *conf)
conf
->
raid_disks
);
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
{
char
b
[
BDEVNAME_SIZE
];
tmp
=
conf
->
multipaths
+
i
;
if
(
tmp
->
rdev
)
printk
(
" disk%d, o:%d, dev:%s
\n
"
,
i
,
!
tmp
->
rdev
->
faulty
,
bdev
_partition_name
(
tmp
->
rdev
->
bdev
));
bdev
name
(
tmp
->
rdev
->
bdev
,
b
));
}
}
...
...
@@ -326,6 +329,7 @@ static void multipathd (mddev_t *mddev)
md_check_recovery
(
mddev
);
for
(;;)
{
char
b
[
BDEVNAME_SIZE
];
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
mp_bh
=
multipath_retry_list
;
if
(
!
mp_bh
)
...
...
@@ -341,13 +345,13 @@ static void multipathd (mddev_t *mddev)
if
(
multipath_map
(
mddev
,
&
rdev
)
<
0
)
{
printk
(
KERN_ALERT
"multipath: %s: unrecoverable IO read"
" error for block %llu
\n
"
,
bdev
_partition_name
(
bio
->
bi_bdev
),
bdev
name
(
bio
->
bi_bdev
,
b
),
(
unsigned
long
long
)
bio
->
bi_sector
);
multipath_end_bh_io
(
mp_bh
,
0
);
}
else
{
printk
(
KERN_ERR
"multipath: %s: redirecting sector %llu"
" to another IO path
\n
"
,
bdev
_partition_name
(
bio
->
bi_bdev
),
bdev
name
(
bio
->
bi_bdev
,
b
),
(
unsigned
long
long
)
bio
->
bi_sector
);
bio
->
bi_bdev
=
rdev
->
bdev
;
generic_make_request
(
bio
);
...
...
drivers/md/raid0.c
View file @
45b3e77f
...
...
@@ -36,6 +36,7 @@ static int create_strip_zones (mddev_t *mddev)
struct
list_head
*
tmp1
,
*
tmp2
;
struct
strip_zone
*
zone
;
int
cnt
;
char
b
[
BDEVNAME_SIZE
];
/*
* The number of 'same size groups'
...
...
@@ -44,14 +45,15 @@ static int create_strip_zones (mddev_t *mddev)
ITERATE_RDEV
(
mddev
,
rdev1
,
tmp1
)
{
printk
(
"raid0: looking at %s
\n
"
,
bdev
_partition_name
(
rdev1
->
bdev
));
bdev
name
(
rdev1
->
bdev
,
b
));
c
=
0
;
ITERATE_RDEV
(
mddev
,
rdev2
,
tmp2
)
{
printk
(
"raid0: comparing %s(%llu) with %s(%llu)
\n
"
,
bdev_partition_name
(
rdev1
->
bdev
),
(
unsigned
long
long
)
rdev1
->
size
,
bdev_partition_name
(
rdev2
->
bdev
),
(
unsigned
long
long
)
rdev2
->
size
);
printk
(
"raid0: comparing %s(%llu)"
,
bdevname
(
rdev1
->
bdev
,
b
),
(
unsigned
long
long
)
rdev1
->
size
);
printk
(
" with %s(%llu)
\n
"
,
bdevname
(
rdev2
->
bdev
,
b
),
(
unsigned
long
long
)
rdev2
->
size
);
if
(
rdev2
==
rdev1
)
{
printk
(
"raid0: END
\n
"
);
break
;
...
...
@@ -138,8 +140,9 @@ static int create_strip_zones (mddev_t *mddev)
c
=
0
;
for
(
j
=
0
;
j
<
cnt
;
j
++
)
{
char
b
[
BDEVNAME_SIZE
];
rdev
=
conf
->
strip_zone
[
0
].
dev
[
j
];
printk
(
"raid0: checking %s ..."
,
bdev
_partition_name
(
rdev
->
bdev
));
printk
(
"raid0: checking %s ..."
,
bdev
name
(
rdev
->
bdev
,
b
));
if
(
rdev
->
size
>
current_offset
)
{
printk
(
" contained as device %d
\n
"
,
c
);
...
...
@@ -404,6 +407,7 @@ static void raid0_status (struct seq_file *seq, mddev_t *mddev)
#undef MD_DEBUG
#ifdef MD_DEBUG
int
j
,
k
,
h
;
char
b
[
BDEVNAME_SIZE
];
raid0_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
h
=
0
;
...
...
@@ -413,8 +417,8 @@ static void raid0_status (struct seq_file *seq, mddev_t *mddev)
seq_printf
(
"(h%d)"
,
h
++
);
seq_printf
(
seq
,
"=["
);
for
(
k
=
0
;
k
<
conf
->
strip_zone
[
j
].
nb_dev
;
k
++
)
seq_printf
(
seq
,
"%s/"
,
bdev
_partition_
name
(
conf
->
strip_zone
[
j
].
dev
[
k
]
->
bdev
));
seq_printf
(
seq
,
"%s/"
,
bdevname
(
conf
->
strip_zone
[
j
].
dev
[
k
]
->
bdev
,
b
));
seq_printf
(
seq
,
"] zo=%d do=%d s=%d
\n
"
,
conf
->
strip_zone
[
j
].
zone_offset
,
...
...
drivers/md/raid1.c
View file @
45b3e77f
...
...
@@ -308,8 +308,9 @@ static int raid1_end_request(struct bio *bio, unsigned int bytes_done, int error
/*
* oops, read error:
*/
char
b
[
BDEVNAME_SIZE
];
printk
(
KERN_ERR
"raid1: %s: rescheduling sector %llu
\n
"
,
bdev
_partition_name
(
conf
->
mirrors
[
mirror
].
rdev
->
bdev
),
(
unsigned
long
long
)
r1_bio
->
sector
);
bdev
name
(
conf
->
mirrors
[
mirror
].
rdev
->
bdev
,
b
),
(
unsigned
long
long
)
r1_bio
->
sector
);
reschedule_retry
(
r1_bio
);
}
}
else
{
...
...
@@ -597,6 +598,7 @@ static void status(struct seq_file *seq, mddev_t *mddev)
static
void
error
(
mddev_t
*
mddev
,
mdk_rdev_t
*
rdev
)
{
char
b
[
BDEVNAME_SIZE
];
conf_t
*
conf
=
mddev_to_conf
(
mddev
);
/*
...
...
@@ -625,7 +627,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
mddev
->
sb_dirty
=
1
;
printk
(
KERN_ALERT
"raid1: Disk failure on %s, disabling device.
\n
"
" Operation continuing on %d devices
\n
"
,
bdev
_partition_name
(
rdev
->
bdev
),
conf
->
working_disks
);
bdev
name
(
rdev
->
bdev
,
b
),
conf
->
working_disks
);
}
static
void
print_conf
(
conf_t
*
conf
)
...
...
@@ -642,11 +644,12 @@ static void print_conf(conf_t *conf)
conf
->
raid_disks
);
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
{
char
b
[
BDEVNAME_SIZE
];
tmp
=
conf
->
mirrors
+
i
;
if
(
tmp
->
rdev
)
printk
(
" disk %d, wo:%d, o:%d, dev:%s
\n
"
,
i
,
!
tmp
->
rdev
->
in_sync
,
!
tmp
->
rdev
->
faulty
,
bdev
_partition_name
(
tmp
->
rdev
->
bdev
));
bdev
name
(
tmp
->
rdev
->
bdev
,
b
));
}
}
...
...
@@ -814,9 +817,10 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
* There is no point trying a read-for-reconstruct as
* reconstruct is about to be aborted
*/
char
b
[
BDEVNAME_SIZE
];
printk
(
KERN_ALERT
"raid1: %s: unrecoverable I/O read error"
" for block %llu
\n
"
,
bdev
_partition_name
(
bio
->
bi_bdev
),
bdev
name
(
bio
->
bi_bdev
,
b
),
(
unsigned
long
long
)
r1_bio
->
sector
);
md_done_sync
(
mddev
,
r1_bio
->
master_bio
->
bi_size
>>
9
,
0
);
put_buf
(
r1_bio
);
...
...
@@ -906,6 +910,7 @@ static void raid1d(mddev_t *mddev)
md_handle_safemode
(
mddev
);
for
(;;)
{
char
b
[
BDEVNAME_SIZE
];
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
if
(
list_empty
(
head
))
break
;
...
...
@@ -925,14 +930,14 @@ static void raid1d(mddev_t *mddev)
if
(
map
(
mddev
,
&
rdev
)
==
-
1
)
{
printk
(
KERN_ALERT
"raid1: %s: unrecoverable I/O"
" read error for block %llu
\n
"
,
bdev
_partition_name
(
bio
->
bi_bdev
),
bdev
name
(
bio
->
bi_bdev
,
b
),
(
unsigned
long
long
)
r1_bio
->
sector
);
raid_end_bio_io
(
r1_bio
);
break
;
}
printk
(
KERN_ERR
"raid1: %s: redirecting sector %llu to"
" another mirror
\n
"
,
bdev
_partition_name
(
rdev
->
bdev
),
bdev
name
(
rdev
->
bdev
,
b
),
(
unsigned
long
long
)
r1_bio
->
sector
);
bio
->
bi_bdev
=
rdev
->
bdev
;
bio
->
bi_sector
=
r1_bio
->
sector
+
rdev
->
data_offset
;
...
...
drivers/md/raid5.c
View file @
45b3e77f
...
...
@@ -457,6 +457,7 @@ static void raid5_build_block (struct stripe_head *sh, int i)
static
void
error
(
mddev_t
*
mddev
,
mdk_rdev_t
*
rdev
)
{
char
b
[
BDEVNAME_SIZE
];
raid5_conf_t
*
conf
=
(
raid5_conf_t
*
)
mddev
->
private
;
PRINTK
(
"raid5: error called
\n
"
);
...
...
@@ -476,7 +477,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
printk
(
KERN_ALERT
"raid5: Disk failure on %s, disabling device."
" Operation continuing on %d devices
\n
"
,
bdev
_partition_name
(
rdev
->
bdev
),
conf
->
working_disks
);
bdev
name
(
rdev
->
bdev
,
b
),
conf
->
working_disks
);
}
}
...
...
@@ -1486,8 +1487,9 @@ static int run (mddev_t *mddev)
disk
->
rdev
=
rdev
;
if
(
rdev
->
in_sync
)
{
char
b
[
BDEVNAME_SIZE
];
printk
(
KERN_INFO
"raid5: device %s operational as raid"
" disk %d
\n
"
,
bdev
_partition_name
(
rdev
->
bdev
),
" disk %d
\n
"
,
bdev
name
(
rdev
->
bdev
,
b
),
raid_disk
);
conf
->
working_disks
++
;
}
...
...
@@ -1663,11 +1665,12 @@ static void print_raid5_conf (raid5_conf_t *conf)
conf
->
working_disks
,
conf
->
failed_disks
);
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
{
char
b
[
BDEVNAME_SIZE
];
tmp
=
conf
->
disks
+
i
;
if
(
tmp
->
rdev
)
printk
(
" disk %d, o:%d, dev:%s
\n
"
,
i
,
!
tmp
->
rdev
->
faulty
,
bdev
_partition_name
(
tmp
->
rdev
->
bdev
));
bdev
name
(
tmp
->
rdev
->
bdev
,
b
));
}
}
...
...
include/linux/raid/md.h
View file @
45b3e77f
...
...
@@ -62,21 +62,6 @@
#define MD_MINOR_VERSION 90
#define MD_PATCHLEVEL_VERSION 0
/*
* XXX(hch): This function is broken. Someone who understands the md
* code needs to go through all callers, check whether bdev could
* be NULL and replace it with direct calls to bdevmame.
*
* This would also fix the returns buffer on stack issue nicely :)
*/
static
inline
const
char
*
bdev_partition_name
(
struct
block_device
*
bdev
)
{
char
b
[
BDEVNAME_SIZE
];
if
(
!
bdev
)
return
__bdevname
(
0
,
b
);
return
bdevname
(
bdev
,
b
);
}
extern
int
register_md_personality
(
int
p_num
,
mdk_personality_t
*
p
);
extern
int
unregister_md_personality
(
int
p_num
);
extern
mdk_thread_t
*
md_register_thread
(
void
(
*
run
)
(
mddev_t
*
mddev
),
...
...
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