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
1ea604a4
Commit
1ea604a4
authored
Feb 03, 2004
by
Andrew Morton
Committed by
Linus Torvalds
Feb 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] hugetlbfs cleanup
From: Anton Blanchard <anton@samba.org> Remove some duplicated hugetlbfs code.
parent
95912368
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
59 deletions
+4
-59
fs/hugetlbfs/inode.c
fs/hugetlbfs/inode.c
+4
-59
No files found.
fs/hugetlbfs/inode.c
View file @
1ea604a4
...
...
@@ -500,61 +500,6 @@ static int hugetlbfs_statfs(struct super_block *sb, struct kstatfs *buf)
return
0
;
}
static
int
hugetlbfs_link
(
struct
dentry
*
old_dentry
,
struct
inode
*
dir
,
struct
dentry
*
dentry
)
{
struct
inode
*
inode
=
old_dentry
->
d_inode
;
inode
->
i_ctime
=
dir
->
i_ctime
=
dir
->
i_mtime
=
CURRENT_TIME
;
inode
->
i_nlink
++
;
atomic_inc
(
&
inode
->
i_count
);
dget
(
dentry
);
d_instantiate
(
dentry
,
inode
);
return
0
;
}
static
int
hugetlbfs_unlink
(
struct
inode
*
dir
,
struct
dentry
*
dentry
)
{
struct
inode
*
inode
=
dentry
->
d_inode
;
inode
->
i_ctime
=
dir
->
i_ctime
=
dir
->
i_mtime
=
CURRENT_TIME
;
inode
->
i_nlink
--
;
dput
(
dentry
);
return
0
;
}
static
int
hugetlbfs_rmdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
)
{
if
(
!
simple_empty
(
dentry
))
return
-
ENOTEMPTY
;
dir
->
i_nlink
--
;
return
hugetlbfs_unlink
(
dir
,
dentry
);
}
static
int
hugetlbfs_rename
(
struct
inode
*
old_dir
,
struct
dentry
*
old_dentry
,
struct
inode
*
new_dir
,
struct
dentry
*
new_dentry
)
{
struct
inode
*
inode
=
old_dentry
->
d_inode
;
int
they_are_dirs
=
S_ISDIR
(
inode
->
i_mode
);
if
(
!
simple_empty
(
new_dentry
))
return
-
ENOTEMPTY
;
if
(
new_dentry
->
d_inode
)
{
hugetlbfs_unlink
(
new_dir
,
new_dentry
);
if
(
they_are_dirs
)
old_dir
->
i_nlink
--
;
}
else
if
(
they_are_dirs
)
{
old_dir
->
i_nlink
--
;
new_dir
->
i_nlink
++
;
}
old_dir
->
i_ctime
=
old_dir
->
i_mtime
=
new_dir
->
i_ctime
=
new_dir
->
i_mtime
=
inode
->
i_ctime
=
CURRENT_TIME
;
return
0
;
}
static
void
hugetlbfs_put_super
(
struct
super_block
*
sb
)
{
struct
hugetlbfs_sb_info
*
sbi
=
HUGETLBFS_SB
(
sb
);
...
...
@@ -581,13 +526,13 @@ struct file_operations hugetlbfs_file_operations = {
static
struct
inode_operations
hugetlbfs_dir_inode_operations
=
{
.
create
=
hugetlbfs_create
,
.
lookup
=
simple_lookup
,
.
link
=
hugetlbfs
_link
,
.
unlink
=
hugetlbfs
_unlink
,
.
link
=
simple
_link
,
.
unlink
=
simple
_unlink
,
.
symlink
=
hugetlbfs_symlink
,
.
mkdir
=
hugetlbfs_mkdir
,
.
rmdir
=
hugetlbfs
_rmdir
,
.
rmdir
=
simple
_rmdir
,
.
mknod
=
hugetlbfs_mknod
,
.
rename
=
hugetlbfs
_rename
,
.
rename
=
simple
_rename
,
.
setattr
=
hugetlbfs_setattr
,
};
...
...
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