lkml.org 
[lkml]   [1997]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subjectpre-46-1 minix patch
    This patch is a completion patch trying to integrate the latest changes
    into minix. It is tested and seems to work well. If there's anything
    I missed, I'd appreciate a punt in the right direction. The important
    portions of this code should look very familiar to you :).

    -Mike

    --- ./fs/minix/inode.c.org Fri Jul 18 10:14:43 1997
    +++ ./fs/minix/inode.c Fri Jul 18 10:16:17 1997
    @@ -77,9 +77,10 @@

    static struct super_operations minix_sops = {
    minix_read_inode,
    - NULL,
    minix_write_inode,
    minix_put_inode,
    + NULL,
    + NULL,
    minix_put_super,
    minix_write_super,
    minix_statfs,
    --- ./fs/minix/namei.c.org Fri Jul 18 10:30:15 1997
    +++ ./fs/minix/namei.c Fri Jul 18 11:44:45 1997
    @@ -104,24 +104,22 @@
    return NULL;
    }

    -int minix_lookup(struct inode * dir, struct qstr *name,
    - struct inode ** result)
    +int minix_lookup(struct inode * dir, struct dentry *dentry)
    {
    - int ino;
    + struct inode * inode = NULL;
    struct minix_dir_entry * de;
    struct buffer_head * bh;

    - *result = NULL;
    - if (!dir)
    - return -ENOENT;
    - if (!S_ISDIR(dir->i_mode))
    - return -ENOENT;
    - if (!(bh = minix_find_entry(dir, name->name, name->len, &de)))
    - return -ENOENT;
    - ino = de->inode;
    - brelse(bh);
    - if (!(*result = iget(dir->i_sb,ino)))
    - return -EACCES;
    + bh = minix_find_entry(dir, dentry->d_name.name, dentry->d_name.len, &de);
    + if (bh) {
    + unsigned long ino = le32_to_cpu(de->inode);
    + brelse (bh);
    + inode = iget(dir->i_sb, ino);
    +
    + if (!inode)
    + return -EACCES;
    + }
    + d_add(dentry, inode);
    return 0;
    }

    @@ -602,29 +600,21 @@
    return 0;
    }

    -static int subdir(struct inode * new_inode, struct inode * old_inode)
    +static int subdir(struct dentry * new_dentry, struct dentry * old_dentry)
    {
    - int ino;
    - int result;
    + int result = 0;

    - new_inode->i_count++;
    - result = 0;
    for (;;) {
    - if (new_inode == old_inode) {
    - result = 1;
    - break;
    + if (new_dentry != old_dentry) {
    + struct dentry * parent = new_dentry->d_parent;
    + if (parent == new_dentry)
    + break;
    + new_dentry = parent;
    + continue;
    }
    - if (new_inode->i_dev != old_inode->i_dev)
    - break;
    - ino = new_inode->i_ino;
    - if (minix_lookup(new_inode,
    - &(struct qstr) { "..", 2, 0 },
    - &new_inode))
    - break;
    - if (new_inode->i_ino == ino)
    - break;
    + result = 1;
    + break;
    }
    - iput(new_inode);
    return result;
    }

    @@ -690,7 +680,7 @@
    if (!S_ISDIR(old_inode->i_mode))
    goto end_rename;
    retval = -EINVAL;
    - if (subdir(new_dir, old_inode))
    + if (subdir(new_dentry, old_dentry))
    goto end_rename;
    retval = -ENOTEMPTY;
    if (!empty_dir(new_inode))
    @@ -709,7 +699,7 @@
    if (new_inode && !S_ISDIR(new_inode->i_mode))
    goto end_rename;
    retval = -EINVAL;
    - if (subdir(new_dir, old_inode))
    + if (subdir(new_dentry, old_dentry))
    goto end_rename;
    retval = -EIO;
    dir_bh = minix_bread(old_inode,0,0);
    --- ./include/linux/minix_fs.h.org Fri Jul 18 10:36:08 1997
    +++ ./include/linux/minix_fs.h Fri Jul 18 11:44:00 1997
    @@ -88,8 +88,7 @@

    #ifdef __KERNEL__

    -extern int minix_lookup(struct inode * dir, struct qstr *name,
    - struct inode ** result);
    +extern int minix_lookup(struct inode * dir, struct dentry *dentry);
    extern int minix_create(struct inode * dir, struct dentry *dentry, int mode);
    extern int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode);
    extern int minix_rmdir(struct inode * dir, struct dentry *dentry);
    --- ./kernel/ksyms.c.org Fri Jul 18 12:50:04 1997
    +++ ./kernel/ksyms.c Fri Jul 18 12:52:16 1997
    @@ -154,6 +154,10 @@
    EXPORT_SYMBOL(close_fp);
    EXPORT_SYMBOL(d_alloc_root);
    EXPORT_SYMBOL(d_delete);
    +EXPORT_SYMBOL(d_add);
    +EXPORT_SYMBOL(d_move);
    +EXPORT_SYMBOL(d_instantiate);
    +EXPORT_SYMBOL(__mark_inode_dirty);
    EXPORT_SYMBOL(insert_file_free);
    EXPORT_SYMBOL(check_disk_change);
    EXPORT_SYMBOL(invalidate_buffers);


    \
     
     \ /
      Last update: 2005-03-22 13:39    [W:0.030 / U:60.812 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site