mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 06:37:59 +00:00
ocfs2: pass struct file* to ocfs2_prepare_inode_for_write.
struct file * has file_ra_state to store the readahead state and data. So pass this to ocfs2_prepare_inode_for_write. so that it can be used in ocfs2_refcount_cow. Signed-off-by: Tao Ma <tao.ma@oracle.com>
This commit is contained in:
parent
0378da0fda
commit
b890823635
1 changed files with 6 additions and 3 deletions
|
@ -2053,6 +2053,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ocfs2_prepare_inode_for_refcount(struct inode *inode,
|
static int ocfs2_prepare_inode_for_refcount(struct inode *inode,
|
||||||
|
struct file *file,
|
||||||
loff_t pos, size_t count,
|
loff_t pos, size_t count,
|
||||||
int *meta_level)
|
int *meta_level)
|
||||||
{
|
{
|
||||||
|
@ -2078,7 +2079,7 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
|
static int ocfs2_prepare_inode_for_write(struct file *file,
|
||||||
loff_t *ppos,
|
loff_t *ppos,
|
||||||
size_t count,
|
size_t count,
|
||||||
int appending,
|
int appending,
|
||||||
|
@ -2086,6 +2087,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
|
||||||
int *has_refcount)
|
int *has_refcount)
|
||||||
{
|
{
|
||||||
int ret = 0, meta_level = 0;
|
int ret = 0, meta_level = 0;
|
||||||
|
struct dentry *dentry = file->f_path.dentry;
|
||||||
struct inode *inode = dentry->d_inode;
|
struct inode *inode = dentry->d_inode;
|
||||||
loff_t saved_pos, end;
|
loff_t saved_pos, end;
|
||||||
|
|
||||||
|
@ -2141,6 +2143,7 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
|
||||||
meta_level = -1;
|
meta_level = -1;
|
||||||
|
|
||||||
ret = ocfs2_prepare_inode_for_refcount(inode,
|
ret = ocfs2_prepare_inode_for_refcount(inode,
|
||||||
|
file,
|
||||||
saved_pos,
|
saved_pos,
|
||||||
count,
|
count,
|
||||||
&meta_level);
|
&meta_level);
|
||||||
|
@ -2255,7 +2258,7 @@ relock:
|
||||||
}
|
}
|
||||||
|
|
||||||
can_do_direct = direct_io;
|
can_do_direct = direct_io;
|
||||||
ret = ocfs2_prepare_inode_for_write(file->f_path.dentry, ppos,
|
ret = ocfs2_prepare_inode_for_write(file, ppos,
|
||||||
iocb->ki_left, appending,
|
iocb->ki_left, appending,
|
||||||
&can_do_direct, &has_refcount);
|
&can_do_direct, &has_refcount);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -2385,7 +2388,7 @@ static int ocfs2_splice_to_file(struct pipe_inode_info *pipe,
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = ocfs2_prepare_inode_for_write(out->f_path.dentry, &sd->pos,
|
ret = ocfs2_prepare_inode_for_write(out, &sd->pos,
|
||||||
sd->total_len, 0, NULL, NULL);
|
sd->total_len, 0, NULL, NULL);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
mlog_errno(ret);
|
mlog_errno(ret);
|
||||||
|
|
Loading…
Add table
Reference in a new issue