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
5b91aca0
Commit
5b91aca0
authored
Jul 24, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usbfs: propagate umode_t
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
fec0ebae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
drivers/usb/core/inode.c
drivers/usb/core/inode.c
+8
-10
No files found.
drivers/usb/core/inode.c
View file @
5b91aca0
...
@@ -270,15 +270,13 @@ static int remount(struct super_block *sb, int *flags, char *data)
...
@@ -270,15 +270,13 @@ static int remount(struct super_block *sb, int *flags, char *data)
return
0
;
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
);
struct
inode
*
inode
=
new_inode
(
sb
);
if
(
inode
)
{
if
(
inode
)
{
inode
->
i_ino
=
get_next_ino
();
inode
->
i_ino
=
get_next_ino
();
inode
->
i_mode
=
mode
;
inode_init_owner
(
inode
,
NULL
,
mode
);
inode
->
i_uid
=
current_fsuid
();
inode
->
i_gid
=
current_fsgid
();
inode
->
i_atime
=
inode
->
i_mtime
=
inode
->
i_ctime
=
CURRENT_TIME
;
inode
->
i_atime
=
inode
->
i_mtime
=
inode
->
i_ctime
=
CURRENT_TIME
;
switch
(
mode
&
S_IFMT
)
{
switch
(
mode
&
S_IFMT
)
{
default:
default:
...
@@ -300,7 +298,7 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de
...
@@ -300,7 +298,7 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de
}
}
/* SMP-safe */
/* 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
)
dev_t
dev
)
{
{
struct
inode
*
inode
=
usbfs_get_inode
(
dir
->
i_sb
,
mode
,
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,
...
@@ -317,7 +315,7 @@ static int usbfs_mknod (struct inode *dir, struct dentry *dentry, int mode,
return
error
;
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
;
int
res
;
...
@@ -328,7 +326,7 @@ static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, int mode)
...
@@ -328,7 +326,7 @@ static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, int mode)
return
res
;
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
;
mode
=
(
mode
&
S_IALLUGO
)
|
S_IFREG
;
return
usbfs_mknod
(
dir
,
dentry
,
mode
,
0
);
return
usbfs_mknod
(
dir
,
dentry
,
mode
,
0
);
...
@@ -489,7 +487,7 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent)
...
@@ -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.
* 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
)
struct
dentry
*
parent
,
struct
dentry
**
dentry
)
{
{
int
error
=
0
;
int
error
=
0
;
...
@@ -513,7 +511,7 @@ static int fs_create_by_name (const char *name, mode_t mode,
...
@@ -513,7 +511,7 @@ static int fs_create_by_name (const char *name, mode_t mode,
mutex_lock
(
&
parent
->
d_inode
->
i_mutex
);
mutex_lock
(
&
parent
->
d_inode
->
i_mutex
);
*
dentry
=
lookup_one_len
(
name
,
parent
,
strlen
(
name
));
*
dentry
=
lookup_one_len
(
name
,
parent
,
strlen
(
name
));
if
(
!
IS_ERR
(
*
dentry
))
{
if
(
!
IS_ERR
(
*
dentry
))
{
if
(
(
mode
&
S_IFMT
)
==
S_IFDIR
)
if
(
S_ISDIR
(
mode
)
)
error
=
usbfs_mkdir
(
parent
->
d_inode
,
*
dentry
,
mode
);
error
=
usbfs_mkdir
(
parent
->
d_inode
,
*
dentry
,
mode
);
else
else
error
=
usbfs_create
(
parent
->
d_inode
,
*
dentry
,
mode
);
error
=
usbfs_create
(
parent
->
d_inode
,
*
dentry
,
mode
);
...
@@ -524,7 +522,7 @@ static int fs_create_by_name (const char *name, mode_t mode,
...
@@ -524,7 +522,7 @@ static int fs_create_by_name (const char *name, mode_t mode,
return
error
;
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
,
struct
dentry
*
parent
,
void
*
data
,
const
struct
file_operations
*
fops
,
const
struct
file_operations
*
fops
,
uid_t
uid
,
gid_t
gid
)
uid_t
uid
,
gid_t
gid
)
...
...
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