From 47051a2152f8b2355ee70249a0faaf7b682e8ce5 Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 27 Apr 2007 15:26:30 -0700 Subject: [AFS]: Fix VLocation record update wakeup Fix the wakeup transitions after a VLocation record update completes one way or another. This builds on Dave Miller's partial fix. Also move wakeups outside the spinlocked sections. Signed-off-by: David Howells Signed-off-by: David S. Miller --- fs/afs/vlocation.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'fs') diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c index 74cce174882..6c8e95a7c2c 100644 --- a/fs/afs/vlocation.c +++ b/fs/afs/vlocation.c @@ -416,8 +416,8 @@ fill_in_record: goto error_abandon; spin_lock(&vl->lock); vl->state = AFS_VL_VALID; - wake_up(&vl->waitq); spin_unlock(&vl->lock); + wake_up(&vl->waitq); /* schedule for regular updates */ afs_vlocation_queue_for_updates(vl); @@ -442,7 +442,7 @@ found_in_memory: _debug("invalid [state %d]", state); - if ((state == AFS_VL_NEW || state == AFS_VL_NO_VOLUME)) { + if (state == AFS_VL_NEW || state == AFS_VL_NO_VOLUME) { vl->state = AFS_VL_CREATING; spin_unlock(&vl->lock); goto fill_in_record; @@ -453,11 +453,10 @@ found_in_memory: _debug("wait"); spin_unlock(&vl->lock); - ret = wait_event_interruptible( - vl->waitq, - vl->state == AFS_VL_NEW || - vl->state == AFS_VL_VALID || - vl->state == AFS_VL_NO_VOLUME); + ret = wait_event_interruptible(vl->waitq, + vl->state == AFS_VL_NEW || + vl->state == AFS_VL_VALID || + vl->state == AFS_VL_NO_VOLUME); if (ret < 0) goto error; spin_lock(&vl->lock); @@ -471,8 +470,8 @@ success: error_abandon: spin_lock(&vl->lock); vl->state = AFS_VL_NEW; - wake_up(&vl->waitq); spin_unlock(&vl->lock); + wake_up(&vl->waitq); error: ASSERT(vl != NULL); afs_put_vlocation(vl); @@ -675,7 +674,6 @@ static void afs_vlocation_updater(struct work_struct *work) case 0: afs_vlocation_apply_update(vl, &vldb); vl->state = AFS_VL_VALID; - wake_up(&vl->waitq); break; case -ENOMEDIUM: vl->state = AFS_VL_VOLUME_DELETED; @@ -685,6 +683,7 @@ static void afs_vlocation_updater(struct work_struct *work) break; } spin_unlock(&vl->lock); + wake_up(&vl->waitq); /* and then reschedule */ _debug("reschedule"); -- cgit v1.2.3 From b1bdb691c3c38b4fbaf99fa8474f5cfa99b2d774 Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 27 Apr 2007 15:28:45 -0700 Subject: [AF_RXRPC/AFS]: Arch-specific fixes. Fixes for various arch compilation problems: (*) Missing module exports. (*) Variable name collision when rxkad and af_rxrpc both built in (rxrpc_debug). (*) Large constant representation problem (AFS_UUID_TO_UNIX_TIME). (*) Configuration dependencies. (*) printk() format warnings. Signed-off-by: David Howells Signed-off-by: David S. Miller --- fs/Kconfig | 1 + fs/afs/internal.h | 2 +- fs/afs/rxrpc.c | 2 +- fs/afs/use-rtnetlink.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'fs') diff --git a/fs/Kconfig b/fs/Kconfig index e33c0892457..a42f767dcdd 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -2020,6 +2020,7 @@ config AFS_FS tristate "Andrew File System support (AFS) (EXPERIMENTAL)" depends on INET && EXPERIMENTAL select AF_RXRPC + select KEYS help If you say Y here, you will get an experimental Andrew File System driver. It currently only supports unsecured read-only AFS access. diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 6dd3197d1d8..34665f7d7a1 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -367,7 +367,7 @@ struct afs_uuid { u32 time_low; /* low part of timestamp */ u16 time_mid; /* mid part of timestamp */ u16 time_hi_and_version; /* high part of timestamp and version */ -#define AFS_UUID_TO_UNIX_TIME 0x01b21dd213814000 +#define AFS_UUID_TO_UNIX_TIME 0x01b21dd213814000ULL #define AFS_UUID_TIMEHI_MASK 0x0fff #define AFS_UUID_VERSION_TIME 0x1000 /* time-based UUID */ #define AFS_UUID_VERSION_NAME 0x3000 /* name-based UUID */ diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index e7b047328a3..222c1a3abbb 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -772,7 +772,7 @@ int afs_extract_data(struct afs_call *call, struct sk_buff *skb, if (call->offset < count) { if (last) { - _leave(" = -EBADMSG [%d < %lu]", call->offset, count); + _leave(" = -EBADMSG [%d < %zu]", call->offset, count); return -EBADMSG; } _leave(" = -EAGAIN"); diff --git a/fs/afs/use-rtnetlink.c b/fs/afs/use-rtnetlink.c index 82f0daa2897..f8991c700e0 100644 --- a/fs/afs/use-rtnetlink.c +++ b/fs/afs/use-rtnetlink.c @@ -243,7 +243,7 @@ static int afs_read_rtm(struct afs_rtm_desc *desc) desc->datalen = kernel_recvmsg(desc->nlsock, &msg, iov, 1, desc->datamax, 0); if (desc->datalen < 0) { - _leave(" = %ld [recv]", desc->datalen); + _leave(" = %zd [recv]", desc->datalen); return desc->datalen; } -- cgit v1.2.3