All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@austin.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 5/7] update the mutex name in the memory_block struct
Date: Mon, 12 Jul 2010 10:46:14 -0500	[thread overview]
Message-ID: <4C3B38C6.3030806@austin.ibm.com> (raw)
In-Reply-To: <4C3B3446.5090302@austin.ibm.com>

This patch updates the name of the memory_block mutex
since it is now used for more than just gating changes
to the status of the memory section coveerd by the memory
sysfs directory.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---
 drivers/base/memory.c  |   20 ++++++++++----------
 include/linux/memory.h |    9 +--------
 2 files changed, 11 insertions(+), 18 deletions(-)

Index: linux-2.6/drivers/base/memory.c
===================================================================
--- linux-2.6.orig/drivers/base/memory.c	2010-07-09 14:38:09.000000000 -0500
+++ linux-2.6/drivers/base/memory.c	2010-07-09 14:38:18.000000000 -0500
@@ -242,7 +242,7 @@
 	struct list_head *pos;
 	int ret = 0;
 
-	mutex_lock(&mem->state_mutex);
+	mutex_lock(&mem->mutex);
 
 	list_for_each(pos, &mem->sections) {
 		mbs = list_entry(pos, struct memory_block_section, next);
@@ -272,7 +272,7 @@
 	if (!ret)
 		mem->state = to_state;
 
-	mutex_unlock(&mem->state_mutex);
+	mutex_unlock(&mem->mutex);
 	return ret;
 }
 
@@ -352,7 +352,7 @@
 	if (list_is_singular(&mem->sections))
 		return -EINVAL;
 
-	mutex_lock(&mem->state_mutex);
+	mutex_lock(&mem->mutex);
 
 	list_for_each(pos, &mem->sections) {
 		mbs = list_entry(pos, struct memory_block_section, next);
@@ -370,11 +370,11 @@
 	if (!new_mem_blk)
 		return -ENOMEM;
 
-	mutex_init(&new_mem_blk->state_mutex);
+	mutex_init(&new_mem_blk->mutex);
 	INIT_LIST_HEAD(&new_mem_blk->sections);
 	new_mem_blk->state = mem->state;
 
-	mutex_lock(&new_mem_blk->state_mutex);
+	mutex_lock(&new_mem_blk->mutex);
 
 	new_blk_total = total_scns / 2;
 	new_blk_min = max_scn_nr - new_blk_total + 1;
@@ -395,8 +395,8 @@
 	update_memory_block_phys_indexes(mem);
 	update_memory_block_phys_indexes(new_mem_blk);
 
-	mutex_unlock(&new_mem_blk->state_mutex);
-	mutex_unlock(&mem->state_mutex);
+	mutex_unlock(&new_mem_blk->mutex);
+	mutex_unlock(&mem->mutex);
 	return count;
 }
 
@@ -653,7 +653,7 @@
 			return -ENOMEM;
 
 		mem->state = state;
-		mutex_init(&mem->state_mutex);
+		mutex_init(&mem->mutex);
 		start_pfn = section_nr_to_pfn(__section_nr(section));
 		mem->phys_device = arch_get_memory_phys_device(start_pfn);
 		INIT_LIST_HEAD(&mem->sections);
@@ -680,7 +680,7 @@
 	int section_nr = __section_nr(section);
 
 	mem = find_memory_block(section);
-	mutex_lock(&mem->state_mutex);
+	mutex_lock(&mem->mutex);
 
 	/* remove the specified section */
 	list_for_each_safe(pos, tmp, &mem->sections) {
@@ -692,7 +692,7 @@
 		}
 	}
 
