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
55602dd6
Commit
55602dd6
authored
Jun 24, 2010
by
Jens Axboe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs: make generic file read/write functions plug
Signed-off-by:
Jens Axboe
<
jaxboe@fusionio.com
>
parent
7eaceacc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
mm/filemap.c
mm/filemap.c
+7
-0
No files found.
mm/filemap.c
View file @
55602dd6
...
@@ -1243,12 +1243,15 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
...
@@ -1243,12 +1243,15 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
unsigned
long
seg
=
0
;
unsigned
long
seg
=
0
;
size_t
count
;
size_t
count
;
loff_t
*
ppos
=
&
iocb
->
ki_pos
;
loff_t
*
ppos
=
&
iocb
->
ki_pos
;
struct
blk_plug
plug
;
count
=
0
;
count
=
0
;
retval
=
generic_segment_checks
(
iov
,
&
nr_segs
,
&
count
,
VERIFY_WRITE
);
retval
=
generic_segment_checks
(
iov
,
&
nr_segs
,
&
count
,
VERIFY_WRITE
);
if
(
retval
)
if
(
retval
)
return
retval
;
return
retval
;
blk_start_plug
(
&
plug
);
/* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
/* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
if
(
filp
->
f_flags
&
O_DIRECT
)
{
if
(
filp
->
f_flags
&
O_DIRECT
)
{
loff_t
size
;
loff_t
size
;
...
@@ -1321,6 +1324,7 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
...
@@ -1321,6 +1324,7 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
break
;
break
;
}
}
out:
out:
blk_finish_plug
(
&
plug
);
return
retval
;
return
retval
;
}
}
EXPORT_SYMBOL
(
generic_file_aio_read
);
EXPORT_SYMBOL
(
generic_file_aio_read
);
...
@@ -2432,11 +2436,13 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
...
@@ -2432,11 +2436,13 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
{
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
inode
=
file
->
f_mapping
->
host
;
struct
inode
*
inode
=
file
->
f_mapping
->
host
;
struct
blk_plug
plug
;
ssize_t
ret
;
ssize_t
ret
;
BUG_ON
(
iocb
->
ki_pos
!=
pos
);
BUG_ON
(
iocb
->
ki_pos
!=
pos
);
mutex_lock
(
&
inode
->
i_mutex
);
mutex_lock
(
&
inode
->
i_mutex
);
blk_start_plug
(
&
plug
);
ret
=
__generic_file_aio_write
(
iocb
,
iov
,
nr_segs
,
&
iocb
->
ki_pos
);
ret
=
__generic_file_aio_write
(
iocb
,
iov
,
nr_segs
,
&
iocb
->
ki_pos
);
mutex_unlock
(
&
inode
->
i_mutex
);
mutex_unlock
(
&
inode
->
i_mutex
);
...
@@ -2447,6 +2453,7 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
...
@@ -2447,6 +2453,7 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
if
(
err
<
0
&&
ret
>
0
)
if
(
err
<
0
&&
ret
>
0
)
ret
=
err
;
ret
=
err
;
}
}
blk_finish_plug
(
&
plug
);
return
ret
;
return
ret
;
}
}
EXPORT_SYMBOL
(
generic_file_aio_write
);
EXPORT_SYMBOL
(
generic_file_aio_write
);
...
...
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