wave 2: restore removed comment in nfs4_evict_inode
Subsystems (2)
PATCH 1/11 wave 2: restore removed comment in nfs4_evict_inode
--- fs/nfs/inode.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/nfs/inode.c +1 -0
@@ -1425,6 +1425,7 @@ void nfs4_evict_inode(struct inode *inode)pnfs_destroy_layout (NFS_I (inode));/* If we are holding a delegation, return it! */ nfs_inode_return_delegation_noreclaim (inode); +/* First call standard NFS clear_inode() code */ nfs_clear_inode(inode); }#endif
Signature · 1 line
1.7.2.1
PATCH 2/11 wave 2: remove gratuitous changes to nfs4_layoutget_done
--- fs/nfs/nfs4proc.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
fs/nfs/nfs4proc.c +3 -3
@@ -5405,12 +5405,13 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)static void nfs4_layoutget_done (struct rpc_task *task,void *calldata) {struct nfs4_layoutget *lgp = calldata; -struct inode *ino = lgp->args.inode; +struct nfs_server *server =NFS_SERVER (lgp->args.inode);dprintk ("--> %s\n" , __func__);if (!nfs4_sequence_done (task, &lgp->res.seq_res))return ; +switch (task->tk_status) {case 0 :break ;
@@ -5419,8 +5420,7 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata) task->tk_status = -NFS4ERR_DELAY ;/* Fall through */ default : -if (nfs4_async_handle_error (task,NFS_SERVER (ino), -NULL ,NULL ) == -EAGAIN ) { +if (nfs4_async_handle_error (task, server,NULL ,NULL ) == -EAGAIN ) {rpc_restart_call_prepare (task);return ; }
Signature · 1 line
1.7.2.1
PATCH 3/11 wave 2: remove pnfs_ld_layoutret_on_setattr()
In reply to Fred IsamanDead code.
--- fs/nfs/pnfs.h | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
fs/nfs/pnfs.h +0 -6
@@ -336,12 +336,6 @@ static inline int pnfs_layoutcommit_inode(struct inode *inode, int sync) }static inline bool -pnfs_ld_layoutret_on_setattr (struct inode *inode) -{ -return false; -} - -static inline bool pnfs_roc (struct inode *ino) {return false;
Signature · 1 line
1.7.2.1
PATCH 4/11 wave 2: share code between put_lseg and pnfs_free_lseg_list
In reply to Fred IsamanCreate a free_lseg() function from the duplicated code.
--- fs/nfs/pnfs.c | 34 ++++++++++++++++------------------ 1 files changed, 16 insertions(+), 18 deletions(-)
fs/nfs/pnfs.c +16 -18
@@ -280,6 +280,18 @@ init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg) lseg->pls_notify_count =0 ; } +static void free_lseg (struct pnfs_layout_segment *lseg) +{ +struct inode *ino = lseg->layout->inode; +int count = lseg->pls_notify_count; + +BUG_ON (atomic_read (&lseg->pls_refcount) !=0 ); +NFS_SERVER (ino)->pnfs_curr_ld->free_lseg (lseg); +notify_drained (NFS_SERVER (ino)->nfs_client, count); +/* Matched by get_layout_hdr_locked in pnfs_insert_layout */ +put_layout_hdr (NFS_I (ino)->layout); +} +static void _put_lseg_common (struct pnfs_layout_segment *lseg) {
@@ -329,14 +341,9 @@ put_lseg(struct pnfs_layout_segment *lseg) test_bit(NFS_LSEG_VALID, &lseg->pls_flags)); ino = lseg->layout->inode;if (atomic_dec_and_lock (&lseg->pls_refcount, &ino->i_lock)) { -int count = lseg->pls_notify_count; -_put_lseg_common (lseg);spin_unlock (&ino->i_lock); -NFS_SERVER (ino)->pnfs_curr_ld->free_lseg (lseg); -notify_drained (NFS_SERVER (ino)->nfs_client, count); -/* Matched by get_layout_hdr_locked in pnfs_insert_layout */ -put_layout_hdr (NFS_I (ino)->layout); +free_lseg (lseg); } }EXPORT_SYMBOL_GPL (put_lseg);
@@ -402,18 +409,9 @@ void pnfs_free_lseg_list(struct list_head *free_me) {struct pnfs_layout_segment *lseg, *tmp; -struct inode *ino; -int count; - -list_for_each_entry_safe (lseg, tmp, free_me, fi_list) { -BUG_ON (atomic_read (&lseg->pls_refcount) !=0 ); - ino = lseg->layout->inode; - count = lseg->pls_notify_count; -NFS_SERVER (ino)->pnfs_curr_ld->free_lseg (lseg); -notify_drained (NFS_SERVER (ino)->nfs_client, count); -/* Matched by get_layout_hdr_locked in pnfs_insert_layout */ -put_layout_hdr (NFS_I (ino)->layout); - } + +list_for_each_entry_safe (lseg, tmp, free_me, fi_list) +free_lseg (lseg);INIT_LIST_HEAD (free_me); }
Signature · 1 line
1.7.2.1
PATCH 5/11 wave 2: remove notify_drained
In reply to Fred IsamanJust code it inline.
--- fs/nfs/callback.h | 5 ----- fs/nfs/pnfs.c | 2 +- 2 files changed, 1 insertions(+), 6 deletions(-)
fs/nfs/callback.h +0 -5
@@ -168,11 +168,6 @@ extern unsigned nfs4_callback_layoutrecall(extern void nfs4_check_drain_bc_complete (struct nfs4_session *ses); -static inline void notify_drained (struct nfs_client *clp,int count) -{ -atomic_sub (count, &clp->cl_drain_notify); -} -#endif /* CONFIG_NFS_V4_1 */ extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args,
fs/nfs/pnfs.c +1 -1
@@ -287,7 +287,7 @@ static void free_lseg(struct pnfs_layout_segment *lseg)BUG_ON (atomic_read (&lseg->pls_refcount) !=0 );NFS_SERVER (ino)->pnfs_curr_ld->free_lseg (lseg); -notify_drained (NFS_SERVER (ino)->nfs_client, count); +atomic_sub (count, &NFS_SERVER (ino)->nfs_client->cl_drain_notify);/* Matched by get_layout_hdr_locked in pnfs_insert_layout */ put_layout_hdr (NFS_I (ino)->layout); }
Signature · 1 line
1.7.2.1
PATCH 6/11 wave 2: rename notify fields
In reply to Fred IsamanDue to code changes, these no longer are involved in any notification. Instead, they are just counts, so name appropriately.
--- fs/nfs/callback_proc.c | 4 ++-- fs/nfs/pnfs.c | 10 +++++----- fs/nfs/pnfs.h | 2 +- include/linux/nfs_fs_sb.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-)
fs/nfs/callback_proc.c +2 -2
@@ -202,9 +202,9 @@ static u32 do_callback_layoutrecall(struct nfs_client *clp,dprintk ("%s enter, type=%i\n" , __func__, args->cbl_recall_type);if (test_and_set_bit (NFS4CLNT_LAYOUTRECALL , &clp->cl_state)) goto out; -atomic_inc (&clp->cl_drain_notify); +atomic_inc (&clp->cl_recall_count); status =initiate_layout_draining (clp, args); -if (atomic_dec_and_test (&clp->cl_drain_notify)) +if (atomic_dec_and_test (&clp->cl_recall_count)) res =NFS4ERR_NOMATCHING_LAYOUT ;else res =NFS4ERR_DELAY ;
fs/nfs/pnfs.c +5 -5
@@ -277,17 +277,17 @@ init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg)smp_mb ();set_bit (NFS_LSEG_VALID , &lseg->pls_flags); lseg->layout = lo; - lseg->pls_notify_count =0 ; + lseg->pls_recall_count =0 ; }static void free_lseg (struct pnfs_layout_segment *lseg) {struct inode *ino = lseg->layout->inode; -int count = lseg->pls_notify_count; +int count = lseg->pls_recall_count;BUG_ON (atomic_read (&lseg->pls_refcount) !=0 );NFS_SERVER (ino)->pnfs_curr_ld->free_lseg (lseg); -atomic_sub (count, &NFS_SERVER (ino)->nfs_client->cl_drain_notify); +atomic_sub (count, &NFS_SERVER (ino)->nfs_client->cl_recall_count);/* Matched by get_layout_hdr_locked in pnfs_insert_layout */ put_layout_hdr (NFS_I (ino)->layout); }
@@ -590,8 +590,8 @@ void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo,assert_spin_locked (&lo->inode->i_lock);list_for_each_entry_safe (lseg, tmp, &lo->segs, fi_list)if (should_free_lseg (&lseg->range, range)) { - lseg->pls_notify_count++; -atomic_inc (&NFS_SERVER (lo->inode)->nfs_client->cl_drain_notify); + lseg->pls_recall_count++; +atomic_inc (&NFS_SERVER (lo->inode)->nfs_client->cl_recall_count);mark_lseg_invalid (lseg, tmp_list); } }
fs/nfs/pnfs.h +1 -1
@@ -44,7 +44,7 @@ struct pnfs_layout_segment {atomic_t pls_refcount;unsigned long pls_flags;struct pnfs_layout_hdr *layout; -int pls_notify_count; +int pls_recall_count; };enum pnfs_try_status {
include/linux/nfs_fs_sb.h +1 -1
@@ -84,7 +84,7 @@ struct nfs_client {u32 cl_exchange_flags;struct nfs4_session *cl_session;/* sharred session */ struct list_head cl_layouts; -atomic_t cl_drain_notify; +atomic_t cl_recall_count;/* no. of lsegs in recall */ struct pnfs_deviceid_cache *cl_devid_cache;/* pNFS deviceid cache */ #endif /* CONFIG_NFS_V4_1 */
Signature · 1 line
1.7.2.1
PATCH 7/11 wave 2: remove trigger_flush
In reply to Fred IsamanWe intend to just stop using the layout, no need to flush page cache.
--- fs/nfs/callback_proc.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
fs/nfs/callback_proc.c +0 -8
@@ -111,11 +111,6 @@ int nfs4_validate_delegation_stateid(struct nfs_delegation *delegation, const nf#if defined(CONFIG_NFS_V4_1 ) -static void trigger_flush (struct inode *ino) -{ -write_inode_now (ino,0 ); -} -static int initiate_layout_draining (struct nfs_client *clp,struct cb_layoutrecallargs *args) {
@@ -154,8 +149,6 @@ static int initiate_layout_draining(struct nfs_client *clp, }pnfs_set_layout_stateid (lo, &args->cbl_stateid, true);spin_unlock (&lo->inode->i_lock); -if (rv ==NFS4_OK ) -trigger_flush (lo->inode);pnfs_free_lseg_list (&free_me_list); }else {struct pnfs_layout_hdr *tmp;
@@ -185,7 +178,6 @@ static int initiate_layout_draining(struct nfs_client *clp,nfs4_asynch_forget_layouts (lo, &range, &free_me_list);list_del_init (&lo->plh_bulk_recall);spin_unlock (&lo->inode->i_lock); -trigger_flush (lo->inode);put_layout_hdr (lo); rv =NFS4_OK ; }
Signature · 1 line
1.7.2.1
PATCH 8/11 wave 2: remove table above should_free_lseg
In reply to Fred IsamanThe table doesn't add any useful information.
--- fs/nfs/pnfs.c | 11 ----------- 1 files changed, 0 insertions(+), 11 deletions(-)
fs/nfs/pnfs.c +0 -11
@@ -348,17 +348,6 @@ put_lseg(struct pnfs_layout_segment *lseg) }EXPORT_SYMBOL_GPL (put_lseg); -/* -* iomode matching rules: -* range lseg match -* ----- ----- ----- -* ANY READ true -* ANY RW true -* RW READ false -* RW RW true -* READ READ true -* READ RW false -*/ bool should_free_lseg (struct pnfs_layout_range *lseg_range,struct pnfs_layout_range *recall_range)
Signature · 1 line
1.7.2.1
PATCH 9/11 wave 2: Fix outdated comment above _pnfs_return_layout
In reply to Fred Isaman--- fs/nfs/pnfs.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/nfs/pnfs.c +3 -1
@@ -585,7 +585,9 @@ void nfs4_asynch_forget_layouts(struct pnfs_layout_hdr *lo, } } -/* Initiates a LAYOUTRETURN(FILE) */ +/* Since we are using the forgetful model, nothing is sent over the wire. +* However, we still must stop using any matching layouts. +*/ int _pnfs_return_layout (struct inode *ino,struct pnfs_layout_range *range,bool wait)
Signature · 1 line
1.7.2.1
PATCH 10/11 wave 2: remove unneeded include from pnfs.h
In reply to Fred IsamanThis was added to support now removed code, so it can go too.
--- fs/nfs/pnfs.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
fs/nfs/pnfs.h +0 -1
@@ -31,7 +31,6 @@#define FS_NFS_PNFS_H #include <linux/nfs_page.h> -#include "callback.h" /* for cb_layoutrecallargs */ enum {NFS_LSEG_VALID =0 ,/* cleared when lseg is recalled/returned */
Signature · 1 line
1.7.2.1
PATCH 11/11 wave 2: remove unneeded includes from callback_proc.c
In reply to Fred IsamanThese were added to support now removed code, so they can go too.
--- fs/nfs/callback_proc.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
fs/nfs/callback_proc.c +0 -3
@@ -8,9 +8,6 @@#include <linux/nfs4.h> #include <linux/nfs_fs.h> #include <linux/slab.h> -#include <linux/kthread.h> -#include <linux/module.h> -#include <linux/writeback.h> #include "nfs4_fs.h" #include "callback.h" #include "delegation.h"
Signature · 1 line
1.7.2.1