diff options
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/ufs_dir.c | 20 | ||||
-rw-r--r-- | fs/ufs/ufs_file.c | 3 | ||||
-rw-r--r-- | fs/ufs/ufs_inode.c | 7 | ||||
-rw-r--r-- | fs/ufs/ufs_super.c | 7 | ||||
-rw-r--r-- | fs/ufs/ufs_symlink.c | 76 |
5 files changed, 15 insertions, 98 deletions
diff --git a/fs/ufs/ufs_dir.c b/fs/ufs/ufs_dir.c index 26ae02abe..15396589f 100644 --- a/fs/ufs/ufs_dir.c +++ b/fs/ufs/ufs_dir.c @@ -6,7 +6,7 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_dir.c,v 1.8 1997/01/26 07:14:28 davem Exp $ + * $Id: ufs_dir.c,v 1.10 1997/06/05 01:29:06 davem Exp $ * */ @@ -108,11 +108,8 @@ revalidate: * version stamp to detect whether or * not the directory has been modified * during the copy operation. */ - unsigned long version; - dcache_add(inode, de->d_name, - ufs_swab16(de->d_namlen), - ufs_swab32(de->d_ino)); - version = inode->i_version; + unsigned long version = inode->i_version; + if (inode->i_sb->u.ufs_sb.s_flags & UFS_DEBUG) { printk("ufs_readdir: filldir(%s,%u)\n", de->d_name, ufs_swab32(de->d_ino)); @@ -166,7 +163,6 @@ struct inode_operations ufs_dir_inode_operations = { NULL, /* mknod */ NULL, /* rename */ NULL, /* readlink */ - NULL, /* follow_link */ NULL, /* readpage */ NULL, /* writepage */ NULL, /* bmap */ @@ -174,13 +170,3 @@ struct inode_operations ufs_dir_inode_operations = { NULL, /* permission */ NULL, /* smap */ }; - -/* - * Local Variables: *** - * c-indent-level: 8 *** - * c-continued-statement-offset: 8 *** - * c-brace-offset: -8 *** - * c-argdecl-indent: 0 *** - * c-label-offset: -8 *** - * End: *** - */ diff --git a/fs/ufs/ufs_file.c b/fs/ufs/ufs_file.c index 4b479a65e..74ae1a470 100644 --- a/fs/ufs/ufs_file.c +++ b/fs/ufs/ufs_file.c @@ -6,7 +6,7 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_file.c,v 1.7 1997/01/26 07:14:28 davem Exp $ + * $Id: ufs_file.c,v 1.8 1997/06/05 01:29:09 davem Exp $ * */ @@ -41,7 +41,6 @@ struct inode_operations ufs_file_inode_operations = { NULL, /* mknod */ NULL, /* rename */ NULL, /* readlink */ - NULL, /* follow_link */ generic_readpage, /* readpage */ NULL, /* writepage */ ufs_bmap, /* bmap */ diff --git a/fs/ufs/ufs_inode.c b/fs/ufs/ufs_inode.c index 0d89fd6f0..f0fdd5d5f 100644 --- a/fs/ufs/ufs_inode.c +++ b/fs/ufs/ufs_inode.c @@ -6,7 +6,7 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_inode.c,v 1.7 1996/06/01 14:56:46 ecd Exp $ + * $Id: ufs_inode.c,v 1.8 1997/06/04 08:28:28 davem Exp $ * */ @@ -18,8 +18,9 @@ void ufs_print_inode(struct inode * inode) { printk("ino %lu mode 0%6.6o lk %d uid %d gid %d" " sz %lu blks %lu cnt %u\n", - inode->i_ino, inode->i_mode, inode->i_nlink, inode->i_uid, - inode->i_gid, inode->i_size, inode->i_blocks, inode->i_count); + inode->i_ino, inode->i_mode, inode->i_nlink, inode->i_uid, + inode->i_gid, inode->i_size, inode->i_blocks, + atomic_read(&inode->i_count)); printk(" db <0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x" " 0x%x 0x%x 0x%x 0x%x>\n", inode->u.ufs_i.i_data[0], inode->u.ufs_i.i_data[1], diff --git a/fs/ufs/ufs_super.c b/fs/ufs/ufs_super.c index 44d7241ef..342722237 100644 --- a/fs/ufs/ufs_super.c +++ b/fs/ufs/ufs_super.c @@ -8,7 +8,7 @@ * * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) * - * $Id: ufs_super.c,v 1.23 1997/04/16 04:53:39 tdyas Exp $ + * $Id: ufs_super.c,v 1.24 1997/06/04 08:28:29 davem Exp $ * */ @@ -49,7 +49,10 @@ static struct super_operations ufs_super_ops = { }; static struct file_system_type ufs_fs_type = { - ufs_read_super, "ufs", 1, NULL + "ufs", + FS_REQUIRES_DEV, + ufs_read_super, + NULL }; __initfunc(int init_ufs_fs(void)) diff --git a/fs/ufs/ufs_symlink.c b/fs/ufs/ufs_symlink.c index 13d2285e6..d98f99ff7 100644 --- a/fs/ufs/ufs_symlink.c +++ b/fs/ufs/ufs_symlink.c @@ -6,7 +6,7 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_symlink.c,v 1.7 1997/01/26 07:14:29 davem Exp $ + * $Id: ufs_symlink.c,v 1.9 1997/06/05 01:29:11 davem Exp $ * */ @@ -30,10 +30,6 @@ ufs_readlink(struct inode * inode, char * buffer, int buflen) inode->i_ino, MAJOR(inode->i_dev), MINOR(inode->i_dev)); } - if (!S_ISLNK(inode->i_mode)) { - iput (inode); - return -EINVAL; - } if (buflen > inode->i_sb->s_blocksize - 1) buflen = inode->i_sb->s_blocksize - 1; if (inode->i_blocks) { @@ -67,73 +63,6 @@ ufs_readlink(struct inode * inode, char * buffer, int buflen) return i; } -/* - * XXX - blatantly stolen from ext2fs - */ -static int -ufs_follow_link(struct inode * dir, struct inode * inode, - int flag, int mode, struct inode ** res_inode) -{ - unsigned long int block; - int error; - struct buffer_head * bh; - char * link; - - bh = NULL; - - if (inode->i_sb->u.ufs_sb.s_flags & (UFS_DEBUG|UFS_DEBUG_LINKS)) { - printk("ufs_follow_link: called on ino %lu dev %u/%u\n", - dir->i_ino, MAJOR(dir->i_dev), MINOR(dir->i_dev)); - } - - *res_inode = NULL; - if (!dir) { - dir = current->fs->root; - dir->i_count++; - } - if (!inode) { - iput (dir); - return -ENOENT; - } - if (!S_ISLNK(inode->i_mode)) { - iput (dir); - *res_inode = inode; - return 0; - } - if (current->link_count > 5) { - iput (dir); - iput (inode); - return -ELOOP; - } - if (inode->i_blocks) { - /* read the link from disk */ - /* XXX - error checking */ - block = ufs_bmap(inode, 0); - bh = bread(inode->i_dev, block, BLOCK_SIZE); - if (bh == NULL) { - printk("ufs_follow_link: can't read block 0 for ino %lu on dev %u/%u\n", - inode->i_ino, MAJOR(inode->i_dev), - MINOR(inode->i_dev)); - iput(dir); - iput(inode); - return(-EIO); - } - link = bh->b_data; - } else { - /* fast symlink */ - link = (char *)&(inode->u.ufs_i.i_data[0]); - } - current->link_count++; - error = open_namei (link, flag, mode, res_inode, dir); - current->link_count--; - iput (inode); - if (bh) { - brelse (bh); - } - return(error); -} - - static struct file_operations ufs_symlink_operations = { NULL, /* lseek */ NULL, /* read */ @@ -161,8 +90,7 @@ struct inode_operations ufs_symlink_inode_operations = { NULL, /* rmdir */ NULL, /* mknod */ NULL, /* rename */ - &ufs_readlink, /* readlink */ - &ufs_follow_link, /* follow_link */ + ufs_readlink, /* readlink */ NULL, /* readpage */ NULL, /* writepage */ NULL, /* bmap */ |