summaryrefslogtreecommitdiffstats
path: root/fs/coda
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-13 20:55:15 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-13 20:55:15 +0000
commit1471f525455788c20b130690e0f104df451aeb43 (patch)
tree3778beba56558beb9a9548ea5b467e9c44ea966f /fs/coda
parente80d2c5456d30ebba5b0eb8a9d33e17d815d4d83 (diff)
Merge with Linux 2.3.51.
Diffstat (limited to 'fs/coda')
-rw-r--r--fs/coda/dir.c2
-rw-r--r--fs/coda/inode.c46
2 files changed, 13 insertions, 35 deletions
diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index 8e25fccd6..1e39811e6 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -451,7 +451,7 @@ int coda_rmdir(struct inode *dir, struct dentry *de)
dircnp = ITOC(dir);
- if (!list_empty(&de->d_hash))
+ if (!d_unhashed(de))
return -EBUSY;
error = venus_rmdir(dir->i_sb, &(dircnp->c_fid), name, len);
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 1f82ef5bd..7f163acf9 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -37,8 +37,7 @@ static void coda_read_inode(struct inode *);
static void coda_put_inode(struct inode *);
static void coda_delete_inode(struct inode *);
static void coda_put_super(struct super_block *);
-static int coda_statfs(struct super_block *sb, struct statfs *buf,
- int bufsiz);
+static int coda_statfs(struct super_block *sb, struct statfs *buf);
/* exported operations */
struct super_operations coda_super_operations =
@@ -61,16 +60,13 @@ static struct super_block * coda_read_super(struct super_block *sb,
int error;
ENTRY;
- MOD_INC_USE_COUNT;
vc = &coda_upc_comm;
sbi = &coda_super_info;
if ( sbi->sbi_sb ) {
printk("Already mounted\n");
- unlock_super(sb);
EXIT;
- MOD_DEC_USE_COUNT;
return NULL;
}
@@ -80,7 +76,6 @@ static struct super_block * coda_read_super(struct super_block *sb,
INIT_LIST_HEAD(&(sbi->sbi_cchead));
INIT_LIST_HEAD(&(sbi->sbi_volroothead));
- lock_super(sb);
sb->u.generic_sbp = sbi;
sb->s_blocksize = 1024; /* XXXXX what do we put here?? */
sb->s_blocksize_bits = 10;
@@ -93,7 +88,6 @@ static struct super_block * coda_read_super(struct super_block *sb,
if ( error ) {
printk("coda_read_super: coda_get_rootfid failed with %d\n",
error);
- sb->s_dev = 0;
goto error;
}
printk("coda_read_super: rootfid is %s\n", coda_f2s(&fid));
@@ -102,7 +96,6 @@ static struct super_block * coda_read_super(struct super_block *sb,
error = coda_cnode_make(&root, &fid, sb);
if ( error || !root ) {
printk("Failure of coda_cnode_make for root: error %d\n", error);
- sb->s_dev = 0;
goto error;
}
@@ -110,14 +103,11 @@ static struct super_block * coda_read_super(struct super_block *sb,
root->i_ino, root->i_dev);
sbi->sbi_root = root;
sb->s_root = d_alloc_root(root);
- unlock_super(sb);
EXIT;
return sb;
error:
- unlock_super(sb);
EXIT;
- MOD_DEC_USE_COUNT;
if (sbi) {
sbi->sbi_vcomm = NULL;
sbi->sbi_root = NULL;
@@ -126,7 +116,6 @@ static struct super_block * coda_read_super(struct super_block *sb,
if (root) {
iput(root);
}
- sb->s_dev = 0;
return NULL;
}
@@ -136,15 +125,12 @@ static void coda_put_super(struct super_block *sb)
ENTRY;
-
- sb->s_dev = 0;
coda_cache_clear_all(sb);
sb_info = coda_sbp(sb);
coda_super_info.sbi_sb = NULL;
printk("Coda: Bye bye.\n");
memset(sb_info, 0, sizeof(* sb_info));
- MOD_DEC_USE_COUNT;
EXIT;
}
@@ -235,31 +221,25 @@ int coda_notify_change(struct dentry *de, struct iattr *iattr)
return error;
}
-static int coda_statfs(struct super_block *sb, struct statfs *buf,
- int bufsiz)
+static int coda_statfs(struct super_block *sb, struct statfs *buf)
{
- struct statfs tmp;
int error;
- memset(&tmp, 0, sizeof(struct statfs));
-
- error = venus_statfs(sb, &tmp);
+ error = venus_statfs(sb, buf);
if (error) {
/* fake something like AFS does */
- tmp.f_blocks = 9000000;
- tmp.f_bfree = 9000000;
- tmp.f_bavail = 9000000;
- tmp.f_files = 9000000;
- tmp.f_ffree = 9000000;
+ buf->f_blocks = 9000000;
+ buf->f_bfree = 9000000;
+ buf->f_bavail = 9000000;
+ buf->f_files = 9000000;
+ buf->f_ffree = 9000000;
}
/* and fill in the rest */
- tmp.f_type = CODA_SUPER_MAGIC;
- tmp.f_bsize = 1024;
- tmp.f_namelen = CODA_MAXNAMLEN;
-
- copy_to_user(buf, &tmp, bufsiz);
+ buf->f_type = CODA_SUPER_MAGIC;
+ buf->f_bsize = 1024;
+ buf->f_namelen = CODA_MAXNAMLEN;
return 0;
}
@@ -267,9 +247,7 @@ static int coda_statfs(struct super_block *sb, struct statfs *buf,
/* init_coda: used by filesystems.c to register coda */
-struct file_system_type coda_fs_type = {
- "coda", 0, coda_read_super, NULL
-};
+DECLARE_FSTYPE( coda_fs_type, "coda", coda_read_super, 0);
int init_coda_fs(void)
{