Commit 7ebcb731 authored by Peng Tao's avatar Peng Tao Committed by Greg Kroah-Hartman

staging/lustre/libcfs: remove filp_write

Use vfs_write instead and call kmap/kunmap to ensure
that we can access high memory zone.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarPeng Tao <bergwolf@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e23f875d
...@@ -52,9 +52,6 @@ ...@@ -52,9 +52,6 @@
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/posix_acl_xattr.h> #include <linux/posix_acl_xattr.h>
#define filp_write(fp, buf, size, pos) \
((fp)->f_op->write((fp), (buf), (size), pos))
#define flock_type(fl) ((fl)->fl_type) #define flock_type(fl) ((fl)->fl_type)
#define flock_set_type(fl, type) do { (fl)->fl_type = (type); } while (0) #define flock_set_type(fl, type) do { (fl)->fl_type = (type); } while (0)
#define flock_pid(fl) ((fl)->fl_pid) #define flock_pid(fl) ((fl)->fl_pid)
......
...@@ -678,6 +678,7 @@ int cfs_tracefile_dump_all_pages(char *filename) ...@@ -678,6 +678,7 @@ int cfs_tracefile_dump_all_pages(char *filename)
struct file *filp; struct file *filp;
struct cfs_trace_page *tage; struct cfs_trace_page *tage;
struct cfs_trace_page *tmp; struct cfs_trace_page *tmp;
char *buf;
int rc; int rc;
DECL_MMSPACE; DECL_MMSPACE;
...@@ -708,8 +709,11 @@ int cfs_tracefile_dump_all_pages(char *filename) ...@@ -708,8 +709,11 @@ int cfs_tracefile_dump_all_pages(char *filename)
__LASSERT_TAGE_INVARIANT(tage); __LASSERT_TAGE_INVARIANT(tage);
rc = filp_write(filp, page_address(tage->page), buf = kmap(tage->page);
rc = vfs_write(filp, (__force const char __user *)buf,
tage->used, &filp->f_pos); tage->used, &filp->f_pos);
kunmap(tage->page);
if (rc != (int)tage->used) { if (rc != (int)tage->used) {
printk(KERN_WARNING "wanted to write %u but wrote " printk(KERN_WARNING "wanted to write %u but wrote "
"%d\n", tage->used, rc); "%d\n", tage->used, rc);
...@@ -971,6 +975,7 @@ static int tracefiled(void *arg) ...@@ -971,6 +975,7 @@ static int tracefiled(void *arg)
struct cfs_trace_page *tage; struct cfs_trace_page *tage;
struct cfs_trace_page *tmp; struct cfs_trace_page *tmp;
struct file *filp; struct file *filp;
char *buf;
int last_loop = 0; int last_loop = 0;
int rc; int rc;
...@@ -1023,8 +1028,11 @@ static int tracefiled(void *arg) ...@@ -1023,8 +1028,11 @@ static int tracefiled(void *arg)
else if (f_pos > i_size_read(filp->f_dentry->d_inode)) else if (f_pos > i_size_read(filp->f_dentry->d_inode))
f_pos = i_size_read(filp->f_dentry->d_inode); f_pos = i_size_read(filp->f_dentry->d_inode);
rc = filp_write(filp, page_address(tage->page), buf = kmap(tage->page);
rc = vfs_write(filp, (__force const char __user *)buf,
tage->used, &f_pos); tage->used, &f_pos);
kunmap(tage->page);
if (rc != (int)tage->used) { if (rc != (int)tage->used) {
printk(KERN_WARNING "wanted to write %u " printk(KERN_WARNING "wanted to write %u "
"but wrote %d\n", tage->used, rc); "but wrote %d\n", tage->used, rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment