!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/src/linux-2.4.18-xfs-1.1/drivers/block/   drwxr-xr-x
Free 318.38 GB of 458.09 GB (69.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     genhd.c (4.12 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 *  Code extracted from
 *  linux/kernel/hd.c
 *
 *  Copyright (C) 1991-1998  Linus Torvalds
 *
 *  devfs support - jj, rgooch, 980122
 *
 *  Moved partition checking code to fs/partitions* - Russell King
 *  (linux@arm.uk.linux.org)
 */

/*
 * TODO:  rip out the remaining init crap from this file  --hch
 */

#include <linux/config.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/genhd.h>
#include <linux/kernel.h>
#include <linux/blk.h>
#include <linux/init.h>
#include <linux/spinlock.h>


static rwlock_t gendisk_lock;

/*
 * Global kernel list of partitioning information.
 *
 * XXX: you should _never_ access this directly.
 *    the only reason this is exported is source compatiblity.
 */
/*static*/ struct gendisk *gendisk_head;
static struct gendisk *gendisk_array[MAX_BLKDEV];

EXPORT_SYMBOL(gendisk_head);


/**
 * add_gendisk - add partitioning information to kernel list
 * @gp: per-device partitioning information
 *
 * This function registers the partitioning information in @gp
 * with the kernel.
 */
void
add_gendisk(struct gendisk *gp)
{
    struct gendisk *sgp;

    write_lock(&gendisk_lock);

    /*
      *    In 2.5 this will go away. Fix the drivers who rely on
      *    old behaviour.
      */

    for (sgp = gendisk_head; sgp; sgp = sgp->next)
    {
        if (sgp == gp)
        {
//            printk(KERN_ERR "add_gendisk: device major %d is buggy and added a live gendisk!\n",
//                sgp->major)
            goto out;
        }
    }
    gendisk_array[gp->major] = gp;
    gp->next = gendisk_head;
    gendisk_head = gp;
out:
    write_unlock(&gendisk_lock);
}

EXPORT_SYMBOL(add_gendisk);


/**
 * del_gendisk - remove partitioning information from kernel list
 * @gp: per-device partitioning information
 *
 * This function unregisters the partitioning information in @gp
 * with the kernel.
 */
void
del_gendisk(struct gendisk *gp)
{
    struct gendisk **gpp;

    write_lock(&gendisk_lock);
    gendisk_array[gp->major] = NULL;
    for (gpp = &gendisk_head; *gpp; gpp = &((*gpp)->next))
        if (*gpp == gp)
            break;
    if (*gpp)
        *gpp = (*gpp)->next;
    write_unlock(&gendisk_lock);
}

EXPORT_SYMBOL(del_gendisk);


/**
 * get_gendisk - get partitioning information for a given device
 * @dev: device to get partitioning information for
 *
 * This function gets the structure containing partitioning
 * information for the given device @dev.
 */
struct gendisk *
get_gendisk(kdev_t dev)
{
    struct gendisk *gp = NULL;
    int maj = MAJOR(dev);

    read_lock(&gendisk_lock);
    if ((gp = gendisk_array[maj]))
        goto out;

    /* This is needed for early 2.4 source compatiblity.  --hch */
    for (gp = gendisk_head; gp; gp = gp->next)
        if (gp->major == maj)
            break;
out:
    read_unlock(&gendisk_lock);
    return gp;
}

EXPORT_SYMBOL(get_gendisk);


#ifdef CONFIG_PROC_FS
int
get_partition_list(char *page, char **start, off_t offset, int count)
{
    struct gendisk *gp;
    char buf[64];
    int len, n;

    len = sprintf(page, "major minor  #blocks  name\n\n");
    read_lock(&gendisk_lock);
    for (gp = gendisk_head; gp; gp = gp->next) {
        for (n = 0; n < (gp->nr_real << gp->minor_shift); n++) {
            if (gp->part[n].nr_sects == 0)
                continue;

            len += snprintf(page + len, 63,
                    "%4d  %4d %10d %s\n",
                    gp->major, n, gp->sizes[n],
                    disk_name(gp, n, buf));
            if (len < offset)
                offset -= len, len = 0;
            else if (len >= offset + count)
                goto out;
        }
    }

out:
    read_unlock(&gendisk_lock);
    *start = page + offset;
    len -= offset;
    if (len < 0)
        len = 0;
    return len > count ? count : len;
}
#endif


extern int blk_dev_init(void);
#ifdef CONFIG_FUSION_BOOT
extern int fusion_init(void);
#endif
extern int net_dev_init(void);
extern void console_map_init(void);
extern int soc_probe(void);
extern int atmdev_init(void);
extern int i2o_init(void);
extern int cpqarray_init(void);

int __init device_init(void)
{
    rwlock_init(&gendisk_lock);
    blk_dev_init();
    sti();
#ifdef CONFIG_I2O
    i2o_init();
#endif
#ifdef CONFIG_FUSION_BOOT
    fusion_init();
#endif
#ifdef CONFIG_FC4_SOC
    /* This has to be done before scsi_dev_init */
    soc_probe();
#endif
#ifdef CONFIG_BLK_CPQ_DA
    cpqarray_init();
#endif
#ifdef CONFIG_NET
    net_dev_init();
#endif
#ifdef CONFIG_ATM
    (void) atmdev_init();
#endif
#ifdef CONFIG_VT
    console_map_init();
#endif
    return 0;
}

__initcall(device_init);

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0047 ]--