From: Jan Harkes Remove coda_mknod as the code was never used, coda_hasmknod was always 0. (reported by Adrian Bunk) Signed-off-by: Jan Harkes Signed-off-by: Andrew Morton --- 25-akpm/fs/coda/dir.c | 58 +++++-------------------------------- 25-akpm/fs/coda/upcall.c | 3 - 25-akpm/include/linux/coda_psdev.h | 2 - 3 files changed, 10 insertions(+), 53 deletions(-) diff -puN fs/coda/dir.c~coda-remove-unused-coda_mknod fs/coda/dir.c --- 25/fs/coda/dir.c~coda-remove-unused-coda_mknod 2005-01-10 17:29:41.127634568 -0800 +++ 25-akpm/fs/coda/dir.c 2005-01-10 17:29:41.134633504 -0800 @@ -29,7 +29,6 @@ /* dir inode-ops */ static int coda_create(struct inode *dir, struct dentry *new, int mode, struct nameidata *nd); -static int coda_mknod(struct inode *dir, struct dentry *new, int mode, dev_t rdev); static struct dentry *coda_lookup(struct inode *dir, struct dentry *target, struct nameidata *nd); static int coda_link(struct dentry *old_dentry, struct inode *dir_inode, struct dentry *entry); @@ -53,7 +52,12 @@ static int coda_venus_readdir(struct fil void *dirent, struct dentry *dir); int coda_fsync(struct file *, struct dentry *dentry, int datasync); -int coda_hasmknod; +/* same as fs/bad_inode.c */ +static int coda_return_EIO(void) +{ + return -EIO; +} +#define CODA_EIO_ERROR ((void *) (coda_return_EIO)) static struct dentry_operations coda_dentry_operations = { @@ -70,7 +74,7 @@ struct inode_operations coda_dir_inode_o .symlink = coda_symlink, .mkdir = coda_mkdir, .rmdir = coda_rmdir, - .mknod = coda_mknod, + .mknod = CODA_EIO_ERROR, .rename = coda_rename, .permission = coda_permission, .getattr = coda_getattr, @@ -208,7 +212,7 @@ static int coda_create(struct inode *dir } error = venus_create(dir->i_sb, coda_i2f(dir), name, length, - 0, mode, 0, &newfid, &attrs); + 0, mode, &newfid, &attrs); if ( error ) { unlock_kernel(); @@ -230,52 +234,6 @@ static int coda_create(struct inode *dir return 0; } -static int coda_mknod(struct inode *dir, struct dentry *de, int mode, dev_t rdev) -{ - int error=0; - const char *name=de->d_name.name; - int length=de->d_name.len; - struct inode *inode; - struct CodaFid newfid; - struct coda_vattr attrs; - - if ( coda_hasmknod == 0 ) - return -EIO; - - if (!old_valid_dev(rdev)) - return -EINVAL; - - lock_kernel(); - coda_vfs_stat.create++; - - if (coda_isroot(dir) && coda_iscontrol(name, length)) { - unlock_kernel(); - return -EPERM; - } - - error = venus_create(dir->i_sb, coda_i2f(dir), name, length, - 0, mode, rdev, &newfid, &attrs); - - if ( error ) { - unlock_kernel(); - d_drop(de); - return error; - } - - inode = coda_iget(dir->i_sb, &newfid, &attrs); - if ( IS_ERR(inode) ) { - unlock_kernel(); - d_drop(de); - return PTR_ERR(inode); - } - - /* invalidate the directory cnode's attributes */ - coda_dir_changed(dir, 0); - unlock_kernel(); - d_instantiate(de, inode); - return 0; -} - static int coda_mkdir(struct inode *dir, struct dentry *de, int mode) { struct inode *inode; diff -puN fs/coda/upcall.c~coda-remove-unused-coda_mknod fs/coda/upcall.c --- 25/fs/coda/upcall.c~coda-remove-unused-coda_mknod 2005-01-10 17:29:41.128634416 -0800 +++ 25-akpm/fs/coda/upcall.c 2005-01-10 17:29:41.135633352 -0800 @@ -331,7 +331,7 @@ int venus_rename(struct super_block *sb, } int venus_create(struct super_block *sb, struct CodaFid *dirfid, - const char *name, int length, int excl, int mode, dev_t rdev, + const char *name, int length, int excl, int mode, struct CodaFid *newfid, struct coda_vattr *attrs) { union inputArgs *inp; @@ -345,7 +345,6 @@ int venus_create(struct super_block *sb, inp->coda_create.VFid = *dirfid; inp->coda_create.attr.va_mode = mode; - inp->coda_create.attr.va_rdev = huge_encode_dev(rdev); inp->coda_create.excl = excl; inp->coda_create.mode = mode; inp->coda_create.name = offset; diff -puN include/linux/coda_psdev.h~coda-remove-unused-coda_mknod include/linux/coda_psdev.h --- 25/include/linux/coda_psdev.h~coda-remove-unused-coda_mknod 2005-01-10 17:29:41.129634264 -0800 +++ 25-akpm/include/linux/coda_psdev.h 2005-01-10 17:29:41.135633352 -0800 @@ -49,7 +49,7 @@ int venus_mkdir(struct super_block *sb, const char *name, int length, struct CodaFid *newfid, struct coda_vattr *attrs); int venus_create(struct super_block *sb, struct CodaFid *dirfid, - const char *name, int length, int excl, int mode, dev_t rdev, + const char *name, int length, int excl, int mode, struct CodaFid *newfid, struct coda_vattr *attrs) ; int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid, const char *name, int length); _