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
264f954f
Commit
264f954f
authored
Jul 05, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix i_nlink for root inode in ramfs/driverfs
parent
7970f12d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
fs/driverfs/inode.c
fs/driverfs/inode.c
+4
-3
fs/ramfs/inode.c
fs/ramfs/inode.c
+4
-3
No files found.
fs/driverfs/inode.c
View file @
264f954f
...
...
@@ -119,6 +119,9 @@ struct inode *driverfs_get_inode(struct super_block *sb, int mode, int dev)
case
S_IFDIR
:
inode
->
i_op
=
&
driverfs_dir_inode_operations
;
inode
->
i_fop
=
&
simple_dir_operations
;
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode
->
i_nlink
++
;
break
;
case
S_IFLNK
:
inode
->
i_op
=
&
page_symlink_inode_operations
;
...
...
@@ -149,10 +152,8 @@ static int driverfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
lock_kernel
();
dentry
->
d_op
=
&
driverfs_dentry_dir_ops
;
res
=
driverfs_mknod
(
dir
,
dentry
,
mode
|
S_IFDIR
,
0
);
if
(
!
res
)
{
if
(
!
res
)
dir
->
i_nlink
++
;
dentry
->
d_inode
->
i_nlink
++
;
}
unlock_kernel
();
return
res
;
}
...
...
fs/ramfs/inode.c
View file @
264f954f
...
...
@@ -102,6 +102,9 @@ struct inode *ramfs_get_inode(struct super_block *sb, int mode, int dev)
case
S_IFDIR
:
inode
->
i_op
=
&
ramfs_dir_inode_operations
;
inode
->
i_fop
=
&
simple_dir_operations
;
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode
->
i_nlink
++
;
break
;
case
S_IFLNK
:
inode
->
i_op
=
&
page_symlink_inode_operations
;
...
...
@@ -131,10 +134,8 @@ static int ramfs_mknod(struct inode *dir, struct dentry *dentry, int mode, int d
static
int
ramfs_mkdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
int
mode
)
{
int
retval
=
ramfs_mknod
(
dir
,
dentry
,
mode
|
S_IFDIR
,
0
);
if
(
!
retval
)
{
if
(
!
retval
)
dir
->
i_nlink
++
;
dentry
->
d_inode
->
i_nlink
++
;
}
return
retval
;
}
...
...
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