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
f70158b9
Commit
f70158b9
authored
Jul 14, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Jul 14, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] futex filesystem handling
Eeek.... futex.c is seriously b0rken.
parent
ca3dd564
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
34 deletions
+5
-34
kernel/futex.c
kernel/futex.c
+5
-34
No files found.
kernel/futex.c
View file @
f70158b9
...
...
@@ -48,7 +48,7 @@
extern
void
send_sigio
(
struct
fown_struct
*
fown
,
int
fd
,
int
band
);
/* Everyone needs a dentry and inode */
static
struct
dentry
*
futex_dentry
;
static
struct
vfsmount
*
futex_mnt
;
/* We use this instead of a normal wait_queue_t, so we can wake only
the relevent ones (hashed queues may be shared) */
...
...
@@ -272,7 +272,8 @@ static int futex_fd(struct list_head *head,
return
-
ENFILE
;
}
filp
->
f_op
=
&
futex_fops
;
filp
->
f_dentry
=
dget
(
futex_dentry
);
filp
->
f_vfsmnt
=
mntget
(
futex_mnt
);
filp
->
f_dentry
=
dget
(
futex_mnt
->
mnt_root
);
if
(
signal
)
{
filp
->
f_owner
.
pid
=
current
->
pid
;
...
...
@@ -348,46 +349,16 @@ asmlinkage int sys_futex(void *uaddr, int op, int val, struct timespec *utime)
return
ret
;
}
/* FIXME: Oh yeah, makes sense to write a filesystem... */
static
struct
super_operations
futexfs_ops
=
{
statfs
:
simple_statfs
};
/* Don't check error returns: we're dead if they happen */
static
int
futexfs_fill_super
(
struct
super_block
*
sb
,
void
*
data
,
int
silent
)
{
struct
inode
*
root
;
sb
->
s_blocksize
=
1024
;
sb
->
s_blocksize_bits
=
10
;
sb
->
s_magic
=
0xBAD1DEA
;
sb
->
s_op
=
&
futexfs_ops
;
root
=
new_inode
(
sb
);
root
->
i_mode
=
S_IFDIR
|
S_IRUSR
|
S_IWUSR
;
root
->
i_uid
=
root
->
i_gid
=
0
;
root
->
i_atime
=
root
->
i_mtime
=
root
->
i_ctime
=
CURRENT_TIME
;
sb
->
s_root
=
d_alloc
(
NULL
,
&
(
const
struct
qstr
)
{
"futex"
,
5
,
0
});
sb
->
s_root
->
d_sb
=
sb
;
sb
->
s_root
->
d_parent
=
sb
->
s_root
;
d_instantiate
(
sb
->
s_root
,
root
);
/* We never let this drop to zero. */
futex_dentry
=
dget
(
sb
->
s_root
);
return
0
;
}
static
struct
super_block
*
futexfs_get_sb
(
struct
file_system_type
*
fs_type
,
int
flags
,
char
*
dev_name
,
void
*
data
)
{
return
get_sb_
nodev
(
fs_type
,
flags
,
data
,
futexfs_fill_super
);
return
get_sb_
pseudo
(
fs_type
,
"futex"
,
NULL
,
0xBAD1DEA
);
}
static
struct
file_system_type
futex_fs_type
=
{
name:
"futexfs"
,
get_sb:
futexfs_get_sb
,
kill_sb:
kill_anon_super
,
};
static
int
__init
init
(
void
)
...
...
@@ -395,7 +366,7 @@ static int __init init(void)
unsigned
int
i
;
register_filesystem
(
&
futex_fs_type
);
kern_mount
(
&
futex_fs_type
);
futex_mnt
=
kern_mount
(
&
futex_fs_type
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
futex_queues
);
i
++
)
INIT_LIST_HEAD
(
&
futex_queues
[
i
]);
...
...
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