Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jan.koester
Linux
Commits
5b91aca0
Commit
5b91aca0
authored
13 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
usbfs: propagate umode_t
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
fec0ebae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/usb/core/inode.c
+8
-10
8 additions, 10 deletions
drivers/usb/core/inode.c
with
8 additions
and
10 deletions
drivers/usb/core/inode.c
+
8
−
10
View file @
5b91aca0
...
...
@@ -270,15 +270,13 @@ static int remount(struct super_block *sb, int *flags, char *data)
return
0
;
}
static
struct
inode
*
usbfs_get_inode
(
struct
super_block
*
sb
,
in
t
mode
,
dev_t
dev
)
static
struct
inode
*
usbfs_get_inode
(
struct
super_block
*
sb
,
umode_
t
mode
,
dev_t
dev
)
{
struct
inode
*
inode
=
new_inode
(
sb
);
if
(
inode
)
{
inode
->
i_ino
=
get_next_ino
();
inode
->
i_mode
=
mode
;
inode
->
i_uid
=
current_fsuid
();
inode
->
i_gid
=
current_fsgid
();
inode_init_owner
(
inode
,
NULL
,
mode
);
inode
->
i_atime
=
inode
->
i_mtime
=
inode
->
i_ctime
=
CURRENT_TIME
;
switch
(
mode
&
S_IFMT
)
{
default:
...
...
@@ -300,7 +298,7 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de
}
/* SMP-safe */
static
int
usbfs_mknod
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
in
t
mode
,
static
int
usbfs_mknod
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
umode_
t
mode
,
dev_t
dev
)
{
struct
inode
*
inode
=
usbfs_get_inode
(
dir
->
i_sb
,
mode
,
dev
);
...
...
@@ -317,7 +315,7 @@ static int usbfs_mknod (struct inode *dir, struct dentry *dentry, int mode,
return
error
;
}
static
int
usbfs_mkdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
in
t
mode
)
static
int
usbfs_mkdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
umode_
t
mode
)
{
int
res
;
...
...
@@ -328,7 +326,7 @@ static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, int mode)
return
res
;
}
static
int
usbfs_create
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
in
t
mode
)
static
int
usbfs_create
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
umode_
t
mode
)
{
mode
=
(
mode
&
S_IALLUGO
)
|
S_IFREG
;
return
usbfs_mknod
(
dir
,
dentry
,
mode
,
0
);
...
...
@@ -489,7 +487,7 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent)
*
* This function handles both regular files and directories.
*/
static
int
fs_create_by_name
(
const
char
*
name
,
mode_t
mode
,
static
int
fs_create_by_name
(
const
char
*
name
,
u
mode_t
mode
,
struct
dentry
*
parent
,
struct
dentry
**
dentry
)
{
int
error
=
0
;
...
...
@@ -513,7 +511,7 @@ static int fs_create_by_name (const char *name, mode_t mode,
mutex_lock
(
&
parent
->
d_inode
->
i_mutex
);
*
dentry
=
lookup_one_len
(
name
,
parent
,
strlen
(
name
));
if
(
!
IS_ERR
(
*
dentry
))
{
if
(
(
mode
&
S_IFMT
)
==
S_IFDIR
)
if
(
S_ISDIR
(
mode
)
)
error
=
usbfs_mkdir
(
parent
->
d_inode
,
*
dentry
,
mode
);
else
error
=
usbfs_create
(
parent
->
d_inode
,
*
dentry
,
mode
);
...
...
@@ -524,7 +522,7 @@ static int fs_create_by_name (const char *name, mode_t mode,
return
error
;
}
static
struct
dentry
*
fs_create_file
(
const
char
*
name
,
mode_t
mode
,
static
struct
dentry
*
fs_create_file
(
const
char
*
name
,
u
mode_t
mode
,
struct
dentry
*
parent
,
void
*
data
,
const
struct
file_operations
*
fops
,
uid_t
uid
,
gid_t
gid
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment