staging/lustre/libcfs: remove filp_size/filp_poff
authorPeng Tao <bergwolf@gmail.com>
Thu, 21 Nov 2013 14:28:22 +0000 (22:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2013 20:35:02 +0000 (12:35 -0800)
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h
drivers/staging/lustre/lustre/libcfs/tracefile.c

index eebf138..8fabe4b 100644 (file)
 #include <linux/backing-dev.h>
 #include <linux/posix_acl_xattr.h>
 
-#define filp_size(f)                                   \
-       (i_size_read((f)->f_dentry->d_inode))
-#define filp_poff(f)                                   \
-       (&(f)->f_pos)
-
 # define do_fsync(fp, flag)                            \
        ((fp)->f_op->fsync(fp, 0, LLONG_MAX, flag))
 
index f71a3cc..0ce4aac 100644 (file)
@@ -709,7 +709,7 @@ int cfs_tracefile_dump_all_pages(char *filename)
                __LASSERT_TAGE_INVARIANT(tage);
 
                rc = filp_write(filp, page_address(tage->page),
-                               tage->used, filp_poff(filp));
+                               tage->used, &filp->f_pos);
                if (rc != (int)tage->used) {
                        printk(KERN_WARNING "wanted to write %u but wrote "
                               "%d\n", tage->used, rc);
@@ -1020,8 +1020,8 @@ static int tracefiled(void *arg)
 
                        if (f_pos >= (off_t)cfs_tracefile_size)
                                f_pos = 0;
-                       else if (f_pos > (off_t)filp_size(filp))
-                               f_pos = filp_size(filp);
+                       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);