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
6af705cb
Commit
6af705cb
authored
Mar 06, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Plain Diff
Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-core
parents
72574bb3
f81ab470
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
19 deletions
+20
-19
fs/sysfs/bin.c
fs/sysfs/bin.c
+5
-1
fs/sysfs/dir.c
fs/sysfs/dir.c
+15
-18
No files found.
fs/sysfs/bin.c
View file @
6af705cb
...
...
@@ -50,6 +50,10 @@ read(struct file * file, char * userbuf, size_t count, loff_t * off)
ret
=
count
;
}
Done:
if
(
buffer
&&
buffer
->
data
)
{
kfree
(
buffer
->
data
);
buffer
->
data
=
NULL
;
}
return
ret
;
}
...
...
@@ -66,7 +70,7 @@ int alloc_buf_data(struct sysfs_bin_buffer * buffer)
static
int
fill_write
(
struct
file
*
file
,
const
char
*
userbuf
,
struct
sysfs_bin_buffer
*
buffer
)
{
return
copy_from_user
(
buffer
,
userbuf
,
buffer
->
count
)
?
return
copy_from_user
(
buffer
->
data
,
userbuf
,
buffer
->
count
)
?
-
EFAULT
:
0
;
}
...
...
fs/sysfs/dir.c
View file @
6af705cb
...
...
@@ -71,7 +71,7 @@ int sysfs_create_dir(struct kobject * kobj)
void
sysfs_remove_dir
(
struct
kobject
*
kobj
)
{
struct
list_head
*
node
,
*
next
;
struct
list_head
*
node
;
struct
dentry
*
dentry
=
dget
(
kobj
->
dentry
);
struct
dentry
*
parent
;
...
...
@@ -83,31 +83,28 @@ void sysfs_remove_dir(struct kobject * kobj)
down
(
&
parent
->
d_inode
->
i_sem
);
down
(
&
dentry
->
d_inode
->
i_sem
);
list_for_each_safe
(
node
,
next
,
&
dentry
->
d_subdirs
)
{
struct
dentry
*
d
=
dget
(
list_entry
(
node
,
struct
dentry
,
d_child
));
/**
* Make sure dentry is still there
*/
pr_debug
(
" o %s: "
,
d
->
d_name
.
name
);
if
(
d
->
d_inode
)
{
spin_lock
(
&
dcache_lock
);
node
=
dentry
->
d_subdirs
.
next
;
while
(
node
!=
&
dentry
->
d_subdirs
)
{
struct
dentry
*
d
=
list_entry
(
node
,
struct
dentry
,
d_child
);
list_del_init
(
node
);
pr_debug
(
" o %s (%d): "
,
d
->
d_name
.
name
,
atomic_read
(
&
d
->
d_count
));
if
(
d
->
d_inode
)
{
d
=
dget_locked
(
d
);
pr_debug
(
"removing"
);
/**
* Unlink and unhash.
*/
s
imple_unlink
(
dentry
->
d_inode
,
d
);
s
pin_unlock
(
&
dcache_lock
);
d_delete
(
d
);
/**
* Drop reference from initial sysfs_get_dentry().
*/
simple_unlink
(
dentry
->
d_inode
,
d
);
dput
(
d
);
spin_lock
(
&
dcache_lock
);
}
pr_debug
(
" done (%d)
\n
"
,
atomic_read
(
&
d
->
d_count
));
/**
* drop reference from dget() above.
*/
dput
(
d
);
pr_debug
(
" done
\n
"
);
node
=
dentry
->
d_subdirs
.
next
;
}
up
(
&
dentry
->
d_inode
->
i_sem
);
...
...
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