Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=06489b4eec832227b6f30b4b43ab26a2c50d9225
Commit:     06489b4eec832227b6f30b4b43ab26a2c50d9225
Parent:     282a821f18fe848db860e911fa5e1f6a3603dd80
Author:     Eric W. Biederman <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 18 03:05:28 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Oct 18 14:37:23 2007 -0700

    sysctl: remove broken cdrom binary sysctls
    
    The binary interface for the cdrom sysctls can't possilby work.  So remove 
the
    binary sysctls and update the test for finding out which sysctl table entry 
we
    are dealy with to use the procname and not the ctl_name (which I am 
removing).
    
    Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
    Cc: Alexey Dobriyan <[EMAIL PROTECTED]>
    Cc: Jens Axboe <[EMAIL PROTECTED]>
    Cc: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/cdrom/cdrom.c |   46 ++++++----------------------------------------
 1 files changed, 6 insertions(+), 40 deletions(-)

diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 7924571..d70745c 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -3458,47 +3458,19 @@ static void cdrom_update_settings(void)
 static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp,
                                void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-       int *valp = ctl->data;
-       int val = *valp;
        int ret;
        
        ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
-       if (write && *valp != val) {
+       if (write) {
        
                /* we only care for 1 or 0. */
-               if (*valp)
-                       *valp = 1;
-               else
-                       *valp = 0;
+               autoclose        = !!cdrom_sysctl_settings.autoclose;
+               autoeject        = !!cdrom_sysctl_settings.autoeject;
+               debug            = !!cdrom_sysctl_settings.debug;
+               lockdoor         = !!cdrom_sysctl_settings.lock;
+               check_media_type = !!cdrom_sysctl_settings.check;
 
-               switch (ctl->ctl_name) {
-               case DEV_CDROM_AUTOCLOSE: {
-                       if (valp == &cdrom_sysctl_settings.autoclose)
-                               autoclose = cdrom_sysctl_settings.autoclose;
-                       break;
-                       }
-               case DEV_CDROM_AUTOEJECT: {
-                       if (valp == &cdrom_sysctl_settings.autoeject)
-                               autoeject = cdrom_sysctl_settings.autoeject;
-                       break;
-                       }
-               case DEV_CDROM_DEBUG: {
-                       if (valp == &cdrom_sysctl_settings.debug)
-                               debug = cdrom_sysctl_settings.debug;
-                       break;
-                       }
-               case DEV_CDROM_LOCK: {
-                       if (valp == &cdrom_sysctl_settings.lock)
-                               lockdoor = cdrom_sysctl_settings.lock;
-                       break;
-                       }
-               case DEV_CDROM_CHECK_MEDIA: {
-                       if (valp == &cdrom_sysctl_settings.check)
-                               check_media_type = cdrom_sysctl_settings.check;
-                       break;
-                       }
-               }
                /* update the option flags according to the changes. we
                   don't have per device options through sysctl yet,
                   but we will have and then this will disappear. */
@@ -3511,7 +3483,6 @@ static int cdrom_sysctl_handler(ctl_table *ctl, int 
write, struct file * filp,
 /* Place files in /proc/sys/dev/cdrom */
 static ctl_table cdrom_table[] = {
        {
-               .ctl_name       = DEV_CDROM_INFO,
                .procname       = "info",
                .data           = &cdrom_sysctl_settings.info, 
                .maxlen         = CDROM_STR_SIZE,
@@ -3519,7 +3490,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_info,
        },
        {
-               .ctl_name       = DEV_CDROM_AUTOCLOSE,
                .procname       = "autoclose",
                .data           = &cdrom_sysctl_settings.autoclose,
                .maxlen         = sizeof(int),
@@ -3527,7 +3497,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_handler,
        },
        {
-               .ctl_name       = DEV_CDROM_AUTOEJECT,
                .procname       = "autoeject",
                .data           = &cdrom_sysctl_settings.autoeject,
                .maxlen         = sizeof(int),
@@ -3535,7 +3504,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_handler,
        },
        {
-               .ctl_name       = DEV_CDROM_DEBUG,
                .procname       = "debug",
                .data           = &cdrom_sysctl_settings.debug,
                .maxlen         = sizeof(int),
@@ -3543,7 +3511,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_handler,
        },
        {
-               .ctl_name       = DEV_CDROM_LOCK,
                .procname       = "lock",
                .data           = &cdrom_sysctl_settings.lock,
                .maxlen         = sizeof(int),
@@ -3551,7 +3518,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_handler,
        },
        {
-               .ctl_name       = DEV_CDROM_CHECK_MEDIA,
                .procname       = "check_media",
                .data           = &cdrom_sysctl_settings.check,
                .maxlen         = sizeof(int),
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to