-	mutex_unlock(&mem->state_mutex);
+	mutex_unlock(&mem->mutex);
 
 	if (list_empty(&mem->sections)) {
 		unregister_mem_sect_under_nodes(mem);
Index: linux-2.6/include/linux/memory.h
===================================================================
--- linux-2.6.orig/include/linux/memory.h	2010-07-09 14:36:54.000000000 -0500
+++ linux-2.6/include/linux/memory.h	2010-07-09 14:38:18.000000000 -0500
@@ -31,14 +31,7 @@
 	unsigned long state;
 	unsigned long start_phys_index;
 	unsigned long end_phys_index;
-
-	/*
-	 * This serializes all state change requests.  It isn't
-	 * held during creation because the control files are
-	 * created long after the critical areas during
-	 * initialization.
-	 */
-	struct mutex state_mutex;
+	struct mutex mutex;
 	int phys_device;		/* to which fru does this belong? */
 	void *hw;			/* optional pointer to fw/hw data */
 	int (*phys_callback)(struct memory_block *);

  parent reply	other threads:[~2010-07-12 15:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-12 15:27 [PATCH 0/7] De-couple sysfs memory directories from memory sections Nathan Fontenot
2010-07-12 15:42 ` [PATCH 1/7] Split the memory_block structure Nathan Fontenot
2010-07-13  6:18   ` KAMEZAWA Hiroyuki
2010-07-13  6:18     ` KAMEZAWA Hiroyuki
2010-07-13 15:44     ` Nathan Fontenot
2010-07-13 15:44       ` Nathan Fontenot
2010-07-13 14:00   ` Brian King
2010-07-13 14:00     ` Brian King
2010-07-13 15:59     ` Nathan Fontenot
2010-07-13 15:59       ` Nathan Fontenot
2010-07-12 15:43 ` [PATCH 2/7] Create the new 'end_phys_index' file Nathan Fontenot
2010-07-12 15:44 ` [PATCH 3/7] Update the [register,unregister]_memory routines Nathan Fontenot
2010-07-13  6:20   ` KAMEZAWA Hiroyuki
2010-07-13  6:20     ` KAMEZAWA Hiroyuki
2010-07-13 15:46     ` Nathan Fontenot
2010-07-13 15:46       ` Nathan Fontenot
2010-07-12 15:45 ` [PATCH 4/7] Allow sysfs memory directories to be split Nathan Fontenot
2010-07-13  6:28   ` KAMEZAWA Hiroyuki
2010-07-13  6:28     ` KAMEZAWA Hiroyuki
2010-07-13 15:51     ` Nathan Fontenot
2010-07-13 15:51       ` Nathan Fontenot
2010-07-14  0:35       ` KAMEZAWA Hiroyuki
2010-07-14  0:35         ` KAMEZAWA Hiroyuki
2010-07-14  3:18         ` Nathan Fontenot
2010-07-14  3:18           ` Nathan Fontenot
2010-07-14  3:25           ` KAMEZAWA Hiroyuki
2010-07-14  3:25             ` KAMEZAWA Hiroyuki
2010-07-14  8:30             ` KAMEZAWA Hiroyuki
2010-07-14  8:30               ` KAMEZAWA Hiroyuki
2010-07-14  3:26         ` Dave Hansen
2010-07-14  3:26           ` Dave Hansen
2010-07-14 17:16           ` Nathan Fontenot
2010-07-14 17:16             ` Nathan Fontenot
2010-07-12 15:46 ` Nathan Fontenot [this message]
2010-07-12 15:47 ` [PATCH 6/7] Update sysfs node routines for new sysfs memory directories Nathan Fontenot
2010-07-12 15:48 ` [PATCH 7/7] Enable multiple memory sections per sysfs memory directory for powerpc/pseries Nathan Fontenot
2010-07-16  7:13 ` [PATCH 0/7] De-couple sysfs memory directories from memory sections Greg KH
2010-07-16  7:13   ` Greg KH
2010-07-16 15:41   ` Nathan Fontenot
2010-07-16 15:41     ` Nathan Fontenot

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=4C3B38C6.3030806@austin.ibm.com \
    --to=nfont@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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.