linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH v3 11/14] pNFS: Remove redundant pnfs_mark_layout_returned_if_empty()
Date: Sun, 24 Jul 2016 17:30:56 -0400	[thread overview]
Message-ID: <1469395859-83194-12-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1469395859-83194-11-git-send-email-trond.myklebust@primarydata.com>

That's already being taken care of in pnfs_layout_remove_lseg().

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/callback_proc.c |  1 -
 fs/nfs/nfs4proc.c      |  1 -
 fs/nfs/pnfs.c          |  1 -
 fs/nfs/pnfs.h          | 13 -------------
 4 files changed, 16 deletions(-)

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 837da8a02d35..c92a75e066a6 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -252,7 +252,6 @@ static u32 initiate_file_draining(struct nfs_client *clp,
 		NFS_SERVER(ino)->pnfs_curr_ld->return_range(lo,
 			&args->cbl_range);
 	}
-	pnfs_mark_layout_returned_if_empty(lo);
 unlock:
 	spin_unlock(&ino->i_lock);
 	pnfs_free_lseg_list(&free_me_list);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 8c453515d98c..d38cc5f0282f 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8128,7 +8128,6 @@ static void nfs4_layoutreturn_release(void *calldata)
 	spin_lock(&lo->plh_inode->i_lock);
 	pnfs_mark_matching_lsegs_invalid(lo, &freeme, &lrp->args.range,
 			be32_to_cpu(lrp->args.stateid.seqid));
-	pnfs_mark_layout_returned_if_empty(lo);
 	if (lrp->res.lrs_present && pnfs_layout_is_valid(lo))
 		pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
 	pnfs_clear_layoutreturn_waitbit(lo);
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index e16997da157f..49e952968ede 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1159,7 +1159,6 @@ void pnfs_roc_set_barrier(struct inode *ino, u32 barrier)
 
 	spin_lock(&ino->i_lock);
 	lo = NFS_I(ino)->layout;
-	pnfs_mark_layout_returned_if_empty(lo);
 	if (pnfs_seqid_is_newer(barrier, lo->plh_barrier))
 		lo->plh_barrier = barrier;
 	spin_unlock(&ino->i_lock);
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index d71c9493693a..595648a3ad7a 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -552,19 +552,6 @@ pnfs_calc_offset_length(u64 offset, u64 end)
 	return 1 + end - offset;
 }
 
-/**
- * pnfs_mark_layout_returned_if_empty - marks the layout as returned
- * @lo: layout header
- *
- * Note: Caller must hold inode->i_lock
- */
-static inline void
-pnfs_mark_layout_returned_if_empty(struct pnfs_layout_hdr *lo)
-{
-	if (list_empty(&lo->plh_segs))
-		set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
-}
-
 static inline void
 pnfs_copy_range(struct pnfs_layout_range *dst,
 		const struct pnfs_layout_range *src)
-- 
2.7.4


  reply	other threads:[~2016-07-24 21:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24 21:30 [PATCH v3 00/14] More layoutreturn nits Trond Myklebust
2016-07-24 21:30 ` [PATCH v3 01/14] pNFS: LAYOUTRETURN should only update the stateid if the layout is valid Trond Myklebust
2016-07-24 21:30   ` [PATCH v3 02/14] pNFS: Clear the layout return tracking on layout reinitialisation Trond Myklebust
2016-07-24 21:30     ` [PATCH v3 03/14] pNFS: Always update the layout stateid if NFS_LAYOUT_INVALID_STID is set Trond Myklebust
2016-07-24 21:30       ` [PATCH v3 04/14] pNFS: Always update the layout barrier seqid on LAYOUTGET Trond Myklebust
2016-07-24 21:30         ` [PATCH v3 05/14] pNFS: Fix CB_LAYOUTRECALL stateid verification Trond Myklebust
2016-07-24 21:30           ` [PATCH v3 06/14] pNFS: Ensure layoutreturn acts as a completion for layout callbacks Trond Myklebust
2016-07-24 21:30             ` [PATCH v3 07/14] pNFS: Do not set plh_return_seq for non-callback related layoutreturns Trond Myklebust
2016-07-24 21:30               ` [PATCH v3 08/14] NFS: pnfs_mark_matching_lsegs_return() should match the layout sequence id Trond Myklebust
2016-07-24 21:30                 ` [PATCH v3 09/14] pNFS: Cleanup - don't open code pnfs_mark_layout_stateid_invalid() Trond Myklebust
2016-07-24 21:30                   ` [PATCH v3 10/14] pNFS: Clear the layout metadata if the server changed the layout stateid Trond Myklebust
2016-07-24 21:30                     ` Trond Myklebust [this message]
2016-07-24 21:30                       ` [PATCH v3 12/14] pNFS: Remove redundant stateid invalidation Trond Myklebust
2016-07-24 21:30                         ` [PATCH v3 13/14] pNFS: Cleanup - do layout segment initialisation in one place Trond Myklebust
2016-07-24 21:30                           ` [PATCH v3 14/14] pNFS: Remove redundant smp_mb() from pnfs_init_lseg() Trond Myklebust

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=1469395859-83194-12-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=linux-nfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).