]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: remove /proc/fs/ceph
authorSage Weil <sage@newdream.net>
Wed, 25 Feb 2009 18:09:19 +0000 (10:09 -0800)
committerSage Weil <sage@newdream.net>
Wed, 25 Feb 2009 18:12:06 +0000 (10:12 -0800)
/sys/fs/ceph now does everything it used to.

src/Makefile.am
src/kernel/Makefile
src/kernel/proc.c [deleted file]
src/kernel/super.c
src/kernel/super.h

index 84734bd61cfb56ec59c6b169049be29861080af0..d75182d672fa780d9b8b0022bc927b1cd21ddb1f 100644 (file)
@@ -382,7 +382,6 @@ noinst_HEADERS = \
        kernel/osd_client.h\
        kernel/osdmap.c\
        kernel/osdmap.h\
-       kernel/proc.c\
        kernel/snap.c\
        kernel/super.c\
        kernel/super.h\
index a7d6f7a0f183bd832c0c4df2979591fb9e6732ac..fa160827ae97b6d3b3a298ff58d6138527daec6a 100644 (file)
@@ -12,7 +12,7 @@ ceph-objs := super.o inode.o dir.o file.o addr.o ioctl.o \
        mds_client.o mdsmap.o \
        mon_client.o \
        osd_client.o osdmap.o crush/crush.o crush/mapper.o \
-       proc.o sysfs.o ceph_tools.o
+       sysfs.o ceph_tools.o
 
 else
 #Otherwise we were called directly from the command
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
deleted file mode 100644 (file)
index 6a0a046..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-#include <linux/module.h>
-#include <linux/proc_fs.h>
-#include <linux/ctype.h>
-#include <linux/uaccess.h>
-#include <linux/seq_file.h>
-
-
-#include "ceph_debug.h"
-int ceph_debug_proc = -1;
-#define DOUT_MASK DOUT_MASK_PROC
-#define DOUT_VAR ceph_debug_proc
-
-#include "super.h"
-
-
-static int ceph_debug_level_read(char *page, char **start, off_t off,
-                      int count, int *eof, void *data)
-{
-       int len;
-       int *debug = data;
-
-       len = sprintf(page, "%d\n", *debug);
-
-       if ((len < 0) || (len <= off)) {
-               *start = page;
-               *eof = 1;
-               return 0;
-       }
-
-       len -= off;
-
-       *start = page + off;
-
-       if (len > count)
-               len = count;
-       else
-               *eof = 1;
-
-       return len;
-}
-
-static int ceph_debug_mask_read(char *page, char **start, off_t off,
-                      int count, int *eof, void *data)
-{
-       int len;
-       int *debug = data;
-
-       len = sprintf(page, "0x%x\n", *debug);
-
-       if ((len < 0) || (len <= off)) {
-               *start = page;
-               *eof = 1;
-               return 0;
-       }
-
-       len -= off;
-
-       *start = page + off;
-
-       if (len > count)
-               len = count;
-       else
-               *eof = 1;
-
-       return len;
-}
-
-static int ceph_debug_level_write(struct file *file, const char __user *buffer,
-                               unsigned long count, void *data)
-{
-#define PROC_STR_LEN   16
-       char level_str[PROC_STR_LEN];
-       int new_dl;
-       int *debug = data;
-
-       if ((count < 1) || (count > sizeof(level_str)-1))
-               return -EINVAL;
-
-       level_str[PROC_STR_LEN-1] = 0;
-
-       if (copy_from_user(level_str, buffer, count))
-               return -EFAULT;
-
-       level_str[count] = 0;
-
-       new_dl = simple_strtol(level_str, NULL, 0);
-
-       *debug = new_dl;
-
-       return count;
-}
-
-static int ceph_debug_mask_write(struct file *file, const char __user *buffer,
-                               unsigned long count, void *data)
-{
-       char  *mask_str, *tok;
-       int new_dl;
-       int *debug = data;
-
-#define MAX_BUF        512
-       if ((count < 1) || (count > MAX_BUF))
-               return -EINVAL;
-
-       mask_str = kmalloc(count+1, GFP_KERNEL);
-
-       if (copy_from_user(mask_str, buffer, count))
-               return -EFAULT;
-
-       mask_str[count] = 0;
-
-       do {
-               tok = strsep(&mask_str, " \t\r\n");
-
-               if (isdigit(*tok)) {
-                       new_dl = simple_strtol(tok, NULL, 0);
-                       *debug = new_dl;
-               } else {
-                       int remove = 0;
-                       int mask;
-
-                       if (*tok == '-') {
-                               remove = 1;
-                               tok++;
-                       } else if (*tok == '+')
-                               tok++;
-
-                       mask = ceph_get_debug_mask(tok);
-
-                       if (remove)
-                               *debug &= ~mask;
-                       else
-                               *debug |= mask;
-
-               }
-       } while (mask_str);
-
-
-       kfree(mask_str);
-
-       return count;
-}
-
-static struct proc_dir_entry *proc_fs_ceph;
-static struct proc_dir_entry *proc_fs_ceph_clients;
-
-int ceph_proc_init(void)
-{
-       struct proc_dir_entry *pde;
-
-       proc_fs_ceph = proc_mkdir("fs/ceph", NULL);
-       if (!proc_fs_ceph)
-               return -ENOMEM;
-
-       proc_fs_ceph->owner = THIS_MODULE;
-       pde = create_proc_read_entry("debug", 0,
-                                    proc_fs_ceph, ceph_debug_level_read,
-                                    &ceph_debug);
-       if (pde)
-               pde->write_proc = ceph_debug_level_write;
-       pde = create_proc_read_entry("debug_msgr", 0,
-                                    proc_fs_ceph, ceph_debug_level_read,
-                                    &ceph_debug_msgr);
-       if (pde)
-               pde->write_proc = ceph_debug_level_write;
-       pde = create_proc_read_entry("debug_console", 0,
-                                    proc_fs_ceph, ceph_debug_level_read,
-                                    &ceph_debug_console);
-       if (pde)
-               pde->write_proc = ceph_debug_level_write;
-
-       pde = create_proc_read_entry("debug_mask", 0,
-                                    proc_fs_ceph, ceph_debug_mask_read,
-                                    &ceph_debug_mask);
-       if (pde)
-               pde->write_proc = ceph_debug_mask_write;
-
-       proc_fs_ceph_clients = proc_mkdir("clients", proc_fs_ceph);
-
-       return 0;
-}
-
-void ceph_proc_cleanup(void)
-{
-       struct list_head *p;
-       struct ceph_client *client;
-
-       spin_lock(&ceph_clients_list_lock);
-       list_for_each(p, &ceph_clients) {
-               client = list_entry(p, struct ceph_client, clients_all);
-               ceph_proc_unregister_client(client);
-       }
-       spin_unlock(&ceph_clients_list_lock);
-
-       remove_proc_entry("clients", proc_fs_ceph);
-       remove_proc_entry("debug", proc_fs_ceph);
-       remove_proc_entry("debug_msgr", proc_fs_ceph);
-       remove_proc_entry("debug_console", proc_fs_ceph);
-       remove_proc_entry("debug_mask", proc_fs_ceph);
-       remove_proc_entry("fs/ceph", NULL);
-}
-
-static int ceph_client_data_proc_show(struct seq_file *sf, void *v)
-{
-       struct ceph_client *client = sf->private;
-       int i;
-
-       seq_printf(sf, "Client%d:\n", client->whoami);
-       seq_printf(sf, "----------\n");
-       seq_printf(sf, "mon:\n");
-       seq_printf(sf, "\tfsid\t%llx.%llx\n", le64_to_cpu(__ceph_fsid_major(&client->monc.monmap->fsid)),
-                                       le64_to_cpu(__ceph_fsid_minor(&client->monc.monmap->fsid)));
-       seq_printf(sf, "\tepoch\t%d\n", client->monc.monmap->epoch);
-
-       for (i=0; i<client->monc.monmap->num_mon; i++) {
-               struct ceph_entity_inst *inst = &client->monc.monmap->mon_inst[i];
-               seq_printf(sf, "\t%s%d\t%u.%u.%u.%u:%u\n",
-                                               ENTITY_NAME(inst->name),
-                                               IPQUADPORT(inst->addr.ipaddr));
-       }
-       seq_printf(sf, "mds:\n");
-       for (i=0; i<client->mdsc.mdsmap->m_max_mds; i++) {
-               struct ceph_entity_addr *addr = &client->mdsc.mdsmap->m_addr[i];
-               int state = client->mdsc.mdsmap->m_state[i];
-               seq_printf(sf, "\tmds%d\t%u.%u.%u.%u:%u\t(%s)\n",
-                                               i,
-                                               IPQUADPORT(addr->ipaddr),
-                                               ceph_mdsmap_state_str(state));
-       }
-       seq_printf(sf, "osd:\n");
-       for (i=0; i<client->osdc.osdmap->max_osd; i++) {
-               struct ceph_entity_addr *addr = &client->osdc.osdmap->osd_addr[i];
-               int state = client->osdc.osdmap->osd_state[i];
-#define LARGE_ENOUGH_BUF 16
-               char buf[LARGE_ENOUGH_BUF];
-               seq_printf(sf, "\tosd%d\t%u.%u.%u.%u:%u\t(%s)\n",
-                                               i,
-                                               IPQUADPORT(addr->ipaddr),
-                                               ceph_osdmap_state_str(buf, sizeof(buf), state));
-       }
-       return 0;
-}
-
-static int ceph_client_data_proc_open(struct inode *inode, struct file *file)
-{
-       int ret;
-       struct proc_dir_entry *pde = PDE(inode);
-       struct seq_file *sf;
-
-       ret = single_open(file, ceph_client_data_proc_show, NULL);
-       sf = file->private_data;
-
-       sf->private = pde->data;
-
-       return ret;
-}
-
-static const struct file_operations ceph_client_data_fops = {
-       .owner          = THIS_MODULE,
-       .open           = ceph_client_data_proc_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
-
-void ceph_proc_register_client(struct ceph_client *client)
-{
-       char str[16];
-       struct proc_dir_entry *p;
-
-       snprintf(str, sizeof(str), "%d", client->whoami);
-       client->proc_entry = proc_mkdir(str, proc_fs_ceph_clients);
-
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 25)
-       p = create_proc_entry("data", 0, client->proc_entry);
-#else
-       p = proc_create_data("data", 0, client->proc_entry, &ceph_client_data_fops, client);
-#endif
-       if (!p) {
-               derr(0, "couldn't create data proc entry\n");
-       }
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 25)
-       p->owner = THIS_MODULE;
-       p->proc_fops = &ceph_client_data_fops;
-       p->data = client;
-#endif
-}
-
-void ceph_proc_unregister_client(struct ceph_client *client)
-{
-       char str[16];
-
-       remove_proc_entry("data", client->proc_entry);
-       snprintf(str, sizeof(str), "%d", client->whoami);
-       remove_proc_entry(str, proc_fs_ceph_clients);
-}
index c61476184c612eb4f4c01621cd43a29b1e456fb5..051bdb85c0f89108b3d7b8130f181b2e5a05f517 100644 (file)
@@ -254,7 +254,6 @@ static void handle_monmap(struct ceph_client *client, struct ceph_msg *msg)
                dout(1, "i am client%d, fsid is %llx.%llx\n", client->whoami,
                    le64_to_cpu(__ceph_fsid_major(&client->monc.monmap->fsid)),
                    le64_to_cpu(__ceph_fsid_minor(&client->monc.monmap->fsid)));
