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
cac69886
Commit
cac69886
authored
Feb 06, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Feb 06, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] (1/9) more ->get_sb() stuff
More ->get_sb() patches. shmem/tmpfs switched
parent
397c080c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
8 deletions
+29
-8
mm/shmem.c
mm/shmem.c
+29
-8
No files found.
mm/shmem.c
View file @
cac69886
...
...
@@ -1267,7 +1267,7 @@ int shmem_sync_file(struct file * file, struct dentry *dentry, int datasync)
}
#endif
static
struct
super_block
*
shmem_read
_super
(
struct
super_block
*
sb
,
void
*
data
,
int
silent
)
static
int
shmem_fill
_super
(
struct
super_block
*
sb
,
void
*
data
,
int
silent
)
{
struct
inode
*
inode
;
struct
dentry
*
root
;
...
...
@@ -1286,7 +1286,7 @@ static struct super_block *shmem_read_super(struct super_block * sb, void * data
#ifdef CONFIG_TMPFS
if
(
shmem_parse_options
(
data
,
&
mode
,
&
blocks
,
&
inodes
))
{
printk
(
KERN_ERR
"tmpfs invalid option
\n
"
);
return
NUL
L
;
return
-
EINVA
L
;
}
#endif
...
...
@@ -1302,15 +1302,15 @@ static struct super_block *shmem_read_super(struct super_block * sb, void * data
sb
->
s_op
=
&
shmem_ops
;
inode
=
shmem_get_inode
(
sb
,
S_IFDIR
|
mode
,
0
);
if
(
!
inode
)
return
NULL
;
return
-
ENOMEM
;
root
=
d_alloc_root
(
inode
);
if
(
!
root
)
{
iput
(
inode
);
return
NULL
;
return
-
ENOMEM
;
}
sb
->
s_root
=
root
;
return
sb
;
return
0
;
}
static
kmem_cache_t
*
shmem_inode_cachep
;
...
...
@@ -1410,12 +1410,33 @@ static struct vm_operations_struct shmem_vm_ops = {
nopage:
shmem_nopage
,
};
static
struct
super_block
*
shmem_get_sb
(
struct
file_system_type
*
fs_type
,
int
flags
,
char
*
dev_name
,
void
*
data
)
{
return
get_sb_nodev
(
fs_type
,
flags
,
data
,
shmem_fill_super
);
}
#ifdef CONFIG_TMPFS
/* type "shm" will be tagged obsolete in 2.5 */
static
DECLARE_FSTYPE
(
shmem_fs_type
,
"shm"
,
shmem_read_super
,
FS_LITTER
);
static
DECLARE_FSTYPE
(
tmpfs_fs_type
,
"tmpfs"
,
shmem_read_super
,
FS_LITTER
);
static
struct
file_system_type
shmem_fs_type
=
{
owner:
THIS_MODULE
,
name:
"shmem"
,
get_sb:
shmem_get_sb
,
fs_flags:
FS_LITTER
,
};
static
struct
file_system_type
tmpfs_fs_type
=
{
owner:
THIS_MODULE
,
name:
"tmpfs"
,
get_sb:
shmem_get_sb
,
fs_flags:
FS_LITTER
,
};
#else
static
DECLARE_FSTYPE
(
tmpfs_fs_type
,
"tmpfs"
,
shmem_read_super
,
FS_LITTER
|
FS_NOMOUNT
);
static
struct
file_system_type
tmpfs_fs_type
=
{
owner:
THIS_MODULE
,
name:
"tmpfs"
,
get_sb:
shmem_get_sb
,
fs_flags:
FS_LITTER
|
FS_NOMOUNT
,
};
#endif
static
struct
vfsmount
*
shm_mnt
;
...
...
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