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
4ad2c922
Commit
4ad2c922
authored
Apr 20, 2003
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] devfs: switch over ubd to ->devfs_name
Duh, ubd is partitioned.
parent
d22af367
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
19 deletions
+10
-19
arch/um/drivers/ubd_kern.c
arch/um/drivers/ubd_kern.c
+10
-19
No files found.
arch/um/drivers/ubd_kern.c
View file @
4ad2c922
...
@@ -480,36 +480,29 @@ static int ubd_open_dev(struct ubd *dev)
...
@@ -480,36 +480,29 @@ static int ubd_open_dev(struct ubd *dev)
return
(
err
);
return
(
err
);
}
}
static
int
ubd_new_disk
(
int
major
,
u64
size
,
char
*
name
,
int
unit
,
static
int
ubd_new_disk
(
int
major
,
u64
size
,
int
unit
,
struct
gendisk
**
disk_out
)
struct
gendisk
**
disk_out
)
{
{
char
devfs_name
[
sizeof
(
"ubd/nnnnnn
\0
"
)];
struct
gendisk
*
disk
;
struct
gendisk
*
disk
;
int
minor
=
unit
<<
UBD_SHIFT
;
disk
=
alloc_disk
(
1
<<
UBD_SHIFT
);
disk
=
alloc_disk
(
1
<<
UBD_SHIFT
);
if
(
disk
==
NULL
)
if
(
!
disk
)
return
(
-
ENOMEM
)
;
return
-
ENOMEM
;
disk
->
major
=
major
;
disk
->
major
=
major
;
disk
->
first_minor
=
minor
;
disk
->
first_minor
=
unit
<<
UBD_SHIFT
;
disk
->
fops
=
&
ubd_blops
;
disk
->
fops
=
&
ubd_blops
;
set_capacity
(
disk
,
size
/
512
);
set_capacity
(
disk
,
size
/
512
);
/* needs to be ubd -> /dev/ubd/discX/disc */
sprintf
(
disk
->
disk_name
,
"ubd"
);
sprintf
(
disk
->
disk_name
,
"ubd"
);
*
disk_out
=
disk
;
sprintf
(
disk
->
devfs_name
,
"ubd/disc%d"
,
unit
)
;
/* /dev/ubd/N style names */
sprintf
(
devfs_name
,
"ubd/%d"
,
unit
);
*
handle_out
=
devfs_register
(
NULL
,
devfs_name
,
0
,
major
,
minor
,
S_IFBLK
|
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IWGRP
,
&
ubd_blops
,
NULL
);
disk
->
private_data
=
&
ubd_dev
[
unit
];
disk
->
private_data
=
&
ubd_dev
[
unit
];
disk
->
queue
=
&
ubd_queue
;
disk
->
queue
=
&
ubd_queue
;
add_disk
(
disk
);
add_disk
(
disk
);
return
(
0
);
*
disk_out
=
disk
;
return
0
;
}
}
static
int
ubd_add
(
int
n
)
static
int
ubd_add
(
int
n
)
...
@@ -530,12 +523,12 @@ static int ubd_add(int n)
...
@@ -530,12 +523,12 @@ static int ubd_add(int n)
if
(
err
)
if
(
err
)
return
(
err
);
return
(
err
);
err
=
ubd_new_disk
(
MAJOR_NR
,
dev
->
size
,
"ubd"
,
n
,
&
ubd_gendisk
[
n
]);
err
=
ubd_new_disk
(
MAJOR_NR
,
dev
->
size
,
n
,
&
ubd_gendisk
[
n
]);
if
(
err
)
if
(
err
)
return
(
err
);
return
(
err
);
if
(
fake_major
)
if
(
fake_major
)
ubd_new_disk
(
fake_major
,
dev
->
size
,
"ubd%d"
,
n
,
ubd_new_disk
(
fake_major
,
dev
->
size
,
n
,
&
fake_gendisk
[
n
]);
&
fake_gendisk
[
n
]);
/* perhaps this should also be under the "if (fake_major)" above */
/* perhaps this should also be under the "if (fake_major)" above */
...
@@ -635,13 +628,11 @@ static int ubd_remove(char *str)
...
@@ -635,13 +628,11 @@ static int ubd_remove(char *str)
del_gendisk
(
ubd_gendisk
[
n
]);
del_gendisk
(
ubd_gendisk
[
n
]);
put_disk
(
ubd_gendisk
[
n
]);
put_disk
(
ubd_gendisk
[
n
]);
ubd_gendisk
[
n
]
=
NULL
;
ubd_gendisk
[
n
]
=
NULL
;
devfs_remove
(
"ubd/%d"
,
n
);
if
(
fake_gendisk
[
n
]
!=
NULL
){
if
(
fake_gendisk
[
n
]
!=
NULL
){
del_gendisk
(
fake_gendisk
[
n
]);
del_gendisk
(
fake_gendisk
[
n
]);
put_disk
(
fake_gendisk
[
n
]);
put_disk
(
fake_gendisk
[
n
]);
fake_gendisk
[
n
]
=
NULL
;
fake_gendisk
[
n
]
=
NULL
;
devfs_remove
(
"ubd/%d"
,
n
);
}
}
*
dev
=
((
struct
ubd
)
DEFAULT_UBD
);
*
dev
=
((
struct
ubd
)
DEFAULT_UBD
);
...
...
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