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
634095da
Commit
634095da
authored
Feb 27, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
9p: don't bother with private lock in ->d_fsdata; dentry->d_lock will do just fine
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
6131ffaa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
fs/9p/fid.c
fs/9p/fid.c
+4
-5
fs/9p/fid.h
fs/9p/fid.h
+2
-2
No files found.
fs/9p/fid.c
View file @
634095da
...
...
@@ -54,14 +54,13 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
if
(
!
dent
)
return
-
ENOMEM
;
spin_lock_init
(
&
dent
->
lock
);
INIT_LIST_HEAD
(
&
dent
->
fidlist
);
dentry
->
d_fsdata
=
dent
;
}
spin_lock
(
&
dent
->
lock
);
spin_lock
(
&
dent
ry
->
d_
lock
);
list_add
(
&
fid
->
dlist
,
&
dent
->
fidlist
);
spin_unlock
(
&
dent
->
lock
);
spin_unlock
(
&
dent
ry
->
d_
lock
);
return
0
;
}
...
...
@@ -85,14 +84,14 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any)
dent
=
(
struct
v9fs_dentry
*
)
dentry
->
d_fsdata
;
ret
=
NULL
;
if
(
dent
)
{
spin_lock
(
&
dent
->
lock
);
spin_lock
(
&
dent
ry
->
d_
lock
);
list_for_each_entry
(
fid
,
&
dent
->
fidlist
,
dlist
)
{
if
(
any
||
uid_eq
(
fid
->
uid
,
uid
))
{
ret
=
fid
;
break
;
}
}
spin_unlock
(
&
dent
->
lock
);
spin_unlock
(
&
dent
ry
->
d_
lock
);
}
return
ret
;
...
...
fs/9p/fid.h
View file @
634095da
...
...
@@ -25,7 +25,6 @@
/**
* struct v9fs_dentry - 9p private data stored in dentry d_fsdata
* @lock: protects the fidlist
* @fidlist: list of FIDs currently associated with this dentry
*
* This structure defines the 9p private data associated with
...
...
@@ -35,11 +34,12 @@
* inodes in order to more closely map functionality to the Plan 9
* expected behavior for FID reclaimation and tracking.
*
* Protected by ->d_lock of dentry it belongs to.
*
* See Also: Mapping FIDs to Linux VFS model in
* Design and Implementation of the Linux 9P File System documentation
*/
struct
v9fs_dentry
{
spinlock_t
lock
;
/* protect fidlist */
struct
list_head
fidlist
;
};
...
...
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