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
b393f4ef
Commit
b393f4ef
authored
Dec 03, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Dec 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] coda/psdev.c cleanup
switched to explicit devfs_register()/devfs_remove()
parent
e2cd7a43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
fs/coda/psdev.c
fs/coda/psdev.c
+17
-9
No files found.
fs/coda/psdev.c
View file @
b393f4ef
...
@@ -362,21 +362,24 @@ static struct file_operations coda_psdev_fops = {
...
@@ -362,21 +362,24 @@ static struct file_operations coda_psdev_fops = {
.
release
=
coda_psdev_release
,
.
release
=
coda_psdev_release
,
};
};
static
devfs_handle_t
devfs_handle
;
static
int
init_coda_psdev
(
void
)
static
int
init_coda_psdev
(
void
)
{
{
if
(
register_chrdev
(
CODA_PSDEV_MAJOR
,
"coda_psdev"
,
int
i
;
if
(
register_chrdev
(
CODA_PSDEV_MAJOR
,
"coda_psdev"
,
&
coda_psdev_fops
))
{
&
coda_psdev_fops
))
{
printk
(
KERN_ERR
"coda_psdev: unable to get major %d
\n
"
,
printk
(
KERN_ERR
"coda_psdev: unable to get major %d
\n
"
,
CODA_PSDEV_MAJOR
);
CODA_PSDEV_MAJOR
);
return
-
EIO
;
return
-
EIO
;
}
}
devfs_handle
=
devfs_mk_dir
(
NULL
,
"coda"
,
NULL
);
devfs_mk_dir
(
NULL
,
"coda"
,
NULL
);
devfs_register_series
(
devfs_handle
,
"%u"
,
MAX_CODADEVS
,
DEVFS_FL_NONE
,
for
(
i
=
0
;
i
<
MAX_CODADEVS
;
i
++
)
{
CODA_PSDEV_MAJOR
,
0
,
char
name
[
16
];
sprintf
(
name
,
"coda/%d"
,
i
);
devfs_register
(
NULL
,
name
,
DEVFS_FL_NONE
,
CODA_PSDEV_MAJOR
,
i
,
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
&
coda_psdev_fops
,
NULL
);
&
coda_psdev_fops
,
NULL
);
}
coda_sysctl_init
();
coda_sysctl_init
();
...
@@ -392,6 +395,7 @@ extern void coda_destroy_inodecache(void);
...
@@ -392,6 +395,7 @@ extern void coda_destroy_inodecache(void);
static
int
__init
init_coda
(
void
)
static
int
__init
init_coda
(
void
)
{
{
int
status
;
int
status
;
int
i
;
printk
(
KERN_INFO
"Coda Kernel/Venus communications, v5.3.15, coda@cs.cmu.edu
\n
"
);
printk
(
KERN_INFO
"Coda Kernel/Venus communications, v5.3.15, coda@cs.cmu.edu
\n
"
);
status
=
coda_init_inodecache
();
status
=
coda_init_inodecache
();
...
@@ -410,7 +414,9 @@ static int __init init_coda(void)
...
@@ -410,7 +414,9 @@ static int __init init_coda(void)
}
}
return
0
;
return
0
;
out:
out:
devfs_unregister
(
devfs_handle
);
for
(
i
=
0
;
i
<
MAX_CODADEVS
;
i
++
)
devfs_remove
(
"coda/%d"
,
i
);
devfs_remove
(
"coda"
);
unregister_chrdev
(
CODA_PSDEV_MAJOR
,
"coda_psdev"
);
unregister_chrdev
(
CODA_PSDEV_MAJOR
,
"coda_psdev"
);
coda_sysctl_clean
();
coda_sysctl_clean
();
out1:
out1:
...
@@ -421,13 +427,15 @@ static int __init init_coda(void)
...
@@ -421,13 +427,15 @@ static int __init init_coda(void)
static
void
__exit
exit_coda
(
void
)
static
void
__exit
exit_coda
(
void
)
{
{
int
err
;
int
err
,
i
;
err
=
unregister_filesystem
(
&
coda_fs_type
);
err
=
unregister_filesystem
(
&
coda_fs_type
);
if
(
err
!=
0
)
{
if
(
err
!=
0
)
{
printk
(
"coda: failed to unregister filesystem
\n
"
);
printk
(
"coda: failed to unregister filesystem
\n
"
);
}
}
devfs_unregister
(
devfs_handle
);
for
(
i
=
0
;
i
<
MAX_CODADEVS
;
i
++
)
devfs_remove
(
"coda/%d"
,
i
);
devfs_remove
(
"coda"
);
unregister_chrdev
(
CODA_PSDEV_MAJOR
,
"coda_psdev"
);
unregister_chrdev
(
CODA_PSDEV_MAJOR
,
"coda_psdev"
);
coda_sysctl_clean
();
coda_sysctl_clean
();
coda_destroy_inodecache
();
coda_destroy_inodecache
();
...
...
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