mirror of
https://git.openafs.org/openafs.git
synced 2025-01-22 08:50:17 +00:00
linux-alloc-dont-drop-what-you-dont-have-20020801
avoid trying to drop a glock we don't have
This commit is contained in:
parent
fb6d2422f3
commit
9e06544249
@ -80,6 +80,7 @@ static void *linux_alloc(unsigned int asize, int drop_glock)
|
|||||||
{
|
{
|
||||||
void *new = NULL;
|
void *new = NULL;
|
||||||
int max_retry = 10;
|
int max_retry = 10;
|
||||||
|
int haveGlock = ISAFS_GLOCK();
|
||||||
|
|
||||||
/* if we can use kmalloc use it to allocate the required memory. */
|
/* if we can use kmalloc use it to allocate the required memory. */
|
||||||
while(!new && max_retry)
|
while(!new && max_retry)
|
||||||
@ -106,9 +107,9 @@ static void *linux_alloc(unsigned int asize, int drop_glock)
|
|||||||
#else
|
#else
|
||||||
current->state = TASK_INTERRUPTIBLE;
|
current->state = TASK_INTERRUPTIBLE;
|
||||||
#endif
|
#endif
|
||||||
if (drop_glock) AFS_GUNLOCK();
|
if (drop_glock && haveGlock) AFS_GUNLOCK();
|
||||||
schedule_timeout(HZ);
|
schedule_timeout(HZ);
|
||||||
if (drop_glock) AFS_GLOCK();
|
if (drop_glock && haveGlock) AFS_GLOCK();
|
||||||
#ifdef set_current_state
|
#ifdef set_current_state
|
||||||
set_current_state(TASK_RUNNING);
|
set_current_state(TASK_RUNNING);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user