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
1cf97d0d
Commit
1cf97d0d
authored
Jan 29, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configfs: fold create_dir() into its only caller
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
c88b1e70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
34 deletions
+29
-34
fs/configfs/dir.c
fs/configfs/dir.c
+29
-34
No files found.
fs/configfs/dir.c
View file @
1cf97d0d
...
@@ -260,37 +260,6 @@ static void init_symlink(struct inode * inode)
...
@@ -260,37 +260,6 @@ static void init_symlink(struct inode * inode)
inode
->
i_op
=
&
configfs_symlink_inode_operations
;
inode
->
i_op
=
&
configfs_symlink_inode_operations
;
}
}
static
int
create_dir
(
struct
config_item
*
k
,
struct
dentry
*
d
)
{
int
error
;
umode_t
mode
=
S_IFDIR
|
S_IRWXU
|
S_IRUGO
|
S_IXUGO
;
struct
dentry
*
p
=
d
->
d_parent
;
BUG_ON
(
!
k
);
error
=
configfs_dirent_exists
(
p
->
d_fsdata
,
d
->
d_name
.
name
);
if
(
!
error
)
error
=
configfs_make_dirent
(
p
->
d_fsdata
,
d
,
k
,
mode
,
CONFIGFS_DIR
|
CONFIGFS_USET_CREATING
);
if
(
!
error
)
{
configfs_set_dir_dirent_depth
(
p
->
d_fsdata
,
d
->
d_fsdata
);
error
=
configfs_create
(
d
,
mode
,
init_dir
);
if
(
!
error
)
{
inc_nlink
(
p
->
d_inode
);
}
else
{
struct
configfs_dirent
*
sd
=
d
->
d_fsdata
;
if
(
sd
)
{
spin_lock
(
&
configfs_dirent_lock
);
list_del_init
(
&
sd
->
s_sibling
);
spin_unlock
(
&
configfs_dirent_lock
);
configfs_put
(
sd
);
}
}
}
return
error
;
}
/**
/**
* configfs_create_dir - create a directory for an config_item.
* configfs_create_dir - create a directory for an config_item.
* @item: config_itemwe're creating directory for.
* @item: config_itemwe're creating directory for.
...
@@ -300,11 +269,37 @@ static int create_dir(struct config_item *k, struct dentry *d)
...
@@ -300,11 +269,37 @@ static int create_dir(struct config_item *k, struct dentry *d)
* until it is validated by configfs_dir_set_ready()
* until it is validated by configfs_dir_set_ready()
*/
*/
static
int
configfs_create_dir
(
struct
config_item
*
item
,
struct
dentry
*
dentry
)
static
int
configfs_create_dir
(
struct
config_item
*
item
,
struct
dentry
*
dentry
)
{
{
int
error
=
create_dir
(
item
,
dentry
);
int
error
;
if
(
!
error
)
umode_t
mode
=
S_IFDIR
|
S_IRWXU
|
S_IRUGO
|
S_IXUGO
;
struct
dentry
*
p
=
dentry
->
d_parent
;
BUG_ON
(
!
item
);
error
=
configfs_dirent_exists
(
p
->
d_fsdata
,
dentry
->
d_name
.
name
);
if
(
unlikely
(
error
))
return
error
;
error
=
configfs_make_dirent
(
p
->
d_fsdata
,
dentry
,
item
,
mode
,
CONFIGFS_DIR
|
CONFIGFS_USET_CREATING
);
if
(
unlikely
(
error
))
return
error
;
configfs_set_dir_dirent_depth
(
p
->
d_fsdata
,
dentry
->
d_fsdata
);
error
=
configfs_create
(
dentry
,
mode
,
init_dir
);
if
(
!
error
)
{
inc_nlink
(
p
->
d_inode
);
item
->
ci_dentry
=
dentry
;
item
->
ci_dentry
=
dentry
;
}
else
{
struct
configfs_dirent
*
sd
=
dentry
->
d_fsdata
;
if
(
sd
)
{
spin_lock
(
&
configfs_dirent_lock
);
list_del_init
(
&
sd
->
s_sibling
);
spin_unlock
(
&
configfs_dirent_lock
);
configfs_put
(
sd
);
}
}
return
error
;
return
error
;
}
}
...
...
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