diff options
author | Martin Brandenburg <martin@omnibond.com> | 2016-08-02 20:32:15 (GMT) |
---|---|---|
committer | Martin Brandenburg <martin@omnibond.com> | 2016-08-08 19:12:29 (GMT) |
commit | ed1e158777fa73ac577dcd4f67062b944b587493 (patch) | |
tree | e72f67dd9634cf02bc90408b0d9c5e777e0c1078 | |
parent | 680908e5046bdd37a678691d881d98486c3e9a53 (diff) | |
download | linux-ed1e158777fa73ac577dcd4f67062b944b587493.tar.xz |
orangefs: re-add flush_racache from out-of-tree
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
-rw-r--r-- | fs/orangefs/file.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index c14eab5..43c08b5 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -14,6 +14,32 @@ #include <linux/fs.h> #include <linux/pagemap.h> +static int flush_racache(struct inode *inode) +{ + struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode); + struct orangefs_kernel_op_s *new_op; + int ret; + + gossip_debug(GOSSIP_UTILS_DEBUG, + "%s: %pU: Handle is %pU | fs_id %d\n", __func__, + get_khandle_from_ino(inode), &orangefs_inode->refn.khandle, + orangefs_inode->refn.fs_id); + + new_op = op_alloc(ORANGEFS_VFS_OP_RA_FLUSH); + if (!new_op) + return -ENOMEM; + new_op->upcall.req.ra_cache_flush.refn = orangefs_inode->refn; + + ret = service_operation(new_op, "orangefs_flush_racache", + get_interruptible_flag(inode)); + + gossip_debug(GOSSIP_UTILS_DEBUG, "%s: got return value of %d\n", + __func__, ret); + + op_release(new_op); + return ret; +} + /* * Copy to client-core's address space from the buffers specified * by the iovec upto total_size bytes. @@ -597,9 +623,15 @@ static int orangefs_file_release(struct inode *inode, struct file *file) */ if (file->f_path.dentry->d_inode && file->f_path.dentry->d_inode->i_mapping && - mapping_nrpages(&file->f_path.dentry->d_inode->i_data)) + mapping_nrpages(&file->f_path.dentry->d_inode->i_data)) { + gossip_debug(GOSSIP_INODE_DEBUG, + "calling flush_racache on %pU\n", + get_khandle_from_ino(inode)); + flush_racache(inode); + gossip_debug(GOSSIP_INODE_DEBUG, "flush_racache finished\n"); truncate_inode_pages(file->f_path.dentry->d_inode->i_mapping, 0); + } return 0; } |