summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdike <jdike>2003-03-22 21:38:11 +0000
committerjdike <jdike>2003-03-22 21:38:11 +0000
commitd4644d38768b52be305add65f3e1eafb79502a58 (patch)
tree90f0415ee694edcfa6f5ecc6256e40cd3e53a562
parentc09374618778c257034f3f43a498010348e9d033 (diff)
downloaduml-history-d4644d38768b52be305add65f3e1eafb79502a58.tar.gz
Removed root-hostfs support since it is not needed. hostfs can be used
as a root filesystem using support in the generic kernel and without any support in hostfs or the ubd driver.
-rw-r--r--arch/um/drivers/ubd_kern.c21
-rw-r--r--arch/um/fs/hostfs/hostfs_kern.c23
-rw-r--r--arch/um/include/ubd_user.h1
3 files changed, 3 insertions, 42 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 5cc8fca..ecd3040 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -126,7 +126,6 @@ struct cow {
struct ubd {
char *file;
- int is_dir;
int count;
int fd;
__u64 size;
@@ -146,7 +145,6 @@ struct ubd {
#define DEFAULT_UBD { \
.file = NULL, \
- .is_dir = 0, \
.count = 0, \
.fd = -1, \
.size = -1, \
@@ -344,8 +342,6 @@ static int ubd_setup_common(char *str, int *index_out)
backing_file++;
}
dev->file = str;
- if(ubd_is_dir(dev->file))
- dev->is_dir = 1;
dev->cow.file = backing_file;
dev->boot_openflags = flags;
out2:
@@ -763,8 +759,6 @@ static int ubd_open(struct inode *inode, struct file *filp)
spin_lock(&ubd_lock);
offset = n << UBD_SHIFT;
- if(dev->is_dir == 1)
- goto out;
if(dev->count == 0){
err = ubd_open_dev(dev);
@@ -799,12 +793,10 @@ static int ubd_release(struct inode * inode, struct file * file)
return -ENODEV;
spin_lock(&ubd_lock);
- if(--ubd_dev[n].count == 0){
+ if(--ubd_dev[n].count == 0)
ubd_close(&ubd_dev[n]);
- sizes[offset] = 0;
- ubd_part[offset].nr_sects = 0;
- }
spin_unlock(&ubd_lock);
+
return(0);
}
@@ -857,12 +849,6 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
minor = MINOR(req->rq_dev);
n = minor >> UBD_SHIFT;
dev = &ubd_dev[n];
- if(dev->is_dir){
- strcpy(req->buffer, "HOSTFS:");
- strcat(req->buffer, dev->file);
- end_request(1);
- return(1);
- }
if(IS_WRITE(req) && !dev->openflags.w){
printk("Write attempted on readonly ubd device %d\n", n);
end_request(0);
@@ -1016,9 +1002,6 @@ static int ubd_revalidate1(kdev_t rdev)
offset = n << UBD_SHIFT;
dev = &ubd_dev[n];
- if(dev->is_dir)
- goto out;
-
part = &ubd_part[offset];
/* clear all old partition counts */
diff --git a/arch/um/fs/hostfs/hostfs_kern.c b/arch/um/fs/hostfs/hostfs_kern.c
index a9a692b..f310136 100644
--- a/arch/um/fs/hostfs/hostfs_kern.c
+++ b/arch/um/fs/hostfs/hostfs_kern.c
@@ -842,37 +842,16 @@ struct super_block *hostfs_read_super(struct super_block *sb, void *data,
return(hostfs_read_super_common(sb, data));
}
-struct super_block *hostfs_root_read_super(struct super_block *sb, void *data,
- int silent)
-{
- struct buffer_head * bh;
- struct super_block *ret = NULL;
- kdev_t dev = sb->s_dev;
- int blocksize = get_hardsect_size(dev);
-
- if(blocksize == 0) blocksize = BLOCK_SIZE;
- set_blocksize (dev, blocksize);
- if(!(bh = bread (dev, 0, blocksize))) return NULL;
- if(strncmp(bh->b_data, "HOSTFS:", strlen("HOSTFS:"))) goto out;
- ret = hostfs_read_super_common(sb, bh->b_data + strlen("HOSTFS:"));
- out:
- brelse (bh);
- return(ret);
-}
-
DECLARE_FSTYPE(hostfs_type, "hostfs", hostfs_read_super, 0);
-DECLARE_FSTYPE_DEV(hostfs_root_type, "root-hostfs", hostfs_root_read_super);
static int __init init_hostfs(void)
{
- return(register_filesystem(&hostfs_type) ||
- register_filesystem(&hostfs_root_type));
+ return(register_filesystem(&hostfs_type));
}
static void __exit exit_hostfs(void)
{
unregister_filesystem(&hostfs_type);
- unregister_filesystem(&hostfs_root_type);
}
module_init(init_hostfs)
diff --git a/arch/um/include/ubd_user.h b/arch/um/include/ubd_user.h
index b28beaf..6e63af7 100644
--- a/arch/um/include/ubd_user.h
+++ b/arch/um/include/ubd_user.h
@@ -39,7 +39,6 @@ extern int read_ubd_fs(int fd, void *buffer, int len);
extern int write_ubd_fs(int fd, char *buffer, int len);
extern int start_io_thread(unsigned long sp, int *fds_out);
extern void do_io(struct io_thread_req *req);
-extern int ubd_is_dir(char *file);
static inline int ubd_test_bit(__u64 bit, unsigned char *data)
{