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
0948aa6d
Commit
0948aa6d
authored
Apr 29, 2003
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] improved bdevname
parent
72007d2d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
fs/partitions/check.c
fs/partitions/check.c
+14
-7
fs/partitions/check.h
fs/partitions/check.h
+1
-1
include/linux/fs.h
include/linux/fs.h
+1
-4
kernel/ksyms.c
kernel/ksyms.c
+1
-0
No files found.
fs/partitions/check.c
View file @
0948aa6d
...
...
@@ -99,25 +99,32 @@ char *disk_name(struct gendisk *hd, int part, char *buf)
#ifdef CONFIG_DEVFS_FS
if
(
hd
->
devfs_name
[
0
]
!=
'\0'
)
{
if
(
part
)
sprintf
(
buf
,
"%s/part%d"
,
hd
->
devfs_name
,
part
);
snprintf
(
buf
,
BDEVNAME_SIZE
,
"%s/part%d"
,
hd
->
devfs_name
,
part
);
else
if
(
hd
->
minors
!=
1
)
s
printf
(
buf
,
"%s/disc"
,
hd
->
devfs_name
);
s
nprintf
(
buf
,
BDEVNAME_SIZE
,
"%s/disc"
,
hd
->
devfs_name
);
else
s
printf
(
buf
,
"%s"
,
hd
->
devfs_name
);
s
nprintf
(
buf
,
BDEVNAME_SIZE
,
"%s"
,
hd
->
devfs_name
);
return
buf
;
}
#endif
if
(
!
part
)
s
printf
(
buf
,
"%s"
,
hd
->
disk_name
);
s
nprintf
(
buf
,
BDEVNAME_SIZE
,
"%s"
,
hd
->
disk_name
);
else
if
(
isdigit
(
hd
->
disk_name
[
strlen
(
hd
->
disk_name
)
-
1
]))
s
printf
(
buf
,
"%sp%d"
,
hd
->
disk_name
,
part
);
s
nprintf
(
buf
,
BDEVNAME_SIZE
,
"%sp%d"
,
hd
->
disk_name
,
part
);
else
s
printf
(
buf
,
"%s%d"
,
hd
->
disk_name
,
part
);
s
nprintf
(
buf
,
BDEVNAME_SIZE
,
"%s%d"
,
hd
->
disk_name
,
part
);
return
buf
;
}
const
char
*
bdevname
(
struct
block_device
*
bdev
,
char
*
buf
)
{
int
part
=
MINOR
(
bdev
->
bd_dev
)
-
bdev
->
bd_disk
->
first_minor
;
return
disk_name
(
bdev
->
bd_disk
,
part
,
buf
);
}
static
struct
parsed_partitions
*
check_partition
(
struct
gendisk
*
hd
,
struct
block_device
*
bdev
)
{
...
...
@@ -417,7 +424,7 @@ void del_gendisk(struct gendisk *disk)
struct
dev_name
{
struct
list_head
list
;
dev_t
dev
;
char
namebuf
[
64
];
char
namebuf
[
BDEVNAME_SIZE
];
char
*
name
;
};
...
...
fs/partitions/check.h
View file @
0948aa6d
...
...
@@ -8,7 +8,7 @@
enum
{
MAX_PART
=
256
};
struct
parsed_partitions
{
char
name
[
40
];
char
name
[
BDEVNAME_SIZE
];
struct
{
sector_t
from
;
sector_t
size
;
...
...
include/linux/fs.h
View file @
0948aa6d
...
...
@@ -1068,10 +1068,7 @@ extern int chrdev_open(struct inode *, struct file *);
/* fs/block_dev.c */
#define BDEVNAME_SIZE 32
/* Largest string for a blockdev identifier */
extern
const
char
*
__bdevname
(
dev_t
,
char
*
buffer
);
extern
inline
const
char
*
bdevname
(
struct
block_device
*
bdev
,
char
*
buffer
)
{
return
__bdevname
(
bdev
->
bd_dev
,
buffer
);
}
extern
const
char
*
bdevname
(
struct
block_device
*
bdev
,
char
*
buffer
);
extern
struct
block_device
*
lookup_bdev
(
const
char
*
);
extern
struct
block_device
*
open_bdev_excl
(
const
char
*
,
int
,
int
,
void
*
);
extern
void
close_bdev_excl
(
struct
block_device
*
,
int
);
...
...
kernel/ksyms.c
View file @
0948aa6d
...
...
@@ -515,6 +515,7 @@ EXPORT_SYMBOL(vsprintf);
EXPORT_SYMBOL
(
vsnprintf
);
EXPORT_SYMBOL
(
vsscanf
);
EXPORT_SYMBOL
(
__bdevname
);
EXPORT_SYMBOL
(
bdevname
);
EXPORT_SYMBOL
(
cdevname
);
EXPORT_SYMBOL
(
simple_strtoull
);
EXPORT_SYMBOL
(
simple_strtoul
);
...
...
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