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
c5c9a566
Commit
c5c9a566
authored
Dec 11, 2002
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] rationalize pagebuf_iomove
SGI Modid: 2.5.x-xfs:slinx:134775a
parent
d430f521
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
47 deletions
+10
-47
fs/xfs/pagebuf/page_buf.c
fs/xfs/pagebuf/page_buf.c
+9
-46
fs/xfs/pagebuf/page_buf.h
fs/xfs/pagebuf/page_buf.h
+1
-1
No files found.
fs/xfs/pagebuf/page_buf.c
View file @
c5c9a566
...
@@ -1502,44 +1502,6 @@ pagebuf_offset(
...
@@ -1502,44 +1502,6 @@ pagebuf_offset(
return
(
caddr_t
)
page_address
(
page
)
+
(
offset
&
(
PAGE_CACHE_SIZE
-
1
));
return
(
caddr_t
)
page_address
(
page
)
+
(
offset
&
(
PAGE_CACHE_SIZE
-
1
));
}
}
/*
* pagebuf_segment
*
* pagebuf_segment is used to retrieve the various contiguous
* segments of a buffer. The variable addressed by the
* loff_t * should be initialized to 0, and successive
* calls will update to point to the segment following the one
* returned.
*/
STATIC
void
pagebuf_segment
(
page_buf_t
*
pb
,
/* buffer to examine */
loff_t
*
boff_p
,
/* offset in buffer of next */
/* next segment (updated) */
struct
page
**
spage_p
,
/* page (updated) */
/* (NULL if not in page array) */
size_t
*
soff_p
,
/* offset in page (updated) */
size_t
*
ssize_p
)
/* segment length (updated) */
{
loff_t
kpboff
;
/* offset in pagebuf */
int
kpi
;
/* page index in pagebuf */
size_t
slen
;
/* segment length */
kpboff
=
*
boff_p
;
kpi
=
page_buf_btoct
(
kpboff
+
pb
->
pb_offset
);
*
spage_p
=
pb
->
pb_pages
[
kpi
];
*
soff_p
=
page_buf_poff
(
kpboff
+
pb
->
pb_offset
);
slen
=
PAGE_CACHE_SIZE
-
*
soff_p
;
if
(
slen
>
(
pb
->
pb_count_desired
-
kpboff
))
slen
=
(
pb
->
pb_count_desired
-
kpboff
);
*
ssize_p
=
slen
;
*
boff_p
=
*
boff_p
+
slen
;
}
/*
/*
* pagebuf_iomove
* pagebuf_iomove
*
*
...
@@ -1548,21 +1510,21 @@ pagebuf_segment(
...
@@ -1548,21 +1510,21 @@ pagebuf_segment(
void
void
pagebuf_iomove
(
pagebuf_iomove
(
page_buf_t
*
pb
,
/* buffer to process */
page_buf_t
*
pb
,
/* buffer to process */
off
_t
boff
,
/* starting buffer offset */
size
_t
boff
,
/* starting buffer offset */
size_t
bsize
,
/* length to copy */
size_t
bsize
,
/* length to copy */
caddr_t
data
,
/* data address */
caddr_t
data
,
/* data address */
page_buf_rw_t
mode
)
/* read/write flag */
page_buf_rw_t
mode
)
/* read/write flag */
{
{
loff_t
cboff
;
size_t
bend
,
cpoff
,
csize
;
size_t
cpoff
;
size_t
csize
;
struct
page
*
page
;
struct
page
*
page
;
cboff
=
boff
;
bend
=
boff
+
bsize
;
boff
+=
bsize
;
/* last */
while
(
boff
<
bend
)
{
page
=
pb
->
pb_pages
[
page_buf_btoct
(
boff
+
pb
->
pb_offset
)];
cpoff
=
page_buf_poff
(
boff
+
pb
->
pb_offset
);
csize
=
min_t
(
size_t
,
PAGE_CACHE_SIZE
-
cpoff
,
pb
->
pb_count_desired
-
boff
);
while
(
cboff
<
boff
)
{
pagebuf_segment
(
pb
,
&
cboff
,
&
page
,
&
cpoff
,
&
csize
);
ASSERT
(((
csize
+
cpoff
)
<=
PAGE_CACHE_SIZE
));
ASSERT
(((
csize
+
cpoff
)
<=
PAGE_CACHE_SIZE
));
switch
(
mode
)
{
switch
(
mode
)
{
...
@@ -1576,6 +1538,7 @@ pagebuf_iomove(
...
@@ -1576,6 +1538,7 @@ pagebuf_iomove(
memcpy
(
page_address
(
page
)
+
cpoff
,
data
,
csize
);
memcpy
(
page_address
(
page
)
+
cpoff
,
data
,
csize
);
}
}
boff
+=
csize
;
data
+=
csize
;
data
+=
csize
;
}
}
}
}
...
...
fs/xfs/pagebuf/page_buf.h
View file @
c5c9a566
...
@@ -340,7 +340,7 @@ extern caddr_t pagebuf_offset(page_buf_t *, off_t);
...
@@ -340,7 +340,7 @@ extern caddr_t pagebuf_offset(page_buf_t *, off_t);
extern
void
pagebuf_iomove
(
/* move data in/out of pagebuf */
extern
void
pagebuf_iomove
(
/* move data in/out of pagebuf */
page_buf_t
*
,
/* buffer to manipulate */
page_buf_t
*
,
/* buffer to manipulate */
off
_t
,
/* starting buffer offset */
size
_t
,
/* starting buffer offset */
size_t
,
/* length in buffer */
size_t
,
/* length in buffer */
caddr_t
,
/* data pointer */
caddr_t
,
/* data pointer */
page_buf_rw_t
);
/* direction */
page_buf_rw_t
);
/* direction */
...
...
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