-               ceph_proc_register_client(client);
                ceph_sysfs_client_init(client);
        }
 }
@@ -683,7 +682,6 @@ static void ceph_destroy_client(struct ceph_client *client)
                destroy_workqueue(client->trunc_wq);
        if (client->msgr)
                ceph_messenger_destroy(client->msgr);
-       ceph_proc_unregister_client(client);
        kfree(client);
        dout(10, "destroy_client %p done\n", client);
 }
@@ -1087,13 +1085,9 @@ static int __init init_ceph(void)
        if (ret < 0)
                goto out;
 
-       ret = ceph_proc_init();
-       if (ret < 0)
-               goto out_sysfs;
-
        ret = ceph_msgr_init();
        if (ret < 0)
-               goto out_proc;
+               goto out_sysfs;
 
        ret = init_inodecache();
        if (ret)
@@ -1108,8 +1102,6 @@ out_icache:
        destroy_inodecache();
 out_msgr:
        ceph_msgr_exit();
-out_proc:
-       ceph_proc_cleanup();
 out_sysfs:
        ceph_sysfs_cleanup();
 out:
@@ -1122,7 +1114,6 @@ static void __exit exit_ceph(void)
        unregister_filesystem(&ceph_fs_type);
        destroy_inodecache();
        ceph_msgr_exit();
-       ceph_proc_cleanup();
        ceph_sysfs_cleanup();
 #ifdef CONFIG_CEPH_BOOKKEEPER
        ceph_bookkeeper_finalize();
index eca2b23ff64a9ae2c9503205e247b6a342262a2c..67c85c4966f5c332ca543bde1686016d960f65f2 100644 (file)
@@ -79,11 +79,6 @@ enum {
        CEPH_MOUNT_SHUTDOWN,
 };
 
-
-extern struct list_head ceph_clients;
-extern spinlock_t ceph_clients_list_lock;
-
-
 /*
  * per-filesystem client state
  *
@@ -785,12 +780,6 @@ extern long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 /* export.c */
 extern const struct export_operations ceph_export_ops;
 
-/* proc.c */
-extern int ceph_proc_init(void);
-extern void ceph_proc_cleanup(void);
-extern void ceph_proc_register_client(struct ceph_client *client);
-extern void ceph_proc_unregister_client(struct ceph_client *client);
-
 /* sysfs.c */
 extern int ceph_sysfs_client_init(struct ceph_client *client);
 extern void ceph_sysfs_client_cleanup(struct ceph_client *client);