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
da9cd811
Commit
da9cd811
authored
Oct 08, 2003
by
Stephen Lord
Committed by
Stephen Lord
Oct 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More uio changes, add code attribution
parent
36a49183
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
42 deletions
+68
-42
fs/xfs/support/move.c
fs/xfs/support/move.c
+22
-24
fs/xfs/support/move.h
fs/xfs/support/move.h
+46
-18
No files found.
fs/xfs/support/move.c
View file @
da9cd811
/*
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
*
* This program is free software; you can redistribute it and/or modify it
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* under the terms of version 2 of the GNU General Public License as
...
@@ -45,30 +45,28 @@
...
@@ -45,30 +45,28 @@
int
int
uio_read
(
caddr_t
src
,
size_t
len
,
struct
uio
*
uio
)
uio_read
(
caddr_t
src
,
size_t
len
,
struct
uio
*
uio
)
{
{
struct
iovec
*
iov
;
size_t
count
;
u_int
cnt
;
int
error
;
if
(
len
>
0
&&
uio
->
uio_resid
)
{
if
(
!
len
||
!
uio
->
uio_resid
)
iov
=
uio
->
uio_iov
;
return
0
;
cnt
=
(
u_int
)
iov
->
iov_len
;
if
(
cnt
==
0
)
count
=
uio
->
uio_iov
->
iov_len
;
return
0
;
if
(
!
count
)
if
(
cnt
>
len
)
return
0
;
cnt
=
(
u_int
)
len
;
if
(
count
>
len
)
if
(
uio
->
uio_segflg
==
UIO_USERSPACE
)
{
count
=
len
;
error
=
copy_to_user
(
iov
->
iov_base
,
src
,
cnt
);
if
(
error
)
if
(
uio
->
uio_segflg
==
UIO_USERSPACE
)
{
return
EFAULT
;
if
(
copy_to_user
(
uio
->
uio_iov
->
iov_base
,
src
,
count
))
}
else
if
(
uio
->
uio_segflg
==
UIO_SYSSPACE
)
{
return
EFAULT
;
memcpy
(
iov
->
iov_base
,
src
,
cnt
);
}
else
{
}
else
{
ASSERT
(
uio
->
uio_segflg
==
UIO_SYSSPACE
);
ASSERT
(
0
);
memcpy
(
uio
->
uio_iov
->
iov_base
,
src
,
count
);
}
iov
->
iov_base
=
(
void
*
)((
char
*
)
iov
->
iov_base
+
cnt
);
iov
->
iov_len
-=
cnt
;
uio
->
uio_resid
-=
cnt
;
uio
->
uio_offset
+=
cnt
;
}
}
uio
->
uio_iov
->
iov_base
=
(
void
*
)((
char
*
)
uio
->
uio_iov
->
iov_base
+
count
);
uio
->
uio_iov
->
iov_len
-=
count
;
uio
->
uio_offset
+=
count
;
uio
->
uio_resid
-=
count
;
return
0
;
return
0
;
}
}
fs/xfs/support/move.h
View file @
da9cd811
/*
/*
* Copyright (c) 2000-200
2
Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-200
3
Silicon Graphics, Inc. All Rights Reserved.
*
*
* This program is free software; you can redistribute it and/or modify it
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* under the terms of version 2 of the GNU General Public License as
...
@@ -28,32 +28,60 @@
...
@@ -28,32 +28,60 @@
* For further information regarding this notice, see:
* For further information regarding this notice, see:
*
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*
* Portions Copyright (c) 1982, 1986, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
*/
#ifndef __XFS_SUPPORT_MOVE_H__
#ifndef __XFS_SUPPORT_MOVE_H__
#define __XFS_SUPPORT_MOVE_H__
#define __XFS_SUPPORT_MOVE_H__
#include <linux/uio.h>
#include <linux/uio.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
typedef
struct
iovec
iovec_t
;
/* Segment flag values. */
enum
uio_seg
{
UIO_USERSPACE
,
/* from user data space */
UIO_SYSSPACE
,
/* from system space */
};
typedef
struct
uio
{
struct
uio
{
iovec_t
*
uio_iov
;
/* pointer to array of iovecs */
struct
iovec
*
uio_iov
;
int
uio_iovcnt
;
/* number of iovecs */
int
uio_iovcnt
;
int
uio_fmode
;
/* file mode flags */
xfs_off_t
uio_offset
;
xfs_off_t
uio_offset
;
/* file offset */
int
uio_resid
;
short
uio_segflg
;
/* address space (kernel or user) */
enum
uio_seg
uio_segflg
;
ssize_t
uio_resid
;
/* residual count */
};
}
uio_t
;
/*
typedef
struct
uio
uio_t
;
* Segment flag values.
typedef
struct
iovec
iovec_t
;
*/
typedef
enum
uio_seg
{
UIO_USERSPACE
,
/* uio_iov describes user space */
UIO_SYSSPACE
,
/* uio_iov describes system space */
}
uio_seg_t
;
extern
int
uio_read
(
caddr_t
,
size_t
,
uio_t
*
);
extern
int
uio_read
(
caddr_t
,
size_t
,
uio_t
*
);
...
...
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