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
f350db2c
Commit
f350db2c
authored
Nov 14, 2002
by
Alexander Viro
Committed by
Jens Axboe
Nov 14, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] eliminated use of devfs_auto_unregister() in checks.c
parent
8e96b6e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
fs/partitions/check.c
fs/partitions/check.c
+20
-19
No files found.
fs/partitions/check.c
View file @
f350db2c
...
@@ -163,7 +163,7 @@ static void devfs_register_partition(struct gendisk *dev, int part)
...
@@ -163,7 +163,7 @@ static void devfs_register_partition(struct gendisk *dev, int part)
if
(
p
[
part
-
1
].
de
)
if
(
p
[
part
-
1
].
de
)
return
;
return
;
dir
=
dev
fs_get_parent
(
dev
->
disk_de
)
;
dir
=
dev
->
de
;
if
(
!
dir
)
if
(
!
dir
)
return
;
return
;
if
(
dev
->
flags
&
GENHD_FL_REMOVABLE
)
if
(
dev
->
flags
&
GENHD_FL_REMOVABLE
)
...
@@ -178,7 +178,6 @@ static void devfs_register_partition(struct gendisk *dev, int part)
...
@@ -178,7 +178,6 @@ static void devfs_register_partition(struct gendisk *dev, int part)
#ifdef CONFIG_DEVFS_FS
#ifdef CONFIG_DEVFS_FS
static
struct
unique_numspace
disc_numspace
=
UNIQUE_NUMBERSPACE_INITIALISER
;
static
struct
unique_numspace
disc_numspace
=
UNIQUE_NUMBERSPACE_INITIALISER
;
static
devfs_handle_t
cdroms
;
static
struct
unique_numspace
cdrom_numspace
=
UNIQUE_NUMBERSPACE_INITIALISER
;
static
struct
unique_numspace
cdrom_numspace
=
UNIQUE_NUMBERSPACE_INITIALISER
;
#endif
#endif
...
@@ -189,7 +188,6 @@ static void devfs_create_partitions(struct gendisk *dev)
...
@@ -189,7 +188,6 @@ static void devfs_create_partitions(struct gendisk *dev)
devfs_handle_t
dir
,
slave
;
devfs_handle_t
dir
,
slave
;
unsigned
int
devfs_flags
=
DEVFS_FL_DEFAULT
;
unsigned
int
devfs_flags
=
DEVFS_FL_DEFAULT
;
char
dirname
[
64
],
symlink
[
16
];
char
dirname
[
64
],
symlink
[
16
];
static
devfs_handle_t
devfs_handle
;
if
(
dev
->
flags
&
GENHD_FL_REMOVABLE
)
if
(
dev
->
flags
&
GENHD_FL_REMOVABLE
)
devfs_flags
|=
DEVFS_FL_REMOVABLE
;
devfs_flags
|=
DEVFS_FL_REMOVABLE
;
...
@@ -206,19 +204,15 @@ static void devfs_create_partitions(struct gendisk *dev)
...
@@ -206,19 +204,15 @@ static void devfs_create_partitions(struct gendisk *dev)
sprintf
(
dirname
,
"../%s/disc%d"
,
dev
->
disk_name
,
sprintf
(
dirname
,
"../%s/disc%d"
,
dev
->
disk_name
,
dev
->
first_minor
>>
dev
->
minor_shift
);
dev
->
first_minor
>>
dev
->
minor_shift
);
dir
=
devfs_mk_dir
(
NULL
,
dirname
+
3
,
NULL
);
dir
=
devfs_mk_dir
(
NULL
,
dirname
+
3
,
NULL
);
dev
->
de
=
dir
;
}
}
if
(
!
devfs_handle
)
devfs_handle
=
devfs_mk_dir
(
NULL
,
"discs"
,
NULL
);
dev
->
number
=
devfs_alloc_unique_number
(
&
disc_numspace
);
dev
->
number
=
devfs_alloc_unique_number
(
&
disc_numspace
);
sprintf
(
symlink
,
"disc%d"
,
dev
->
number
);
sprintf
(
symlink
,
"disc
s/disc
%d"
,
dev
->
number
);
devfs_mk_symlink
(
devfs_handle
,
symlink
,
DEVFS_FL_DEFAULT
,
devfs_mk_symlink
(
NULL
,
symlink
,
DEVFS_FL_DEFAULT
,
dirname
+
pos
,
&
slave
,
NULL
);
dirname
+
pos
,
&
slave
,
NULL
);
dev
->
disk_de
=
devfs_register
(
dir
,
"disc"
,
devfs_flags
,
dev
->
disk_de
=
devfs_register
(
dir
,
"disc"
,
devfs_flags
,
dev
->
major
,
dev
->
first_minor
,
dev
->
major
,
dev
->
first_minor
,
S_IFBLK
|
S_IRUSR
|
S_IWUSR
,
dev
->
fops
,
NULL
);
S_IFBLK
|
S_IRUSR
|
S_IWUSR
,
dev
->
fops
,
NULL
);
devfs_auto_unregister
(
dev
->
disk_de
,
slave
);
if
(
!
(
dev
->
flags
&
GENHD_FL_DEVFS
))
devfs_auto_unregister
(
slave
,
dir
);
#endif
#endif
}
}
...
@@ -227,11 +221,8 @@ static void devfs_create_cdrom(struct gendisk *dev)
...
@@ -227,11 +221,8 @@ static void devfs_create_cdrom(struct gendisk *dev)
#ifdef CONFIG_DEVFS_FS
#ifdef CONFIG_DEVFS_FS
char
vname
[
23
];
char
vname
[
23
];
if
(
!
cdroms
)
cdroms
=
devfs_mk_dir
(
NULL
,
"cdroms"
,
NULL
);
dev
->
number
=
devfs_alloc_unique_number
(
&
cdrom_numspace
);
dev
->
number
=
devfs_alloc_unique_number
(
&
cdrom_numspace
);
sprintf
(
vname
,
"cdrom%d"
,
dev
->
number
);
sprintf
(
vname
,
"cdrom
s/cdrom
%d"
,
dev
->
number
);
if
(
dev
->
de
)
{
if
(
dev
->
de
)
{
int
pos
;
int
pos
;
devfs_handle_t
slave
;
devfs_handle_t
slave
;
...
@@ -245,10 +236,8 @@ static void devfs_create_cdrom(struct gendisk *dev)
...
@@ -245,10 +236,8 @@ static void devfs_create_cdrom(struct gendisk *dev)
pos
=
devfs_generate_path
(
dev
->
disk_de
,
rname
+
3
,
sizeof
(
rname
)
-
3
);
pos
=
devfs_generate_path
(
dev
->
disk_de
,
rname
+
3
,
sizeof
(
rname
)
-
3
);
if
(
pos
>=
0
)
{
if
(
pos
>=
0
)
{
strncpy
(
rname
+
pos
,
"../"
,
3
);
strncpy
(
rname
+
pos
,
"../"
,
3
);
devfs_mk_symlink
(
cdroms
,
vname
,
devfs_mk_symlink
(
NULL
,
vname
,
DEVFS_FL_DEFAULT
,
DEVFS_FL_DEFAULT
,
rname
+
pos
,
&
slave
,
NULL
);
rname
+
pos
,
&
slave
,
NULL
);
devfs_auto_unregister
(
dev
->
de
,
slave
);
}
}
}
else
{
}
else
{
dev
->
disk_de
=
devfs_register
(
NULL
,
vname
,
DEVFS_FL_DEFAULT
,
dev
->
disk_de
=
devfs_register
(
NULL
,
vname
,
DEVFS_FL_DEFAULT
,
...
@@ -264,10 +253,22 @@ static void devfs_remove_partitions(struct gendisk *dev)
...
@@ -264,10 +253,22 @@ static void devfs_remove_partitions(struct gendisk *dev)
#ifdef CONFIG_DEVFS_FS
#ifdef CONFIG_DEVFS_FS
devfs_unregister
(
dev
->
disk_de
);
devfs_unregister
(
dev
->
disk_de
);
dev
->
disk_de
=
NULL
;
dev
->
disk_de
=
NULL
;
if
(
dev
->
flags
&
GENHD_FL_CD
)
if
(
dev
->
flags
&
GENHD_FL_CD
)
{
char
name
[
64
];
sprintf
(
name
,
"cdroms/cdrom%d"
,
dev
->
number
);
if
(
dev
->
de
)
devfs_find_and_unregister
(
NULL
,
name
,
0
,
0
,
0
,
0
);
devfs_dealloc_unique_number
(
&
cdrom_numspace
,
dev
->
number
);
devfs_dealloc_unique_number
(
&
cdrom_numspace
,
dev
->
number
);
else
}
else
{
char
name
[
64
];
sprintf
(
name
,
"discs/disc%d"
,
dev
->
number
);
devfs_find_and_unregister
(
NULL
,
name
,
0
,
0
,
0
,
0
);
if
(
!
(
dev
->
flags
&
GENHD_FL_DEVFS
))
{
devfs_unregister
(
dev
->
de
);
dev
->
de
=
NULL
;
}
devfs_dealloc_unique_number
(
&
disc_numspace
,
dev
->
number
);
devfs_dealloc_unique_number
(
&
disc_numspace
,
dev
->
number
);
}
#endif
#endif
}
}
...
...
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