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
c0816a50
Commit
c0816a50
authored
Jan 22, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://xfs.org:8090/xfs-linux-2.6
into home.osdl.org:/home/torvalds/v2.5/linux
parents
66cb679e
5b3597e4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
21 deletions
+33
-21
fs/xfs/linux/xfs_aops.c
fs/xfs/linux/xfs_aops.c
+17
-4
fs/xfs/xfs_iomap.h
fs/xfs/xfs_iomap.h
+13
-14
fs/xfs/xfs_itable.c
fs/xfs/xfs_itable.c
+3
-3
No files found.
fs/xfs/linux/xfs_aops.c
View file @
c0816a50
...
...
@@ -407,8 +407,10 @@ map_unwritten(
offset
<<=
PAGE_CACHE_SHIFT
;
offset
+=
p_offset
;
pb
=
pagebuf_lookup
(
iomapp
->
iomap_target
,
iomapp
->
iomap_offset
,
iomapp
->
iomap_bsize
,
0
);
/* get an "empty" pagebuf to manage IO completion
* Proper values will be set before returning */
pb
=
pagebuf_lookup
(
iomapp
->
iomap_target
,
0
,
0
,
0
);
if
(
!
pb
)
return
-
EAGAIN
;
...
...
@@ -471,6 +473,11 @@ map_unwritten(
nblocks
+=
bs
;
atomic_add
(
bs
,
&
pb
->
pb_io_remaining
);
convert_page
(
inode
,
page
,
iomapp
,
pb
,
startio
,
all_bh
);
/* stop if converting the next page might add
* enough blocks that the corresponding byte
* count won't fit in our ulong page buf length */
if
(
nblocks
>=
((
ULONG_MAX
-
PAGE_SIZE
)
>>
block_bits
))
goto
enough
;
}
if
(
tindex
==
tlast
&&
...
...
@@ -481,16 +488,20 @@ map_unwritten(
nblocks
+=
bs
;
atomic_add
(
bs
,
&
pb
->
pb_io_remaining
);
convert_page
(
inode
,
page
,
iomapp
,
pb
,
startio
,
all_bh
);
if
(
nblocks
>=
((
ULONG_MAX
-
PAGE_SIZE
)
>>
block_bits
))
goto
enough
;
}
}
}
enough:
size
=
nblocks
;
/* NB: using 64bit number here */
size
<<=
block_bits
;
/* convert fsb's to byte range */
XFS_BUF_DATAIO
(
pb
);
XFS_BUF_ASYNC
(
pb
);
XFS_BUF_SET_SIZE
(
pb
,
size
);
XFS_BUF_SET_COUNT
(
pb
,
size
);
XFS_BUF_SET_OFFSET
(
pb
,
offset
);
XFS_BUF_SET_FSPRIVATE
(
pb
,
LINVFS_GET_VP
(
inode
));
XFS_BUF_SET_IODONE_FUNC
(
pb
,
linvfs_unwritten_convert
);
...
...
@@ -925,8 +936,10 @@ linvfs_get_block_core(
}
if
(
blocks
)
{
size
=
(
iomap
.
iomap_bsize
-
iomap
.
iomap_delta
);
bh_result
->
b_size
=
min_t
(
ssize_t
,
size
,
blocks
<<
inode
->
i_blkbits
);
loff_t
iosize
;
iosize
=
(
iomap
.
iomap_bsize
-
iomap
.
iomap_delta
);
bh_result
->
b_size
=
(
ssize_t
)
min
(
iosize
,
(
loff_t
)(
blocks
<<
inode
->
i_blkbits
));
}
return
0
;
...
...
fs/xfs/xfs_iomap.h
View file @
c0816a50
...
...
@@ -66,27 +66,26 @@ typedef enum {
/*
* xfs_iomap_t: File system I/O map
*
* The iomap_bn, iomap_offset and iomap_length fields are expressed in disk blocks.
* The iomap_length field specifies the size of the underlying backing store
* for the particular mapping.
* The iomap_bn field is expressed in 512-byte blocks, and is where the
* mapping starts on disk.
*
* The iomap_
bsize, iomap_size and iomap_delta fields are in bytes and indicate
*
the size of the mapping, the number of bytes that are valid to access
*
(read or write), and the offset into the mapping, given the offset
*
supplied to the file I/O map routine. iomap_delta is the offset of the
*
desired data from the beginning of the mapping
.
* The iomap_
offset, iomap_bsize and iomap_delta fields are in bytes.
*
iomap_offset is the offset of the mapping in the file itself.
*
iomap_bsize is the size of the mapping, iomap_delta is the
*
desired data's offset into the mapping, given the offset supplied
*
to the file I/O map routine
.
*
* When a request is made to read beyond the logical end of the object,
* iomap_size may be set to 0, but iomap_offset and iomap_length should be set
to
* the actual amount of underlying storage that has been allocated, if any.
* iomap_size may be set to 0, but iomap_offset and iomap_length should be set
* t
o t
he actual amount of underlying storage that has been allocated, if any.
*/
typedef
struct
xfs_iomap
{
xfs_daddr_t
iomap_bn
;
xfs_daddr_t
iomap_bn
;
/* first 512b blk of mapping */
xfs_buftarg_t
*
iomap_target
;
loff_t
iomap_offset
;
size_t
iomap_delta
;
size_t
iomap_
bsize
;
loff_t
iomap_offset
;
/* offset of mapping, bytes */
loff_t
iomap_bsize
;
/* size of mapping, bytes */
size_t
iomap_
delta
;
/* offset into mapping, bytes */
iomap_flags_t
iomap_flags
;
}
xfs_iomap_t
;
...
...
fs/xfs/xfs_itable.c
View file @
c0816a50
...
...
@@ -330,7 +330,7 @@ xfs_bulkstat(
* inode returned; 0 means start of the allocation group.
*/
rval
=
0
;
while
(
(
ubleft
/
statstruct_size
)
>
0
&&
agno
<
mp
->
m_sb
.
sb_agcount
)
{
while
(
ubleft
>=
statstruct_size
&&
agno
<
mp
->
m_sb
.
sb_agcount
)
{
bp
=
NULL
;
down_read
(
&
mp
->
m_peraglock
);
error
=
xfs_ialloc_read_agi
(
mp
,
tp
,
agno
,
&
agbp
);
...
...
@@ -415,7 +415,7 @@ xfs_bulkstat(
* Loop through inode btree records in this ag,
* until we run out of inodes or space in the buffer.
*/
while
(
irbp
<
irbufend
&&
icount
<
(
ubleft
/
statstruct_size
)
)
{
while
(
irbp
<
irbufend
&&
icount
<
ubcount
)
{
/*
* Loop as long as we're unable to read the
* inode btree.
...
...
@@ -467,7 +467,7 @@ xfs_bulkstat(
*/
irbufend
=
irbp
;
for
(
irbp
=
irbuf
;
irbp
<
irbufend
&&
(
ubleft
/
statstruct_size
)
>
0
;
irbp
++
)
{
irbp
<
irbufend
&&
ubleft
>=
statstruct_size
;
irbp
++
)
{
/*
* Read-ahead the next chunk's worth of inodes.
*/
...
...
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