Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
4d770ccf
Commit
4d770ccf
authored
Dec 05, 2006
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Ensure that nfs_wb_page() calls writepage when necessary.
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
1a54533e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
fs/nfs/write.c
fs/nfs/write.c
+30
-4
include/linux/nfs_fs.h
include/linux/nfs_fs.h
+1
-0
No files found.
fs/nfs/write.c
View file @
4d770ccf
...
...
@@ -247,7 +247,7 @@ static int wb_priority(struct writeback_control *wbc)
/*
* Write an mmapped page to the server.
*/
int
nfs_writepage
(
struct
page
*
page
,
struct
writeback_control
*
wbc
)
static
int
nfs_writepage_locked
(
struct
page
*
page
,
struct
writeback_control
*
wbc
)
{
struct
nfs_open_context
*
ctx
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
...
...
@@ -265,7 +265,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
if
(
!
flushme
)
goto
out
;
/* Ensure we've flushed out the invalid write */
nfs_wb_page_priority
(
inode
,
page
,
wb_priority
(
wbc
));
nfs_wb_page_priority
(
inode
,
page
,
wb_priority
(
wbc
)
|
FLUSH_STABLE
|
FLUSH_NOWRITEPAGE
);
}
offset
=
nfs_page_length
(
page
);
...
...
@@ -283,6 +283,14 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
out:
if
(
!
wbc
->
for_writepages
)
nfs_flush_mapping
(
page
->
mapping
,
wbc
,
wb_priority
(
wbc
));
return
err
;
}
int
nfs_writepage
(
struct
page
*
page
,
struct
writeback_control
*
wbc
)
{
int
err
;
err
=
nfs_writepage_locked
(
page
,
wbc
);
unlock_page
(
page
);
return
err
;
}
...
...
@@ -1435,8 +1443,26 @@ static int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
{
loff_t
range_start
=
page_offset
(
page
);
loff_t
range_end
=
range_start
+
(
loff_t
)(
PAGE_CACHE_SIZE
-
1
);
struct
writeback_control
wbc
=
{
.
bdi
=
page
->
mapping
->
backing_dev_info
,
.
sync_mode
=
WB_SYNC_ALL
,
.
nr_to_write
=
LONG_MAX
,
.
range_start
=
range_start
,
.
range_end
=
range_end
,
};
int
ret
;
return
nfs_sync_mapping_range
(
inode
->
i_mapping
,
range_start
,
range_end
,
how
|
FLUSH_STABLE
);
BUG_ON
(
!
PageLocked
(
page
));
if
(
!
(
how
&
FLUSH_NOWRITEPAGE
)
&&
clear_page_dirty_for_io
(
page
))
{
ret
=
nfs_writepage_locked
(
page
,
&
wbc
);
if
(
ret
<
0
)
goto
out
;
}
ret
=
nfs_sync_mapping_wait
(
page
->
mapping
,
&
wbc
,
how
);
if
(
ret
>=
0
)
return
0
;
out:
return
ret
;
}
/*
...
...
@@ -1444,7 +1470,7 @@ static int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
*/
int
nfs_wb_page
(
struct
inode
*
inode
,
struct
page
*
page
)
{
return
nfs_wb_page_priority
(
inode
,
page
,
0
);
return
nfs_wb_page_priority
(
inode
,
page
,
FLUSH_STABLE
);
}
int
nfs_set_page_dirty
(
struct
page
*
page
)
...
...
include/linux/nfs_fs.h
View file @
4d770ccf
...
...
@@ -33,6 +33,7 @@
#define FLUSH_HIGHPRI 16
/* high priority memory reclaim flush */
#define FLUSH_NOCOMMIT 32
/* Don't send the NFSv3/v4 COMMIT */
#define FLUSH_INVALIDATE 64
/* Invalidate the page cache */
#define FLUSH_NOWRITEPAGE 128
/* Don't call writepage() */
#ifdef __KERNEL__
...
...
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