diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2018-07-25 15:45:10 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2018-07-25 15:45:10 -0400 |
commit | 294fa97e5febe9b4457aa73e9fbddaa7fee9dff2 (patch) | |
tree | 6453e647d3a36d68495accfbe60ec82a8b2c2cb5 | |
parent | 0d7a5d013d8efd1fb47085cb5c6e4f696510ff6e (diff) | |
download | longterm-queue-4.12-294fa97e5febe9b4457aa73e9fbddaa7fee9dff2.tar.gz |
nfs: ctxt refresh
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch b/queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch index d7fd433..40d6a64 100644 --- a/queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch +++ b/queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch @@ -1,4 +1,4 @@ -From 5cb953d4b1e70a09084f71594c45d47458346bc2 Mon Sep 17 00:00:00 2001 +From d07628cc1c9b1f16242295ea24e515fa00b26b04 Mon Sep 17 00:00:00 2001 From: Trond Myklebust <trond.myklebust@primarydata.com> Date: Tue, 1 Aug 2017 17:04:12 -0400 Subject: [PATCH] NFS: Use an atomic_long_t to count the number of commits @@ -6,25 +6,26 @@ Subject: [PATCH] NFS: Use an atomic_long_t to count the number of commits commit 5cb953d4b1e70a09084f71594c45d47458346bc2 upstream. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c -index 0480eb02299a..134d9f560240 100644 +index 8c465d3c7e05..4246812964ed 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c -@@ -2012,7 +2012,7 @@ static void init_once(void *foo) +@@ -1985,7 +1985,7 @@ static void init_once(void *foo) INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); INIT_LIST_HEAD(&nfsi->commit_info.list); - atomic_long_set(&nfsi->nrequests, 0); + nfsi->nrequests = 0; - nfsi->commit_info.ncommit = 0; + atomic_long_set(&nfsi->commit_info.ncommit, 0); atomic_set(&nfsi->commit_info.rpcs_out, 0); init_rwsem(&nfsi->rmdir_sem); - mutex_init(&nfsi->commit_mutex); + nfs4_init_once(nfsi); diff --git a/fs/nfs/write.c b/fs/nfs/write.c -index 08093552f115..12479c25028e 100644 +index 86d73ecda36b..2fd1a2959fa5 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c -@@ -857,7 +857,7 @@ nfs_request_add_commit_list_locked(struct nfs_page *req, struct list_head *dst, +@@ -826,7 +826,7 @@ nfs_request_add_commit_list_locked(struct nfs_page *req, struct list_head *dst, { set_bit(PG_CLEAN, &req->wb_flags); nfs_list_add_request(req, dst); @@ -33,7 +34,7 @@ index 08093552f115..12479c25028e 100644 } EXPORT_SYMBOL_GPL(nfs_request_add_commit_list_locked); -@@ -903,7 +903,7 @@ nfs_request_remove_commit_list(struct nfs_page *req, +@@ -872,7 +872,7 @@ nfs_request_remove_commit_list(struct nfs_page *req, if (!test_and_clear_bit(PG_CLEAN, &(req)->wb_flags)) return; nfs_list_remove_request(req); @@ -42,7 +43,7 @@ index 08093552f115..12479c25028e 100644 } EXPORT_SYMBOL_GPL(nfs_request_remove_commit_list); -@@ -1017,7 +1017,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) +@@ -979,7 +979,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) unsigned long nfs_reqs_to_commit(struct nfs_commit_info *cinfo) { @@ -50,20 +51,20 @@ index 08093552f115..12479c25028e 100644 + return atomic_long_read(&cinfo->mds->ncommit); } - /* NFS_I(cinfo->inode)->commit_mutex held by caller */ -@@ -1057,8 +1057,10 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst, + /* cinfo->inode->i_lock held by caller */ +@@ -1020,8 +1020,10 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst, { int ret = 0; + if (!atomic_long_read(&cinfo->mds->ncommit)) + return 0; - mutex_lock(&NFS_I(cinfo->inode)->commit_mutex); + spin_lock(&cinfo->inode->i_lock); - if (cinfo->mds->ncommit > 0) { + if (atomic_long_read(&cinfo->mds->ncommit) > 0) { const int max = INT_MAX; ret = nfs_scan_commit_list(&cinfo->mds->list, dst, -@@ -1890,7 +1892,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) +@@ -1879,7 +1881,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) int ret = 0; /* no commits means nothing needs to be done */ @@ -73,10 +74,10 @@ index 08093552f115..12479c25028e 100644 if (wbc->sync_mode == WB_SYNC_NONE) { diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h -index 62cbcb842f99..164d5359d4ab 100644 +index 7882a07d973e..34e80ffd9e90 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h -@@ -1476,7 +1476,7 @@ struct nfs_pgio_header { +@@ -1462,7 +1462,7 @@ struct nfs_pgio_header { struct nfs_mds_commit_info { atomic_t rpcs_out; |