All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Tao <bergwolf@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Peng Tao <bergwolf@gmail.com>,
	Andreas Dilger <andreas.dilger@intel.com>
Subject: [PATCH 01/10] staging/lustre/libcfs: remove filp_size/filp_poff
Date: Thu, 21 Nov 2013 22:28:22 +0800	[thread overview]
Message-ID: <1385044111-3129-2-git-send-email-bergwolf@gmail.com> (raw)
In-Reply-To: <1385044111-3129-1-git-send-email-bergwolf@gmail.com>

Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |    5 -----
 drivers/staging/lustre/lustre/libcfs/tracefile.c   |    6 +++---
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h
index eebf138..8fabe4b 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h
@@ -52,11 +52,6 @@
 #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))
 
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index f71a3cc..0ce4aac 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -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);
-- 
1.7.9.5


  reply	other threads:[~2013-11-21 14:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 14:28 [PATCH 00/10] staging/lustre/libcfs: cleanup linux-fs.h and kp30.h Peng Tao
2013-11-21 14:28 ` Peng Tao [this message]
2013-11-21 14:28 ` [PATCH 02/10] staging/lustre/libcfs: remove filp_fsync Peng Tao
2013-11-21 14:28 ` [PATCH 03/10] staging/lustre/libcfs: remove filp_read Peng Tao
2013-11-21 14:28 ` [PATCH 04/10] staging/lustre/libcfs: remove filp_write Peng Tao
2013-11-21 14:28 ` [PATCH 05/10] staging/lustre: move IFTODT/DTTOIF to lustre_idl.h Peng Tao
2013-11-21 14:28 ` [PATCH 06/10] staging/lustre/libcfs: remove flock wrappers Peng Tao
2013-11-21 14:28 ` [PATCH 07/10] staging/lustre/libcfs: remove linux-fs.h Peng Tao
2013-11-21 14:28 ` [PATCH 08/10] staging/lustre/libcfs: remove lwt code Peng Tao
2013-11-21 14:28 ` [PATCH 09/10] staging/lustre: remove CFS_MODULE_PARM Peng Tao
2013-11-21 14:28 ` [PATCH 10/10] staging/lustre/libcfs: remove LI_POISON Peng Tao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385044111-3129-2-git-send-email-bergwolf@gmail.com \
    --to=bergwolf@gmail.com \
    --cc=andreas.dilger@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.