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
ad76cbc6
Commit
ad76cbc6
authored
Aug 28, 2008
by
Alexey Dobriyan
Committed by
Al Viro
Oct 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH 2/2] anondev: switch to IDA
Signed-off-by:
Alexey Dobriyan
<
adobriyan@gmail.com
>
parent
6de24f0e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
fs/super.c
fs/super.c
+5
-5
No files found.
fs/super.c
View file @
ad76cbc6
...
@@ -682,7 +682,7 @@ void emergency_remount(void)
...
@@ -682,7 +682,7 @@ void emergency_remount(void)
* filesystems which don't use real block-devices. -- jrs
* filesystems which don't use real block-devices. -- jrs
*/
*/
static
DEFINE_ID
R
(
unnamed_dev_idr
);
static
DEFINE_ID
A
(
unnamed_dev_ida
);
static
DEFINE_SPINLOCK
(
unnamed_dev_lock
);
/* protects the above */
static
DEFINE_SPINLOCK
(
unnamed_dev_lock
);
/* protects the above */
int
set_anon_super
(
struct
super_block
*
s
,
void
*
data
)
int
set_anon_super
(
struct
super_block
*
s
,
void
*
data
)
...
@@ -691,10 +691,10 @@ int set_anon_super(struct super_block *s, void *data)
...
@@ -691,10 +691,10 @@ int set_anon_super(struct super_block *s, void *data)
int
error
;
int
error
;
retry:
retry:
if
(
id
r_pre_get
(
&
unnamed_dev_idr
,
GFP_ATOMIC
)
==
0
)
if
(
id
a_pre_get
(
&
unnamed_dev_ida
,
GFP_ATOMIC
)
==
0
)
return
-
ENOMEM
;
return
-
ENOMEM
;
spin_lock
(
&
unnamed_dev_lock
);
spin_lock
(
&
unnamed_dev_lock
);
error
=
id
r_get_new
(
&
unnamed_dev_idr
,
NULL
,
&
dev
);
error
=
id
a_get_new
(
&
unnamed_dev_ida
,
&
dev
);
spin_unlock
(
&
unnamed_dev_lock
);
spin_unlock
(
&
unnamed_dev_lock
);
if
(
error
==
-
EAGAIN
)
if
(
error
==
-
EAGAIN
)
/* We raced and lost with another CPU. */
/* We raced and lost with another CPU. */
...
@@ -704,7 +704,7 @@ int set_anon_super(struct super_block *s, void *data)
...
@@ -704,7 +704,7 @@ int set_anon_super(struct super_block *s, void *data)
if
((
dev
&
MAX_ID_MASK
)
==
(
1
<<
MINORBITS
))
{
if
((
dev
&
MAX_ID_MASK
)
==
(
1
<<
MINORBITS
))
{
spin_lock
(
&
unnamed_dev_lock
);
spin_lock
(
&
unnamed_dev_lock
);
id
r_remove
(
&
unnamed_dev_idr
,
dev
);
id
a_remove
(
&
unnamed_dev_ida
,
dev
);
spin_unlock
(
&
unnamed_dev_lock
);
spin_unlock
(
&
unnamed_dev_lock
);
return
-
EMFILE
;
return
-
EMFILE
;
}
}
...
@@ -720,7 +720,7 @@ void kill_anon_super(struct super_block *sb)
...
@@ -720,7 +720,7 @@ void kill_anon_super(struct super_block *sb)
generic_shutdown_super
(
sb
);
generic_shutdown_super
(
sb
);
spin_lock
(
&
unnamed_dev_lock
);
spin_lock
(
&
unnamed_dev_lock
);
id
r_remove
(
&
unnamed_dev_idr
,
slot
);
id
a_remove
(
&
unnamed_dev_ida
,
slot
);
spin_unlock
(
&
unnamed_dev_lock
);
spin_unlock
(
&
unnamed_dev_lock
);
}
}
...
...
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