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
65ae2396
Commit
65ae2396
authored
Feb 05, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Feb 05, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] (5/5) beginning of getattr series.
ia64: switched from sys_new*stat() to vfs_*stat() and cleaned up.
parent
d663eaa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
92 deletions
+65
-92
arch/ia64/ia32/sys_ia32.c
arch/ia64/ia32/sys_ia32.c
+65
-92
No files found.
arch/ia64/ia32/sys_ia32.c
View file @
65ae2396
...
@@ -171,77 +171,65 @@ sys32_execve (char *filename, unsigned int argv, unsigned int envp,
...
@@ -171,77 +171,65 @@ sys32_execve (char *filename, unsigned int argv, unsigned int envp,
}
}
static
inline
int
static
inline
int
putstat
(
struct
stat32
*
ubuf
,
struct
stat
*
kbuf
)
putstat
(
struct
stat32
*
ubuf
,
struct
kstat
*
stat
)
{
{
int
err
;
int
err
;
if
(
stat
->
size
>
MAX_NON_LFS
)
return
-
EOVERFLOW
;
if
(
clear_user
(
ubuf
,
sizeof
(
*
ubuf
)))
if
(
clear_user
(
ubuf
,
sizeof
(
*
ubuf
)))
return
1
;
return
-
EFAULT
;
err
=
__put_user
(
kbuf
->
st_
dev
,
&
ubuf
->
st_dev
);
err
=
__put_user
(
stat
->
dev
,
&
ubuf
->
st_dev
);
err
|=
__put_user
(
kbuf
->
st_
ino
,
&
ubuf
->
st_ino
);
err
|=
__put_user
(
stat
->
ino
,
&
ubuf
->
st_ino
);
err
|=
__put_user
(
kbuf
->
st_
mode
,
&
ubuf
->
st_mode
);
err
|=
__put_user
(
stat
->
mode
,
&
ubuf
->
st_mode
);
err
|=
__put_user
(
kbuf
->
st_
nlink
,
&
ubuf
->
st_nlink
);
err
|=
__put_user
(
stat
->
nlink
,
&
ubuf
->
st_nlink
);
err
|=
__put_user
(
kbuf
->
st_uid
,
&
ubuf
->
st_uid
);
err
|=
__put_user
(
high2lowuid
(
stat
->
uid
)
,
&
ubuf
->
st_uid
);
err
|=
__put_user
(
kbuf
->
st_gid
,
&
ubuf
->
st_gid
);
err
|=
__put_user
(
high2lowgid
(
stat
->
gid
)
,
&
ubuf
->
st_gid
);
err
|=
__put_user
(
kbuf
->
st_
rdev
,
&
ubuf
->
st_rdev
);
err
|=
__put_user
(
stat
->
rdev
,
&
ubuf
->
st_rdev
);
err
|=
__put_user
(
kbuf
->
st_
size
,
&
ubuf
->
st_size
);
err
|=
__put_user
(
stat
->
size
,
&
ubuf
->
st_size
);
err
|=
__put_user
(
kbuf
->
st_
atime
,
&
ubuf
->
st_atime
);
err
|=
__put_user
(
stat
->
atime
,
&
ubuf
->
st_atime
);
err
|=
__put_user
(
kbuf
->
st_
mtime
,
&
ubuf
->
st_mtime
);
err
|=
__put_user
(
stat
->
mtime
,
&
ubuf
->
st_mtime
);
err
|=
__put_user
(
kbuf
->
st_
ctime
,
&
ubuf
->
st_ctime
);
err
|=
__put_user
(
stat
->
ctime
,
&
ubuf
->
st_ctime
);
err
|=
__put_user
(
kbuf
->
st_
blksize
,
&
ubuf
->
st_blksize
);
err
|=
__put_user
(
stat
->
blksize
,
&
ubuf
->
st_blksize
);
err
|=
__put_user
(
kbuf
->
st_
blocks
,
&
ubuf
->
st_blocks
);
err
|=
__put_user
(
stat
->
blocks
,
&
ubuf
->
st_blocks
);
return
err
;
return
err
;
}
}
extern
asmlinkage
long
sys_newstat
(
char
*
filename
,
struct
stat
*
statbuf
);
asmlinkage
long
asmlinkage
long
sys32_newstat
(
char
*
filename
,
struct
stat32
*
statbuf
)
sys32_newstat
(
char
*
filename
,
struct
stat32
*
statbuf
)
{
{
int
ret
;
struct
kstat
stat
;
struct
stat
s
;
int
ret
=
vfs_stat
(
filename
,
&
stat
);
mm_segment_t
old_fs
=
get_fs
();
if
(
!
ret
)
ret
=
putstat
(
statbuf
,
&
stat
);
set_fs
(
KERNEL_DS
);
ret
=
sys_newstat
(
filename
,
&
s
);
set_fs
(
old_fs
);
if
(
putstat
(
statbuf
,
&
s
))
return
-
EFAULT
;
return
ret
;
return
ret
;
}
}
extern
asmlinkage
long
sys_newlstat
(
char
*
filename
,
struct
stat
*
statbuf
);
asmlinkage
long
asmlinkage
long
sys32_newlstat
(
char
*
filename
,
struct
stat32
*
statbuf
)
sys32_newlstat
(
char
*
filename
,
struct
stat32
*
statbuf
)
{
{
mm_segment_t
old_fs
=
get_fs
();
struct
kstat
stat
;
struct
stat
s
;
int
ret
=
vfs_lstat
(
filename
,
&
stat
);
int
ret
;
if
(
!
ret
)
ret
=
putstat
(
statbuf
,
&
stat
);
set_fs
(
KERNEL_DS
);
ret
=
sys_newlstat
(
filename
,
&
s
);
set_fs
(
old_fs
);
if
(
putstat
(
statbuf
,
&
s
))
return
-
EFAULT
;
return
ret
;
return
ret
;
}
}
extern
asmlinkage
long
sys_newfstat
(
unsigned
int
fd
,
struct
stat
*
statbuf
);
asmlinkage
long
asmlinkage
long
sys32_newfstat
(
unsigned
int
fd
,
struct
stat32
*
statbuf
)
sys32_newfstat
(
unsigned
int
fd
,
struct
stat32
*
statbuf
)
{
{
mm_segment_t
old_fs
=
get_fs
();
struct
kstat
stat
;
struct
stat
s
;
int
ret
=
vfs_fstat
(
fd
,
&
stat
);
int
ret
;
if
(
!
ret
)
ret
=
putstat
(
statbuf
,
&
stat
);
set_fs
(
KERNEL_DS
);
ret
=
sys_newfstat
(
fd
,
&
s
);
set_fs
(
old_fs
);
if
(
putstat
(
statbuf
,
&
s
))
return
-
EFAULT
;
return
ret
;
return
ret
;
}
}
...
@@ -3529,74 +3517,59 @@ sys32_ftruncate64 (int fd, unsigned int len_lo, unsigned int len_hi)
...
@@ -3529,74 +3517,59 @@ sys32_ftruncate64 (int fd, unsigned int len_lo, unsigned int len_hi)
}
}
static
int
static
int
putstat64
(
struct
stat64
*
ubuf
,
struct
stat
*
kbuf
)
putstat64
(
struct
stat64
*
ubuf
,
struct
k
stat
*
kbuf
)
{
{
int
err
;
int
err
;
if
(
clear_user
(
ubuf
,
sizeof
(
*
ubuf
)))
if
(
clear_user
(
ubuf
,
sizeof
(
*
ubuf
)))
return
1
;
return
-
EFAULT
;
err
=
__put_user
(
kbuf
->
st_
dev
,
&
ubuf
->
st_dev
);
err
=
__put_user
(
kbuf
->
dev
,
&
ubuf
->
st_dev
);
err
|=
__put_user
(
kbuf
->
st_
ino
,
&
ubuf
->
__st_ino
);
err
|=
__put_user
(
kbuf
->
ino
,
&
ubuf
->
__st_ino
);
err
|=
__put_user
(
kbuf
->
st_
ino
,
&
ubuf
->
st_ino_lo
);
err
|=
__put_user
(
kbuf
->
ino
,
&
ubuf
->
st_ino_lo
);
err
|=
__put_user
(
kbuf
->
st_
ino
>>
32
,
&
ubuf
->
st_ino_hi
);
err
|=
__put_user
(
kbuf
->
ino
>>
32
,
&
ubuf
->
st_ino_hi
);
err
|=
__put_user
(
kbuf
->
st_
mode
,
&
ubuf
->
st_mode
);
err
|=
__put_user
(
kbuf
->
mode
,
&
ubuf
->
st_mode
);
err
|=
__put_user
(
kbuf
->
st_
nlink
,
&
ubuf
->
st_nlink
);
err
|=
__put_user
(
kbuf
->
nlink
,
&
ubuf
->
st_nlink
);
err
|=
__put_user
(
kbuf
->
st_
uid
,
&
ubuf
->
st_uid
);
err
|=
__put_user
(
kbuf
->
uid
,
&
ubuf
->
st_uid
);
err
|=
__put_user
(
kbuf
->
st_
gid
,
&
ubuf
->
st_gid
);
err
|=
__put_user
(
kbuf
->
gid
,
&
ubuf
->
st_gid
);
err
|=
__put_user
(
kbuf
->
st_
rdev
,
&
ubuf
->
st_rdev
);
err
|=
__put_user
(
kbuf
->
rdev
,
&
ubuf
->
st_rdev
);
err
|=
__put_user
(
kbuf
->
s
t_s
ize
,
&
ubuf
->
st_size_lo
);
err
|=
__put_user
(
kbuf
->
size
,
&
ubuf
->
st_size_lo
);
err
|=
__put_user
((
kbuf
->
s
t_s
ize
>>
32
),
&
ubuf
->
st_size_hi
);
err
|=
__put_user
((
kbuf
->
size
>>
32
),
&
ubuf
->
st_size_hi
);
err
|=
__put_user
(
kbuf
->
st_
atime
,
&
ubuf
->
st_atime
);
err
|=
__put_user
(
kbuf
->
atime
,
&
ubuf
->
st_atime
);
err
|=
__put_user
(
kbuf
->
st_
mtime
,
&
ubuf
->
st_mtime
);
err
|=
__put_user
(
kbuf
->
mtime
,
&
ubuf
->
st_mtime
);
err
|=
__put_user
(
kbuf
->
st_
ctime
,
&
ubuf
->
st_ctime
);
err
|=
__put_user
(
kbuf
->
ctime
,
&
ubuf
->
st_ctime
);
err
|=
__put_user
(
kbuf
->
st_
blksize
,
&
ubuf
->
st_blksize
);
err
|=
__put_user
(
kbuf
->
blksize
,
&
ubuf
->
st_blksize
);
err
|=
__put_user
(
kbuf
->
st_
blocks
,
&
ubuf
->
st_blocks
);
err
|=
__put_user
(
kbuf
->
blocks
,
&
ubuf
->
st_blocks
);
return
err
;
return
err
;
}
}
asmlinkage
long
asmlinkage
long
sys32_stat64
(
char
*
filename
,
struct
stat64
*
statbuf
)
sys32_stat64
(
char
*
filename
,
struct
stat64
*
statbuf
)
{
{
mm_segment_t
old_fs
=
get_fs
();
struct
kstat
s
;
struct
stat
s
;
long
ret
=
vfs_stat
(
filename
,
&
s
);
long
ret
;
if
(
!
ret
)
ret
=
putstat64
(
statbuf
,
&
s
);
set_fs
(
KERNEL_DS
);
ret
=
sys_newstat
(
filename
,
&
s
);
set_fs
(
old_fs
);
if
(
putstat64
(
statbuf
,
&
s
))
return
-
EFAULT
;
return
ret
;
return
ret
;
}
}
asmlinkage
long
asmlinkage
long
sys32_lstat64
(
char
*
filename
,
struct
stat64
*
statbuf
)
sys32_lstat64
(
char
*
filename
,
struct
stat64
*
statbuf
)
{
{
mm_segment_t
old_fs
=
get_fs
();
struct
kstat
s
;
struct
stat
s
;
long
ret
=
vfs_lstat
(
filename
,
&
s
);
long
ret
;
if
(
!
ret
)
ret
=
putstat64
(
statbuf
,
&
s
);
set_fs
(
KERNEL_DS
);
ret
=
sys_newlstat
(
filename
,
&
s
);
set_fs
(
old_fs
);
if
(
putstat64
(
statbuf
,
&
s
))
return
-
EFAULT
;
return
ret
;
return
ret
;
}
}
asmlinkage
long
asmlinkage
long
sys32_fstat64
(
unsigned
int
fd
,
struct
stat64
*
statbuf
)
sys32_fstat64
(
unsigned
int
fd
,
struct
stat64
*
statbuf
)
{
{
mm_segment_t
old_fs
=
get_fs
();
struct
kstat
s
;
struct
stat
s
;
long
ret
=
vfs_fstat
(
fd
,
&
s
);
long
ret
;
if
(
!
ret
)
ret
=
putstat64
(
statbuf
,
&
s
);
set_fs
(
KERNEL_DS
);
ret
=
sys_newfstat
(
fd
,
&
s
);
set_fs
(
old_fs
);
if
(
putstat64
(
statbuf
,
&
s
))
return
-
EFAULT
;
return
ret
;
return
ret
;
}
}
...
...
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