mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	netdev@vger.kernel.org, dhowells@redhat.com
Subject: [PATCH 4/8] AFS: Correctly alter relocation state after update and show state in /proc
Date: Wed, 11 Apr 2007 20:10:17 +0100	[thread overview]
Message-ID: <20070411191017.15499.61585.stgit@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <20070411190956.15499.55352.stgit@warthog.cambridge.redhat.com>

Correctly alter the relocation state after update is complete by switching it
from "Updating" to "Valid".

Also display the record state in the vlocation database proc file.

Signed-Off-By: David Howells <dhowells@redhat.com>
---

 fs/afs/proc.c      |   15 +++++++++++++--
 fs/afs/vlocation.c |    4 +++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 9e6af40..d5601f6 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -553,6 +553,16 @@ static void afs_proc_cell_volumes_stop(struct seq_file *p, void *v)
 	up_read(&cell->vl_sem);
 }
 
+const char afs_vlocation_states[][4] = {
+	[AFS_VL_NEW]			= "New",
+	[AFS_VL_CREATING]		= "Crt",
+	[AFS_VL_VALID]			= "Val",
+	[AFS_VL_NO_VOLUME]		= "NoV",
+	[AFS_VL_UPDATING]		= "Upd",
+	[AFS_VL_VOLUME_DELETED]		= "Del",
+	[AFS_VL_UNCERTAIN]		= "Unc",
+};
+
 /*
  * display a header line followed by a load of volume lines
  */
@@ -563,13 +573,14 @@ static int afs_proc_cell_volumes_show(struct seq_file *m, void *v)
 
 	/* display header on line 1 */
 	if (v == (void *) 1) {
-		seq_puts(m, "USE VLID[0]  VLID[1]  VLID[2]  NAME\n");
+		seq_puts(m, "USE STT VLID[0]  VLID[1]  VLID[2]  NAME\n");
 		return 0;
 	}
 
 	/* display one cell per line on subsequent lines */
-	seq_printf(m, "%3d %08x %08x %08x %s\n",
+	seq_printf(m, "%3d %s %08x %08x %08x %s\n",
 		   atomic_read(&vlocation->usage),
+		   afs_vlocation_states[vlocation->state],
 		   vlocation->vldb.vid[0],
 		   vlocation->vldb.vid[1],
 		   vlocation->vldb.vid[2],
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index f0f4419..9af1fe8 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -657,7 +657,7 @@ static void afs_vlocation_updater(struct work_struct *work)
 	switch (ret) {
 	case 0:
 		afs_vlocation_apply_update(vl, &vldb);
-		vl->state = AFS_VL_UPDATING;
+		vl->state = AFS_VL_VALID;
 		break;
 	case -ENOMEDIUM:
 		vl->state = AFS_VL_VOLUME_DELETED;
@@ -691,6 +691,8 @@ static void afs_vlocation_updater(struct work_struct *work)
 		timeout = afs_vlocation_update_timeout;
 	}
 
+	ASSERT(list_empty(&vl->update));
+
 	list_add_tail(&vl->update, &afs_vlocation_updates);
 
 	_debug("timeout %ld", timeout);


  parent reply	other threads:[~2007-04-11 19:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-11 19:09 [PATCH 0/8] AFS: Add security support and fix bugs David Howells
2007-04-11 19:10 ` [PATCH 1/8] AF_RXRPC: Use own workqueues David Howells
2007-04-11 19:10 ` [PATCH 2/8] AF_RXRPC: Lower dead call timeout and fix available call counting on connections David Howells
2007-04-11 19:10 ` [PATCH 3/8] AFS: Fix callback aggregator work item deadlock David Howells
2007-04-11 19:10 ` David Howells [this message]
2007-04-11 19:10 ` [PATCH 5/8] AFS: Handle multiple mounts of an AFS superblock correctly David Howells
2007-04-11 19:10 ` [PATCH 6/8] AFS: AF_RXRPC key changes David Howells
2007-04-11 19:10 ` [PATCH 7/8] AFS: Permit key to be cached in nameidata David Howells
2007-04-11 19:10 ` [PATCH 8/8] AFS: Add security support David Howells
2007-04-11 19:38   ` J. Bruce Fields
2007-04-11 20:10   ` David Howells
2007-04-11 20:17     ` J. Bruce Fields

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=20070411191017.15499.61585.stgit@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@osdl.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

Powered by JetHome