lkml.org 
[lkml]   [1997]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectPatch to 2.1.45-7 for net/Config.in, modules and msdos
    Date
    From

    The patch at the end of this mail attempts to fix the three following
    items:

    1. make xconfig used to barf because of a "bad if" clause in
    drivers/net/Config.in . Fixed by removing the offending if-clause.

    2. Some modules (isofs, autofs, fat) would not insert because of
    missing symbols in ksyms. Fixed by adding them.

    3. The msdos fs compiles now. However, in keeping with the
    "featureful kernel" spirit, I did not test it thoroughly whether it
    also works correctly. Vfat and umsdos are not done yet. Basic stuff
    seems to work (mkdir, rmdir, create files, remove files); however,
    there is a problem when accessing files by using "funny" names:

    # cat >testing
    this is a test
    # ls
    testing
    # cat TESTing
    this is a test
    # mv testing tust
    # cat TESTing
    this is a test
    # ls
    tust
    # cat testing
    cat: testing: No such file or directory
    # cat TESTing
    this is a test

    Reason for this behavior: although on a MS-DOS fs "TESTing" and
    "testing" are the same physical directory entry, two dentries get
    allocated for them. The source for the problem is probably in
    msdos_lookup, however I have no idea yet how to best fix this.

    Regards,

    Alain

    diff -ur 2.1.45-7/linux/drivers/net/Config.in featurefulKernel/linux/drivers/net/Config.in
    --- 2.1.45-7/linux/drivers/net/Config.in Mon Jul 7 17:19:59 1997
    +++ featurefulKernel/linux/drivers/net/Config.in Wed Jul 16 19:24:05 1997
    @@ -151,12 +151,6 @@
    bool 'Soundmodem support for 2400 baud AFSK modulation (8MHz crystal)' CONFIG_SOUNDMODEM_AFSK2400_8
    bool 'Soundmodem support for 4800 baud HAPN-1 modulation' CONFIG_SOUNDMODEM_HAPN4800
    bool 'Soundmodem support for 9600 baud FSK G3RUH modulation' CONFIG_SOUNDMODEM_FSK9600
    - if [ -f drivers/net/soundmodem/sm_afsk2666.c ]; then
    - bool 'Soundmodem support for 2666 baud AFSK modulation' CONFIG_SOUNDMODEM_AFSK2666
    - fi
    - if [ -f drivers/net/soundmodem/sm_psk4800.c ]; then
    - bool 'Soundmodem support for 4800 baud PSK modulation' CONFIG_SOUNDMODEM_PSK4800
    - fi
    fi
    fi
    tristate 'STRIP (Metricom starmode radio IP)' CONFIG_STRIP
    diff -ur 2.1.45-7/linux/fs/fat/cache.c featurefulKernel/linux/fs/fat/cache.c
    --- 2.1.45-7/linux/fs/fat/cache.c Sat Dec 21 13:24:02 1996
    +++ featurefulKernel/linux/fs/fat/cache.c Wed Jul 16 20:24:51 1997
    @@ -280,7 +280,7 @@
    12 ? EOF_FAT12 : EOF_FAT16);
    else {
    MSDOS_I(inode)->i_start = 0;
    - inode->i_dirt = 1;
    + mark_inode_dirty(inode);
    }
    lock_fat(inode->i_sb);
    while (nr != -1) {
    diff -ur 2.1.45-7/linux/fs/fat/file.c featurefulKernel/linux/fs/fat/file.c
    --- 2.1.45-7/linux/fs/fat/file.c Tue Jun 17 01:35:57 1997
    +++ featurefulKernel/linux/fs/fat/file.c Wed Jul 16 20:27:34 1997
    @@ -52,6 +52,7 @@
    NULL, /* mknod */
    NULL, /* rename */
    NULL, /* readlink */
    + NULL, /* follow link */
    generic_readpage, /* readpage */
    NULL, /* writepage */
    fat_bmap, /* bmap */
    @@ -99,6 +100,7 @@
    NULL, /* mknod */
    NULL, /* rename */
    NULL, /* readlink */
    + NULL, /* followlink */
    NULL, /* readpage */
    NULL, /* writepage */
    NULL, /* bmap */
    @@ -355,7 +357,7 @@
    filp->f_pos += written;
    if (filp->f_pos > inode->i_size) {
    inode->i_size = filp->f_pos;
    - inode->i_dirt = 1;
    + mark_inode_dirty(inode);
    }
    fat_set_uptodate(sb, bh, 1);
    fat_mark_buffer_dirty(sb, bh, 0);
    @@ -365,7 +367,7 @@
    return error;
    inode->i_mtime = inode->i_ctime = CURRENT_TIME;
    MSDOS_I(inode)->i_attrs |= ATTR_ARCH;
    - inode->i_dirt = 1;
    + mark_inode_dirty(inode);
    return buf-start;
    }

    @@ -379,5 +381,5 @@
    cluster = SECTOR_SIZE*MSDOS_SB(inode->i_sb)->cluster_size;
    (void) fat_free(inode,(inode->i_size+(cluster-1))/cluster);
    MSDOS_I(inode)->i_attrs |= ATTR_ARCH;
    - inode->i_dirt = 1;
    + mark_inode_dirty(inode);
    }
    diff -ur 2.1.45-7/linux/fs/fat/inode.c featurefulKernel/linux/fs/fat/inode.c
    --- 2.1.45-7/linux/fs/fat/inode.c Mon Apr 7 20:35:30 1997
    +++ featurefulKernel/linux/fs/fat/inode.c Wed Jul 16 20:43:39 1997
    @@ -329,7 +329,7 @@
    MSDOS_SB(sb)->fat_lock = 0;
    MSDOS_SB(sb)->prev_free = 0;
    memcpy(&(MSDOS_SB(sb)->options), &opts, sizeof(struct fat_mount_options));
    - if (!(sb->s_mounted = iget(sb,MSDOS_ROOT_INO))) {
    + if (!(sb->s_root = d_alloc_root(iget(sb,MSDOS_ROOT_INO), NULL))) {
    sb->s_dev = 0;
    printk("get root inode failed\n");
    MOD_DEC_USE_COUNT;
    @@ -339,7 +339,7 @@
    }


    -void fat_statfs(struct super_block *sb,struct statfs *buf, int bufsiz)
    +int fat_statfs(struct super_block *sb,struct statfs *buf, int bufsiz)
    {
    int free,nr;
    struct statfs tmp;
    @@ -362,7 +362,7 @@
    tmp.f_files = 0;
    tmp.f_ffree = 0;
    tmp.f_namelen = 12;
    - copy_to_user(buf, &tmp, bufsiz);
    + return copy_to_user(buf, &tmp, bufsiz);
    }


    @@ -514,10 +514,9 @@
    linked->i_blocks = inode->i_blocks;
    linked->i_atime = inode->i_atime;
    MSDOS_I(linked)->i_attrs = MSDOS_I(inode)->i_attrs;
    - linked->i_dirt = 1;
    + mark_inode_dirty(linked);
    }

    - inode->i_dirt = 0;
    if (inode->i_ino == MSDOS_ROOT_INO || !inode->i_nlink) return;
    if (!(bh = fat_bread(sb, inode->i_ino >> MSDOS_DPB_BITS))) {
    printk("dev = %s, ino = %ld\n",
    diff -ur 2.1.45-7/linux/fs/fat/misc.c featurefulKernel/linux/fs/fat/misc.c
    --- 2.1.45-7/linux/fs/fat/misc.c Thu Jul 3 22:18:33 1997
    +++ featurefulKernel/linux/fs/fat/misc.c Wed Jul 16 20:32:38 1997
    @@ -41,8 +41,10 @@
    not_ro = !(s->s_flags & MS_RDONLY);
    if (not_ro) s->s_flags |= MS_RDONLY;
    printk("Filesystem panic (dev %s, ", kdevname(s->s_dev));
    +#if 0
    printk("mounted on %s:%ld)\n %s\n", /* note: kdevname returns & static char[] */
    kdevname(s->s_covered->i_dev), s->s_covered->i_ino, msg);
    +#endif
    if (not_ro)
    printk(" File system has been set read-only\n");
    }
    @@ -180,7 +182,7 @@
    if (last) fat_access(sb,last,nr);
    else {
    MSDOS_I(inode)->i_start = nr;
    - inode->i_dirt = 1;
    + mark_inode_dirty(inode);
    }
    #ifdef DEBUG
    if (last) printk("next set to %d\n",fat_access(sb,last,-1));
    @@ -217,7 +219,7 @@
    #ifdef DEBUG
    printk("size is %d now (%x)\n",inode->i_size,inode);
    #endif
    - inode->i_dirt = 1;
    + mark_inode_dirty(inode);
    }
    return 0;
    }
    diff -ur 2.1.45-7/linux/fs/fat/mmap.c featurefulKernel/linux/fs/fat/mmap.c
    --- 2.1.45-7/linux/fs/fat/mmap.c Tue Jun 17 01:35:57 1997
    +++ featurefulKernel/linux/fs/fat/mmap.c Wed Jul 16 20:36:39 1997
    @@ -29,7 +29,7 @@
    unsigned long address,
    int error_code)
    {
    - struct inode * inode = area->vm_inode;
    + struct inode * inode = area->vm_dentry->d_inode;
    unsigned long page;
    unsigned int clear;
    int pos;
    @@ -101,11 +101,10 @@
    return -EACCES;
    if (!IS_RDONLY(inode)) {
    inode->i_atime = CURRENT_TIME;
    - inode->i_dirt = 1;
    + mark_inode_dirty(inode);
    }

    - vma->vm_inode = inode;
    - atomic_inc(&inode->i_count);
    + vma->vm_dentry = dget(file->f_dentry);
    vma->vm_ops = &fat_file_mmap;
    return 0;
    }
    diff -ur 2.1.45-7/linux/fs/msdos/namei.c featurefulKernel/linux/fs/msdos/namei.c
    --- 2.1.45-7/linux/fs/msdos/namei.c Tue Jun 17 01:35:57 1997
    +++ featurefulKernel/linux/fs/msdos/namei.c Wed Jul 16 21:34:56 1997
    @@ -190,8 +190,8 @@
    }

    /***** Get inode using directory and name */
    -int msdos_lookup(struct inode *dir,const char *name,int len,
    - struct inode **result)
    +int msdos_lookup(struct inode *dir, struct qstr *name,
    + struct inode **result)
    {
    struct super_block *sb = dir->i_sb;
    int ino,res;
    @@ -203,45 +203,39 @@

    *result = NULL;
    if (!dir) return -ENOENT;
    - if (!S_ISDIR(dir->i_mode)) {
    - iput(dir);
    + if (!S_ISDIR(dir->i_mode))
    return -ENOENT;
    - }
    +
    PRINTK (("msdos_lookup 2\n"));
    - if (len == 1 && name[0] == '.') {
    + if (name->len == 1 && name->name[0] == '.') {
    *result = dir;
    return 0;
    }
    - if (len == 2 && name[0] == '.' && name[1] == '.') {
    + if (name->len == 2 && name->name[0] == '.' && name->name[1] == '.') {
    ino = fat_parent_ino(dir,0);
    - iput(dir);
    if (ino < 0) return ino;
    if (!(*result = iget(dir->i_sb,ino))) return -EACCES;
    return 0;
    }
    PRINTK (("msdos_lookup 3\n"));
    - if ((res = msdos_find(dir,name,len,&bh,&de,&ino)) < 0) {
    - iput(dir);
    + if ((res = msdos_find(dir,name->name,name->len,&bh,&de,&ino)) < 0)
    return res;
    - }
    +
    PRINTK (("msdos_lookup 4\n"));
    if (bh)
    fat_brelse(sb, bh);
    PRINTK (("msdos_lookup 4.5\n"));
    - if (!(*result = iget(dir->i_sb,ino))) {
    - iput(dir);
    + if (!(*result = iget(dir->i_sb,ino)))
    return -EACCES;
    - }
    +
    PRINTK (("msdos_lookup 5\n"));
    if (!(*result)->i_sb ||
    - ((*result)->i_sb->s_magic != MSDOS_SUPER_MAGIC)) {
    + ((*result)->i_sb->s_magic != MSDOS_SUPER_MAGIC))
    /* crossed a mount point into a non-msdos fs */
    - iput(dir);
    return 0;
    - }
    +
    if (MSDOS_I(*result)->i_busy) { /* mkdir in progress */
    iput(*result);
    - iput(dir);
    return -ENOENT;
    }
    PRINTK (("msdos_lookup 6\n"));
    @@ -255,7 +249,6 @@
    }
    }
    PRINTK (("msdos_lookup 7\n"));
    - iput(dir);
    PRINTK (("msdos_lookup 8\n"));
    return 0;
    }
    @@ -280,7 +273,7 @@
    * XXX all times should be set by caller upon successful completion.
    */
    dir->i_ctime = dir->i_mtime = CURRENT_TIME;
    - dir->i_dirt = 1;
    + mark_inode_dirty(dir);
    memcpy(de->name,name,MSDOS_NAME);
    memset(de->unused, 0, sizeof(de->unused));
    de->attr = is_dir ? ATTR_DIR : ATTR_ARCH;
    @@ -295,28 +288,28 @@
    if (!*result) return -EIO;
    (*result)->i_mtime = (*result)->i_atime = (*result)->i_ctime =
    CURRENT_TIME;
    - (*result)->i_dirt = 1;
    + mark_inode_dirty( (*result) );
    return 0;
    }

    /***** Create a file or directory */
    -int msdos_create(struct inode *dir,const char *name,int len,int mode,
    - struct inode **result)
    +int msdos_create(struct inode *dir, struct dentry * dentry,int mode)
    {
    struct super_block *sb = dir->i_sb;
    struct buffer_head *bh;
    struct msdos_dir_entry *de;
    char msdos_name[MSDOS_NAME];
    int ino,res,is_hid;
    + struct inode *result;

    if (!dir) return -ENOENT;
    if ((res = msdos_format_name(MSDOS_SB(dir->i_sb)->options.name_check,
    - name,len,msdos_name,0,
    + dentry->d_name.name,dentry->d_name.len,
    + msdos_name,0,
    MSDOS_SB(dir->i_sb)->options.dotsOK)) < 0) {
    - iput(dir);
    return res;
    }
    - is_hid = (name[0]=='.') && (msdos_name[0]!='.');
    + is_hid = (dentry->d_name.name[0]=='.') && (msdos_name[0]!='.');
    fat_lock_creation();
    /* Scan for existing file twice, so that creating a file fails
    * with -EINVAL if the other (dotfile/nondotfile) exists.
    @@ -325,19 +318,17 @@
    if (fat_scan(dir,msdos_name,&bh,&de,&ino,SCAN_HID) >= 0) {
    fat_unlock_creation();
    fat_brelse(sb, bh);
    - iput(dir);
    return is_hid ? -EEXIST : -EINVAL;
    }
    if (fat_scan(dir,msdos_name,&bh,&de,&ino,SCAN_NOTHID) >= 0) {
    fat_unlock_creation();
    fat_brelse(sb, bh);
    - iput(dir);
    return is_hid ? -EINVAL : -EEXIST;
    }
    - res = msdos_create_entry(dir,msdos_name,len,S_ISDIR(mode),is_hid,
    - result);
    + res = msdos_create_entry(dir,msdos_name,0,S_ISDIR(mode),is_hid,
    + &result);
    + d_instantiate(dentry, result);
    fat_unlock_creation();
    - iput(dir);
    return res;
    }

    @@ -388,7 +379,7 @@
    }

    /***** Remove a directory */
    -int msdos_rmdir(struct inode *dir,const char *name,int len)
    +int msdos_rmdir(struct inode * dir, struct dentry *dentry)
    {
    struct super_block *sb = dir->i_sb;
    int res,ino;
    @@ -399,35 +390,36 @@
    bh = NULL;
    inode = NULL;
    res = -EPERM;
    - if (name[0] == '.' && (len == 1 || (len == 2 && name[1] == '.')))
    + if (dentry->d_name.name[0] == '.' &&
    + (dentry->d_name.len == 1 ||
    + (dentry->d_name.len == 2 && dentry->d_name.name[1] == '.')))
    goto rmdir_done;
    - if ((res = msdos_find(dir,name,len,&bh,&de,&ino)) < 0) goto rmdir_done;
    + if ((res = msdos_find(dir,
    + dentry->d_name.name,dentry->d_name.len,
    + &bh,&de,&ino)) < 0) goto rmdir_done;
    res = -ENOENT;
    - if (!(inode = iget(dir->i_sb,ino))) goto rmdir_done;
    + inode = dentry->d_inode;
    res = -ENOTDIR;
    if (!S_ISDIR(inode->i_mode)) goto rmdir_done;
    - res = -EBUSY;
    - if (dir->i_dev != inode->i_dev || dir == inode)
    - goto rmdir_done;
    res = msdos_empty(inode);
    if (res)
    goto rmdir_done;
    inode->i_nlink = 0;
    inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
    dir->i_nlink--;
    - inode->i_dirt = dir->i_dirt = 1;
    + mark_inode_dirty(inode);
    + mark_inode_dirty(dir);
    de->name[0] = DELETED_FLAG;
    fat_mark_buffer_dirty(sb, bh, 1);
    res = 0;
    + d_delete(dentry);
    rmdir_done:
    fat_brelse(sb, bh);
    - iput(dir);
    - iput(inode);
    return res;
    }

    /***** Make a directory */
    -int msdos_mkdir(struct inode *dir,const char *name,int len,int mode)
    +int msdos_mkdir(struct inode * dir, struct dentry * dentry, int mode)
    {
    struct super_block *sb = dir->i_sb;
    struct buffer_head *bh;
    @@ -437,23 +429,19 @@
    int ino,res,is_hid;

    if ((res = msdos_format_name(MSDOS_SB(dir->i_sb)->options.name_check,
    - name,len,msdos_name,0,
    - MSDOS_SB(dir->i_sb)->options.dotsOK)) < 0) {
    - iput(dir);
    + dentry->d_name.name,dentry->d_name.len,msdos_name,0,
    + MSDOS_SB(dir->i_sb)->options.dotsOK)) < 0)
    return res;
    - }
    - is_hid = (name[0]=='.') && (msdos_name[0]!='.');
    + is_hid = (dentry->d_name.name[0]=='.') && (msdos_name[0]!='.');
    fat_lock_creation();
    if (fat_scan(dir,msdos_name,&bh,&de,&ino,SCAN_ANY) >= 0) {
    fat_unlock_creation();
    fat_brelse(sb, bh);
    - iput(dir);
    return -EEXIST;
    }
    - if ((res = msdos_create_entry(dir,msdos_name,len,1,is_hid,
    + if ((res = msdos_create_entry(dir,msdos_name,dentry->d_name.len,1,is_hid,
    &inode)) < 0) {
    fat_unlock_creation();
    - iput(dir);
    return res;
    }
    dir->i_nlink++;
    @@ -465,7 +453,7 @@
    dot->i_size = inode->i_size; /* doesn't grow in the 2nd create_entry */
    MSDOS_I(dot)->i_start = MSDOS_I(inode)->i_start;
    dot->i_nlink = inode->i_nlink;
    - dot->i_dirt = 1;
    + mark_inode_dirty(dot);
    iput(dot);
    if ((res = msdos_create_entry(inode,MSDOS_DOTDOT,2,1,0,&dot)) < 0)
    goto mkdir_error;
    @@ -473,15 +461,14 @@
    dot->i_size = dir->i_size;
    MSDOS_I(dot)->i_start = MSDOS_I(dir)->i_start;
    dot->i_nlink = dir->i_nlink;
    - dot->i_dirt = 1;
    + mark_inode_dirty(dot);
    MSDOS_I(inode)->i_busy = 0;
    iput(dot);
    - iput(inode);
    - iput(dir);
    + d_instantiate(dentry, inode);
    return 0;
    mkdir_error:
    iput(inode);
    - if (msdos_rmdir(dir,name,len) < 0)
    + if (msdos_rmdir(dir,dentry) < 0)
    fat_fs_panic(dir->i_sb,"rmdir in mkdir failed");
    fat_unlock_creation();
    return res;
    @@ -492,6 +479,7 @@
    struct inode *dir,
    const char *name,
    int len,
    + struct dentry *dentry,
    int nospc) /* Flag special file ? */
    {
    struct super_block *sb = dir->i_sb;
    @@ -504,10 +492,7 @@
    inode = NULL;
    if ((res = msdos_find(dir,name,len,&bh,&de,&ino)) < 0)
    goto unlink_done;
    - if (!(inode = iget(dir->i_sb,ino))) {
    - res = -ENOENT;
    - goto unlink_done;
    - }
    + inode = dentry->d_inode;
    if (!S_ISREG(inode->i_mode) && nospc){
    res = -EPERM;
    goto unlink_done;
    @@ -519,26 +504,31 @@
    inode->i_nlink = 0;
    inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
    MSDOS_I(inode)->i_busy = 1;
    - inode->i_dirt = dir->i_dirt = 1;
    + mark_inode_dirty(inode);
    + mark_inode_dirty(dir);
    de->name[0] = DELETED_FLAG;
    fat_mark_buffer_dirty(sb, bh, 1);
    + fat_brelse(sb, bh);
    + d_delete(dentry);
    + return res;
    +
    unlink_done:
    fat_brelse(sb, bh);
    - iput(inode);
    - iput(dir);
    return res;
    }

    /***** Unlink, as called for msdosfs */
    -int msdos_unlink(struct inode *dir,const char *name,int len)
    +int msdos_unlink(struct inode *dir,struct dentry *dentry)
    {
    - return msdos_unlinkx (dir,name,len,1);
    + return msdos_unlinkx (dir,dentry->d_name.name,dentry->d_name.len,
    + dentry,1);
    }

    /***** Unlink, as called for umsdosfs */
    -int msdos_unlink_umsdos(struct inode *dir,const char *name,int len)
    +int msdos_unlink_umsdos(struct inode *dir,struct dentry *dentry)
    {
    - return msdos_unlinkx (dir,name,len,0);
    + return msdos_unlinkx (dir,dentry->d_name.name, dentry->d_name.len,
    + dentry,0);
    }

    /***** Rename within a directory */
    @@ -580,11 +570,11 @@
    }
    if (S_ISDIR(new_inode->i_mode)) {
    new_dir->i_nlink--;
    - new_dir->i_dirt = 1;
    + mark_inode_dirty(new_dir);
    }
    new_inode->i_nlink = 0;
    MSDOS_I(new_inode)->i_busy = 1;
    - new_inode->i_dirt = 1;
    + mark_inode_dirty(new_inode);
    new_de->name[0] = DELETED_FLAG;
    fat_mark_buffer_dirty(sb, new_bh, 1);
    iput(new_inode);
    @@ -675,7 +665,7 @@
    }
    new_inode->i_nlink = 0;
    MSDOS_I(new_inode)->i_busy = 1;
    - new_inode->i_dirt = 1;
    + mark_inode_dirty(new_inode);
    new_de->name[0] = DELETED_FLAG;
    fat_mark_buffer_dirty(sb, new_bh, 1);
    }
    @@ -696,14 +686,14 @@
    }
    if (exists && S_ISDIR(new_inode->i_mode)) {
    new_dir->i_nlink--;
    - new_dir->i_dirt = 1;
    + mark_inode_dirty(new_dir);
    }
    msdos_read_inode(free_inode);
    MSDOS_I(old_inode)->i_busy = 1;
    MSDOS_I(old_inode)->i_linked = free_inode;
    MSDOS_I(free_inode)->i_oldlink = old_inode;
    fat_cache_inval_inode(old_inode);
    - old_inode->i_dirt = 1;
    + mark_inode_dirty(old_inode);
    old_de->name[0] = DELETED_FLAG;
    fat_mark_buffer_dirty(sb, old_bh, 1);
    fat_mark_buffer_dirty(sb, free_bh, 1);
    @@ -726,7 +716,7 @@
    }
    dotdot_de->start = MSDOS_I(dotdot_inode)->i_start =
    MSDOS_I(new_dir)->i_start;
    - dotdot_inode->i_dirt = 1;
    + mark_inode_dirty(dotdot_inode);
    fat_mark_buffer_dirty(sb, dotdot_bh, 1);
    old_dir->i_nlink--;
    new_dir->i_nlink++;
    @@ -743,8 +733,8 @@
    }

    /***** Rename, a wrapper for rename_same_dir & rename_diff_dir */
    -int msdos_rename(struct inode *old_dir,const char *old_name,int old_len,
    - struct inode *new_dir,const char *new_name,int new_len)
    +int msdos_rename (struct inode * old_dir, struct dentry *old_dentry,
    + struct inode * new_dir,struct dentry *new_dentry)
    {
    struct super_block *sb = old_dir->i_sb;
    char old_msdos_name[MSDOS_NAME],new_msdos_name[MSDOS_NAME];
    @@ -754,28 +744,28 @@
    int is_hid,old_hid; /* if new file and old file are hidden */

    if ((error = msdos_format_name(MSDOS_SB(old_dir->i_sb)->options.name_check,
    - old_name,old_len,old_msdos_name,1,
    + old_dentry->d_name.name,old_dentry->d_name.len,old_msdos_name,1,
    MSDOS_SB(old_dir->i_sb)->options.dotsOK))
    < 0) goto rename_done;
    if ((error = msdos_format_name(MSDOS_SB(new_dir->i_sb)->options.name_check,
    - new_name,new_len,new_msdos_name,0,
    + new_dentry->d_name.name,new_dentry->d_name.len,new_msdos_name,0,
    MSDOS_SB(new_dir->i_sb)->options.dotsOK))
    < 0) goto rename_done;
    - is_hid = (new_name[0]=='.') && (new_msdos_name[0]!='.');
    - old_hid = (old_name[0]=='.') && (old_msdos_name[0]!='.');
    + is_hid = (new_dentry->d_name.name[0]=='.') && (new_msdos_name[0]!='.');
    + old_hid = (old_dentry->d_name.name[0]=='.') && (old_msdos_name[0]!='.');
    if ((error = fat_scan(old_dir,old_msdos_name,&old_bh,&old_de,
    &old_ino,old_hid?SCAN_HID:SCAN_NOTHID)) < 0) goto rename_done;
    fat_lock_creation();
    if (old_dir == new_dir)
    - error = rename_same_dir(old_dir,old_msdos_name,old_len,new_dir,
    - new_msdos_name,new_len,old_bh,old_de,old_ino,is_hid);
    - else error = rename_diff_dir(old_dir,old_msdos_name,old_len,new_dir,
    - new_msdos_name,new_len,old_bh,old_de,old_ino,is_hid);
    + error = rename_same_dir(old_dir,old_msdos_name,old_dentry->d_name.len,new_dir,
    + new_msdos_name,new_dentry->d_name.len,old_bh,old_de,old_ino,is_hid);
    + else error = rename_diff_dir(old_dir,old_msdos_name,old_dentry->d_name.len,new_dir,
    + new_msdos_name,new_dentry->d_name.len,old_bh,old_de,old_ino,is_hid);
    fat_unlock_creation();
    fat_brelse(sb, old_bh);
    + d_move(old_dentry, new_dentry->d_parent, &new_dentry->d_name);
    + d_delete(new_dentry);
    rename_done:
    - iput(old_dir);
    - iput(new_dir);
    return error;
    }

    @@ -793,6 +783,7 @@
    NULL, /* mknod */
    msdos_rename, /* rename */
    NULL, /* readlink */
    + NULL, /* followlink */
    NULL, /* readpage */
    NULL, /* writepage */
    fat_bmap, /* bmap */
    diff -ur 2.1.45-7/linux/include/linux/msdos_fs.h featurefulKernel/linux/include/linux/msdos_fs.h
    --- 2.1.45-7/linux/include/linux/msdos_fs.h Tue Jul 8 01:03:54 1997
    +++ featurefulKernel/linux/include/linux/msdos_fs.h Wed Jul 16 21:39:59 1997
    @@ -215,7 +215,7 @@
    extern void fat_read_inode(struct inode *inode, struct inode_operations *dir_ops);
    extern struct super_block *fat_read_super(struct super_block *s, void *data, int silent);
    extern void msdos_put_super(struct super_block *sb);
    -extern void fat_statfs(struct super_block *sb,struct statfs *buf, int);
    +extern int fat_statfs(struct super_block *sb,struct statfs *buf, int);
    extern void fat_write_inode(struct inode *inode);

    /* dir.c */
    @@ -252,16 +252,14 @@

    /* msdos.c - these are for Umsdos */
    extern void msdos_read_inode(struct inode *inode);
    -extern int msdos_lookup(struct inode *dir,const char *name,int len,
    - struct inode **result);
    -extern int msdos_create(struct inode *dir,const char *name,int len,int mode,
    - struct inode **result);
    -extern int msdos_rmdir(struct inode *dir,const char *name,int len);
    -extern int msdos_mkdir(struct inode *dir,const char *name,int len,int mode);
    -extern int msdos_unlink(struct inode *dir,const char *name,int len);
    -extern int msdos_unlink_umsdos(struct inode *dir,const char *name,int len);
    -extern int msdos_rename(struct inode *old_dir,const char *old_name,int old_len,
    - struct inode *new_dir,const char *new_name,int new_len);
    +extern int msdos_lookup(struct inode * dir, struct qstr *name, struct inode ** result);
    +extern int msdos_create(struct inode * dir, struct dentry * dentry, int mode);
    +extern int msdos_rmdir(struct inode * dir, struct dentry *dentry);
    +extern int msdos_mkdir(struct inode * dir, struct dentry * dentry, int mode);
    +extern int msdos_unlink(struct inode * dir, struct dentry *dentry);
    +extern int msdos_unlink_umsdos(struct inode * dir, struct dentry *dentry);
    +extern int msdos_rename(struct inode * old_dir, struct dentry *old_dentry,
    + struct inode * new_dir,struct dentry *new_dentry);

    /* fatfs_syms.c */
    extern int init_fat_fs(void);
    diff -ur 2.1.45-7/linux/kernel/ksyms.c featurefulKernel/linux/kernel/ksyms.c
    --- 2.1.45-7/linux/kernel/ksyms.c Wed Jul 16 23:27:14 1997
    +++ featurefulKernel/linux/kernel/ksyms.c Wed Jul 16 23:24:42 1997
    @@ -143,6 +143,10 @@
    EXPORT_SYMBOL(__fput);
    EXPORT_SYMBOL(iget);
    EXPORT_SYMBOL(iput);
    +EXPORT_SYMBOL(dput);
    +EXPORT_SYMBOL(d_move);
    +EXPORT_SYMBOL(d_instantiate);
    +EXPORT_SYMBOL(__mark_inode_dirty);
    EXPORT_SYMBOL(__namei);
    EXPORT_SYMBOL(lookup_dentry);
    EXPORT_SYMBOL(open_namei);
    \
     
     \ /
      Last update: 2005-03-22 13:39    [W:0.058 / U:123.172 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site