#include <linux/backing-dev.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_set_type(fl, type) do { (fl)->fl_type = (type); } while (0)
#define flock_pid(fl) ((fl)->fl_pid)
struct file *filp;
struct cfs_trace_page *tage;
struct cfs_trace_page *tmp;
+ char *buf;
int rc;
DECL_MMSPACE;
__LASSERT_TAGE_INVARIANT(tage);
- rc = filp_write(filp, page_address(tage->page),
- tage->used, &filp->f_pos);
+ buf = kmap(tage->page);
+ rc = vfs_write(filp, (__force const char __user *)buf,
+ tage->used, &filp->f_pos);
+ kunmap(tage->page);
+
if (rc != (int)tage->used) {
printk(KERN_WARNING "wanted to write %u but wrote "
"%d\n", tage->used, rc);
struct cfs_trace_page *tage;
struct cfs_trace_page *tmp;
struct file *filp;
+ char *buf;
int last_loop = 0;
int rc;
else if (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),
- tage->used, &f_pos);
+ buf = kmap(tage->page);
+ rc = vfs_write(filp, (__force const char __user *)buf,
+ tage->used, &f_pos);
+ kunmap(tage->page);
+
if (rc != (int)tage->used) {
printk(KERN_WARNING "wanted to write %u "
"but wrote %d\n", tage->used, rc);