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
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
Show 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)
...
@@ -99,25 +99,32 @@ char *disk_name(struct gendisk *hd, int part, char *buf)
#ifdef CONFIG_DEVFS_FS
#ifdef CONFIG_DEVFS_FS
if
(
hd
->
devfs_name
[
0
]
!=
'\0'
)
{
if
(
hd
->
devfs_name
[
0
]
!=
'\0'
)
{
if
(
part
)
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
)
else
if
(
hd
->
minors
!=
1
)
s
printf
(
buf
,
"%s/disc"
,
hd
->
devfs_name
);
s
nprintf
(
buf
,
BDEVNAME_SIZE
,
"%s/disc"
,
hd
->
devfs_name
);
else
else
s
printf
(
buf
,
"%s"
,
hd
->
devfs_name
);
s
nprintf
(
buf
,
BDEVNAME_SIZE
,
"%s"
,
hd
->
devfs_name
);
return
buf
;
return
buf
;
}
}
#endif
#endif
if
(
!
part
)
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
]))
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
else
s
printf
(
buf
,
"%s%d"
,
hd
->
disk_name
,
part
);
s
nprintf
(
buf
,
BDEVNAME_SIZE
,
"%s%d"
,
hd
->
disk_name
,
part
);
return
buf
;
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
*
static
struct
parsed_partitions
*
check_partition
(
struct
gendisk
*
hd
,
struct
block_device
*
bdev
)
check_partition
(
struct
gendisk
*
hd
,
struct
block_device
*
bdev
)
{
{
...
@@ -417,7 +424,7 @@ void del_gendisk(struct gendisk *disk)
...
@@ -417,7 +424,7 @@ void del_gendisk(struct gendisk *disk)
struct
dev_name
{
struct
dev_name
{
struct
list_head
list
;
struct
list_head
list
;
dev_t
dev
;
dev_t
dev
;
char
namebuf
[
64
];
char
namebuf
[
BDEVNAME_SIZE
];
char
*
name
;
char
*
name
;
};
};
...
...
fs/partitions/check.h
View file @
0948aa6d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
enum
{
MAX_PART
=
256
};
enum
{
MAX_PART
=
256
};
struct
parsed_partitions
{
struct
parsed_partitions
{
char
name
[
40
];
char
name
[
BDEVNAME_SIZE
];
struct
{
struct
{
sector_t
from
;
sector_t
from
;
sector_t
size
;
sector_t
size
;
...
...
include/linux/fs.h
View file @
0948aa6d
...
@@ -1068,10 +1068,7 @@ extern int chrdev_open(struct inode *, struct file *);
...
@@ -1068,10 +1068,7 @@ extern int chrdev_open(struct inode *, struct file *);
/* fs/block_dev.c */
/* fs/block_dev.c */
#define BDEVNAME_SIZE 32
/* Largest string for a blockdev identifier */
#define BDEVNAME_SIZE 32
/* Largest string for a blockdev identifier */
extern
const
char
*
__bdevname
(
dev_t
,
char
*
buffer
);
extern
const
char
*
__bdevname
(
dev_t
,
char
*
buffer
);
extern
inline
const
char
*
bdevname
(
struct
block_device
*
bdev
,
char
*
buffer
)
extern
const
char
*
bdevname
(
struct
block_device
*
bdev
,
char
*
buffer
);
{
return
__bdevname
(
bdev
->
bd_dev
,
buffer
);
}
extern
struct
block_device
*
lookup_bdev
(
const
char
*
);
extern
struct
block_device
*
lookup_bdev
(
const
char
*
);
extern
struct
block_device
*
open_bdev_excl
(
const
char
*
,
int
,
int
,
void
*
);
extern
struct
block_device
*
open_bdev_excl
(
const
char
*
,
int
,
int
,
void
*
);
extern
void
close_bdev_excl
(
struct
block_device
*
,
int
);
extern
void
close_bdev_excl
(
struct
block_device
*
,
int
);
...
...
kernel/ksyms.c
View file @
0948aa6d
...
@@ -515,6 +515,7 @@ EXPORT_SYMBOL(vsprintf);
...
@@ -515,6 +515,7 @@ EXPORT_SYMBOL(vsprintf);
EXPORT_SYMBOL
(
vsnprintf
);
EXPORT_SYMBOL
(
vsnprintf
);
EXPORT_SYMBOL
(
vsscanf
);
EXPORT_SYMBOL
(
vsscanf
);
EXPORT_SYMBOL
(
__bdevname
);
EXPORT_SYMBOL
(
__bdevname
);
EXPORT_SYMBOL
(
bdevname
);
EXPORT_SYMBOL
(
cdevname
);
EXPORT_SYMBOL
(
cdevname
);
EXPORT_SYMBOL
(
simple_strtoull
);
EXPORT_SYMBOL
(
simple_strtoull
);
EXPORT_SYMBOL
(
simple_strtoul
);
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