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
32438cf9
Commit
32438cf9
authored
Aug 17, 2016
by
Dave Chinner
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'iomap-fixes-4.8-rc3' into for-next
parents
a03f1a66
1d4795e7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
20 deletions
+71
-20
fs/iomap.c
fs/iomap.c
+13
-8
fs/xfs/xfs_iomap.c
fs/xfs/xfs_iomap.c
+49
-10
fs/xfs/xfs_iomap.h
fs/xfs/xfs_iomap.h
+1
-0
fs/xfs/xfs_iops.c
fs/xfs/xfs_iops.c
+8
-1
fs/xfs/xfs_trace.h
fs/xfs/xfs_trace.h
+0
-1
No files found.
fs/iomap.c
View file @
32438cf9
...
@@ -84,8 +84,11 @@ iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned flags,
...
@@ -84,8 +84,11 @@ iomap_apply(struct inode *inode, loff_t pos, loff_t length, unsigned flags,
* Now the data has been copied, commit the range we've copied. This
* Now the data has been copied, commit the range we've copied. This
* should not fail unless the filesystem has had a fatal error.
* should not fail unless the filesystem has had a fatal error.
*/
*/
ret
=
ops
->
iomap_end
(
inode
,
pos
,
length
,
written
>
0
?
written
:
0
,
if
(
ops
->
iomap_end
)
{
flags
,
&
iomap
);
ret
=
ops
->
iomap_end
(
inode
,
pos
,
length
,
written
>
0
?
written
:
0
,
flags
,
&
iomap
);
}
return
written
?
written
:
ret
;
return
written
?
written
:
ret
;
}
}
...
@@ -194,12 +197,9 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
...
@@ -194,12 +197,9 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
if
(
mapping_writably_mapped
(
inode
->
i_mapping
))
if
(
mapping_writably_mapped
(
inode
->
i_mapping
))
flush_dcache_page
(
page
);
flush_dcache_page
(
page
);
pagefault_disable
();
copied
=
iov_iter_copy_from_user_atomic
(
page
,
i
,
offset
,
bytes
);
copied
=
iov_iter_copy_from_user_atomic
(
page
,
i
,
offset
,
bytes
);
pagefault_enable
();
flush_dcache_page
(
page
);
flush_dcache_page
(
page
);
mark_page_accessed
(
page
);
status
=
iomap_write_end
(
inode
,
pos
,
bytes
,
copied
,
page
);
status
=
iomap_write_end
(
inode
,
pos
,
bytes
,
copied
,
page
);
if
(
unlikely
(
status
<
0
))
if
(
unlikely
(
status
<
0
))
...
@@ -470,13 +470,18 @@ int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi,
...
@@ -470,13 +470,18 @@ int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
filemap_write_and_wait
(
inode
->
i_mapping
);
if
(
fi
->
fi_flags
&
FIEMAP_FLAG_SYNC
)
{
if
(
ret
)
ret
=
filemap_write_and_wait
(
inode
->
i_mapping
);
return
ret
;
if
(
ret
)
return
ret
;
}
while
(
len
>
0
)
{
while
(
len
>
0
)
{
ret
=
iomap_apply
(
inode
,
start
,
len
,
0
,
ops
,
&
ctx
,
ret
=
iomap_apply
(
inode
,
start
,
len
,
0
,
ops
,
&
ctx
,
iomap_fiemap_actor
);
iomap_fiemap_actor
);
/* inode with no (attribute) mapping will give ENOENT */
if
(
ret
==
-
ENOENT
)
break
;
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
if
(
ret
==
0
)
if
(
ret
==
0
)
...
...
fs/xfs/xfs_iomap.c
View file @
32438cf9
...
@@ -1041,20 +1041,14 @@ xfs_file_iomap_begin(
...
@@ -1041,20 +1041,14 @@ xfs_file_iomap_begin(
return
error
;
return
error
;
trace_xfs_iomap_alloc
(
ip
,
offset
,
length
,
0
,
&
imap
);
trace_xfs_iomap_alloc
(
ip
,
offset
,
length
,
0
,
&
imap
);
xfs_bmbt_to_iomap
(
ip
,
iomap
,
&
imap
);
}
else
if
(
nimaps
)
{
xfs_iunlock
(
ip
,
XFS_ILOCK_EXCL
);
trace_xfs_iomap_found
(
ip
,
offset
,
length
,
0
,
&
imap
);
xfs_bmbt_to_iomap
(
ip
,
iomap
,
&
imap
);
}
else
{
}
else
{
ASSERT
(
nimaps
);
xfs_iunlock
(
ip
,
XFS_ILOCK_EXCL
);
xfs_iunlock
(
ip
,
XFS_ILOCK_EXCL
);
trace_xfs_iomap_not_found
(
ip
,
offset
,
length
,
0
,
&
imap
);
trace_xfs_iomap_found
(
ip
,
offset
,
length
,
0
,
&
imap
);
iomap
->
blkno
=
IOMAP_NULL_BLOCK
;
iomap
->
type
=
IOMAP_HOLE
;
iomap
->
offset
=
offset
;
iomap
->
length
=
length
;
}
}
xfs_bmbt_to_iomap
(
ip
,
iomap
,
&
imap
);
return
0
;
return
0
;
}
}
...
@@ -1116,3 +1110,48 @@ struct iomap_ops xfs_iomap_ops = {
...
@@ -1116,3 +1110,48 @@ struct iomap_ops xfs_iomap_ops = {
.
iomap_begin
=
xfs_file_iomap_begin
,
.
iomap_begin
=
xfs_file_iomap_begin
,
.
iomap_end
=
xfs_file_iomap_end
,
.
iomap_end
=
xfs_file_iomap_end
,
};
};
static
int
xfs_xattr_iomap_begin
(
struct
inode
*
inode
,
loff_t
offset
,
loff_t
length
,
unsigned
flags
,
struct
iomap
*
iomap
)
{
struct
xfs_inode
*
ip
=
XFS_I
(
inode
);
struct
xfs_mount
*
mp
=
ip
->
i_mount
;
xfs_fileoff_t
offset_fsb
=
XFS_B_TO_FSBT
(
mp
,
offset
);
xfs_fileoff_t
end_fsb
=
XFS_B_TO_FSB
(
mp
,
offset
+
length
);
struct
xfs_bmbt_irec
imap
;
int
nimaps
=
1
,
error
=
0
;
unsigned
lockmode
;
if
(
XFS_FORCED_SHUTDOWN
(
mp
))
return
-
EIO
;
lockmode
=
xfs_ilock_data_map_shared
(
ip
);
/* if there are no attribute fork or extents, return ENOENT */
if
(
XFS_IFORK_Q
(
ip
)
||
!
ip
->
i_d
.
di_anextents
)
{
error
=
-
ENOENT
;
goto
out_unlock
;
}
ASSERT
(
ip
->
i_d
.
di_aformat
!=
XFS_DINODE_FMT_LOCAL
);
error
=
xfs_bmapi_read
(
ip
,
offset_fsb
,
end_fsb
-
offset_fsb
,
&
imap
,
&
nimaps
,
XFS_BMAPI_ENTIRE
|
XFS_BMAPI_ATTRFORK
);
out_unlock:
xfs_iunlock
(
ip
,
lockmode
);
if
(
!
error
)
{
ASSERT
(
nimaps
);
xfs_bmbt_to_iomap
(
ip
,
iomap
,
&
imap
);
}
return
error
;
}
struct
iomap_ops
xfs_xattr_iomap_ops
=
{
.
iomap_begin
=
xfs_xattr_iomap_begin
,
};
fs/xfs/xfs_iomap.h
View file @
32438cf9
...
@@ -35,5 +35,6 @@ void xfs_bmbt_to_iomap(struct xfs_inode *, struct iomap *,
...
@@ -35,5 +35,6 @@ void xfs_bmbt_to_iomap(struct xfs_inode *, struct iomap *,
struct
xfs_bmbt_irec
*
);
struct
xfs_bmbt_irec
*
);
extern
struct
iomap_ops
xfs_iomap_ops
;
extern
struct
iomap_ops
xfs_iomap_ops
;
extern
struct
iomap_ops
xfs_xattr_iomap_ops
;
#endif
/* __XFS_IOMAP_H__*/
#endif
/* __XFS_IOMAP_H__*/
fs/xfs/xfs_iops.c
View file @
32438cf9
...
@@ -1009,7 +1009,14 @@ xfs_vn_fiemap(
...
@@ -1009,7 +1009,14 @@ xfs_vn_fiemap(
int
error
;
int
error
;
xfs_ilock
(
XFS_I
(
inode
),
XFS_IOLOCK_SHARED
);
xfs_ilock
(
XFS_I
(
inode
),
XFS_IOLOCK_SHARED
);
error
=
iomap_fiemap
(
inode
,
fieinfo
,
start
,
length
,
&
xfs_iomap_ops
);
if
(
fieinfo
->
fi_flags
&
FIEMAP_FLAG_XATTR
)
{
fieinfo
->
fi_flags
&=
~
FIEMAP_FLAG_XATTR
;
error
=
iomap_fiemap
(
inode
,
fieinfo
,
start
,
length
,
&
xfs_xattr_iomap_ops
);
}
else
{
error
=
iomap_fiemap
(
inode
,
fieinfo
,
start
,
length
,
&
xfs_iomap_ops
);
}
xfs_iunlock
(
XFS_I
(
inode
),
XFS_IOLOCK_SHARED
);
xfs_iunlock
(
XFS_I
(
inode
),
XFS_IOLOCK_SHARED
);
return
error
;
return
error
;
...
...
fs/xfs/xfs_trace.h
View file @
32438cf9
...
@@ -1298,7 +1298,6 @@ DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
...
@@ -1298,7 +1298,6 @@ DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
DEFINE_IOMAP_EVENT
(
xfs_get_blocks_map_direct
);
DEFINE_IOMAP_EVENT
(
xfs_get_blocks_map_direct
);
DEFINE_IOMAP_EVENT
(
xfs_iomap_alloc
);
DEFINE_IOMAP_EVENT
(
xfs_iomap_alloc
);
DEFINE_IOMAP_EVENT
(
xfs_iomap_found
);
DEFINE_IOMAP_EVENT
(
xfs_iomap_found
);
DEFINE_IOMAP_EVENT
(
xfs_iomap_not_found
);
DECLARE_EVENT_CLASS
(
xfs_simple_io_class
,
DECLARE_EVENT_CLASS
(
xfs_simple_io_class
,
TP_PROTO
(
struct
xfs_inode
*
ip
,
xfs_off_t
offset
,
ssize_t
count
),
TP_PROTO
(
struct
xfs_inode
*
ip
,
xfs_off_t
offset
,
ssize_t
count
),
...
...
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