Commit bc92c8d8 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] add new settings locks to ide-proc

parent 16ba73f3
...@@ -454,6 +454,7 @@ int proc_ide_read_settings ...@@ -454,6 +454,7 @@ int proc_ide_read_settings
char *out = page; char *out = page;
int len, rc, mul_factor, div_factor; int len, rc, mul_factor, div_factor;
down(&ide_setting_sem);
out += sprintf(out, "name\t\t\tvalue\t\tmin\t\tmax\t\tmode\n"); out += sprintf(out, "name\t\t\tvalue\t\tmin\t\tmax\t\tmode\n");
out += sprintf(out, "----\t\t\t-----\t\t---\t\t---\t\t----\n"); out += sprintf(out, "----\t\t\t-----\t\t---\t\t---\t\t----\n");
while(setting) { while(setting) {
...@@ -473,6 +474,7 @@ int proc_ide_read_settings ...@@ -473,6 +474,7 @@ int proc_ide_read_settings
setting = setting->next; setting = setting->next;
} }
len = out - page; len = out - page;
up(&ide_setting_sem);
PROC_IDE_READ_RETURN(page,start,off,count,eof,len); PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
} }
...@@ -541,12 +543,17 @@ int proc_ide_write_settings ...@@ -541,12 +543,17 @@ int proc_ide_write_settings
--n; --n;
++p; ++p;
} }
down(&ide_setting_sem);
setting = ide_find_setting_by_name(drive, name); setting = ide_find_setting_by_name(drive, name);
if (!setting) if (!setting)
{
up(&ide_setting_sem);
goto parse_error; goto parse_error;
}
if (for_real) if (for_real)
ide_write_setting(drive, setting, val * setting->div_factor / setting->mul_factor); ide_write_setting(drive, setting, val * setting->div_factor / setting->mul_factor);
up(&ide_setting_sem);
} }
} while (!for_real++); } while (!for_real++);
return count; return count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment