mtd/fs/jffs2/ecos/src dir-ecos.c,1.7,1.8 fs-ecos.c,1.21,1.22
jffs2port.h,1.10,1.11
David Woodhouse
dwmw2 at infradead.org
Wed Nov 26 08:28:13 EST 2003
Update of /home/cvs/mtd/fs/jffs2/ecos/src
In directory phoenix.infradead.org:/tmp/cvs-serv5755
Modified Files:
dir-ecos.c fs-ecos.c jffs2port.h
Log Message:
Rename iget and iput
Index: dir-ecos.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/dir-ecos.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- dir-ecos.c 25 Nov 2003 11:25:48 -0000 1.7
+++ dir-ecos.c 26 Nov 2003 13:28:10 -0000 1.8
@@ -50,9 +50,9 @@
ino = fd->ino;
up(&dir_f->sem);
if (ino) {
- inode = iget(dir_i->i_sb, ino);
+ inode = jffs2_iget(dir_i->i_sb, ino);
if (!inode) {
- printk("iget() failed for ino #%u\n", ino);
+ printk("jffs2_iget() failed for ino #%u\n", ino);
return (ERR_PTR(-EIO));
}
}
@@ -97,7 +97,7 @@
if (ret) {
inode->i_nlink = 0;
- iput(inode);
+ jffs2_iput(inode);
jffs2_free_raw_inode(ri);
return ret;
}
@@ -204,7 +204,7 @@
up(&f->sem);
jffs2_complete_reservation(c);
inode->i_nlink = 0;
- iput(inode);
+ jffs2_iput(inode);
return PTR_ERR(fn);
}
/* No data here. Only a metadata node, which will be
@@ -218,7 +218,7 @@
if (ret) {
/* Eep. */
inode->i_nlink = 0;
- iput(inode);
+ jffs2_iput(inode);
return ret;
}
@@ -227,7 +227,7 @@
/* Argh. Now we treat it like a normal delete */
jffs2_complete_reservation(c);
inode->i_nlink = 0;
- iput(inode);
+ jffs2_iput(inode);
return -ENOMEM;
}
@@ -258,7 +258,7 @@
as if it were the final unlink() */
up(&dir_f->sem);
inode->i_nlink = 0;
- iput(inode);
+ jffs2_iput(inode);
return PTR_ERR(fd);
}
@@ -267,7 +267,7 @@
jffs2_add_fd_to_list(c, fd, &dir_f->dents);
up(&dir_f->sem);
- iput(inode);
+ jffs2_iput(inode);
return 0;
}
Index: fs-ecos.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/fs-ecos.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- fs-ecos.c 26 Nov 2003 13:23:30 -0000 1.21
+++ fs-ecos.c 26 Nov 2003 13:28:10 -0000 1.22
@@ -345,7 +345,7 @@
/* We're done with it, although it we found a subdir that
will have caused the refcount to have been increased */
- iput(d->dir);
+ jffs2_iput(d->dir);
// Update dirsearch object to search next directory.
d->dir = d->node;
@@ -475,7 +475,7 @@
return -err;
D1(printk(KERN_DEBUG "jffs2_read_super(): Getting root inode\n"));
- sb->s_root = iget(sb, 1);
+ sb->s_root = jffs2_iget(sb, 1);
if (IS_ERR(sb->s_root)) {
D1(printk(KERN_WARNING "get root inode failed\n"));
err = PTR_ERR(sb->s_root);
@@ -612,14 +612,14 @@
we should allow chdir(NULL) to unset
cyg_cdir_dir? */
cyg_cdir_dir = CYG_DIR_NULL;
- iput(root);
+ jffs2_iput(root);
}
if (root->i_count != 1) {
printf("Ino #1 has use count %d\n",
root->i_count);
return EBUSY;
}
- iput(root); // Time to free the root inode
+ jffs2_iput(root); // Time to free the root inode
free(root);
//Clear root inode
//root_i = NULL;
@@ -700,21 +700,21 @@
// must fail the open.
if ((mode & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) {
- iput(ds.node);
+ jffs2_iput(ds.node);
err = EEXIST;
} else
node = ds.node;
}
// Finished with the directory now
- iput(ds.dir);
+ jffs2_iput(ds.dir);
if (err != ENOERR)
return err;
// Check that we actually have a file here
if (S_ISDIR(node->i_mode)) {
- iput(node);
+ jffs2_iput(node);
return EISDIR;
}
@@ -760,14 +760,14 @@
err = jffs2_find(&ds);
if (err != ENOERR) {
- iput(ds.dir);
+ jffs2_iput(ds.dir);
return err;
}
// Cannot unlink directories, use rmdir() instead
if (S_ISDIR(ds.node->i_mode)) {
- iput(ds.dir);
- iput(ds.node);
+ jffs2_iput(ds.dir);
+ jffs2_iput(ds.node);
return EPERM;
}
@@ -787,8 +787,8 @@
this.hash = end_name_hash(hash);
err = jffs2_unlink(ds.dir, ds.node, &this);
- iput(ds.dir);
- iput(ds.node);
+ jffs2_iput(ds.dir);
+ jffs2_iput(ds.node);
return -err;
}
@@ -837,11 +837,11 @@
} else {
// If there we no error, something already exists with that
// name, so we cannot create another one.
- iput(ds.node);
+ jffs2_iput(ds.node);
if (err == ENOERR)
err = EEXIST;
}
- iput(ds.dir);
+ jffs2_iput(ds.dir);
return err;
}
@@ -865,14 +865,14 @@
err = jffs2_find(&ds);
if (err != ENOERR) {
- iput(ds.dir);
+ jffs2_iput(ds.dir);
return err;
}
// Check that this is actually a directory.
if (!S_ISDIR(ds.node->i_mode)) {
- iput(ds.dir);
- iput(ds.node);
+ jffs2_iput(ds.dir);
+ jffs2_iput(ds.node);
return EPERM;
}
@@ -892,8 +892,8 @@
err = jffs2_rmdir(ds.dir, ds.node, &this);
- iput(ds.dir);
- iput(ds.node);
+ jffs2_iput(ds.dir);
+ jffs2_iput(ds.node);
return -err;
}
@@ -918,7 +918,7 @@
err = jffs2_find(&ds1);
if (err != ENOERR) {
- iput(ds1.dir);
+ jffs2_iput(ds1.dir);
return err;
}
@@ -933,9 +933,9 @@
}
if (err != ENOERR) {
- iput(ds1.dir);
- iput(ds1.node);
- iput(ds2.dir);
+ jffs2_iput(ds1.dir);
+ jffs2_iput(ds1.node);
+ jffs2_iput(ds2.dir);
return err;
}
@@ -1005,11 +1005,11 @@
ds1.dir->i_mtime =
ds2.dir->i_ctime = ds2.dir->i_mtime = cyg_timestamp();
out:
- iput(ds1.dir);
- iput(ds1.node);
- iput(ds2.dir);
+ jffs2_iput(ds1.dir);
+ jffs2_iput(ds1.node);
+ jffs2_iput(ds2.dir);
if (ds2.node)
- iput(ds2.node);
+ jffs2_iput(ds2.node);
return -err;
}
@@ -1039,7 +1039,7 @@
err = jffs2_find(&ds1);
if (err != ENOERR) {
- iput(ds1.dir);
+ jffs2_iput(ds1.dir);
return err;
}
@@ -1049,24 +1049,24 @@
// Don't allow links to existing objects
if (err == ENOERR) {
- iput(ds1.dir);
- iput(ds1.node);
- iput(ds2.dir);
- iput(ds2.node);
+ jffs2_iput(ds1.dir);
+ jffs2_iput(ds1.node);
+ jffs2_iput(ds2.dir);
+ jffs2_iput(ds2.node);
return EEXIST;
}
// Allow through links to non-existing terminal objects
if (ds2.last && err == ENOENT) {
- iput(ds2.node);
+ jffs2_iput(ds2.node);
ds2.node = NULL;
err = ENOERR;
}
if (err != ENOERR) {
- iput(ds1.dir);
- iput(ds1.node);
- iput(ds2.dir);
+ jffs2_iput(ds1.dir);
+ jffs2_iput(ds1.node);
+ jffs2_iput(ds2.dir);
return err;
}
@@ -1092,9 +1092,9 @@
ds1.node->i_ctime =
ds2.dir->i_ctime = ds2.dir->i_mtime = cyg_timestamp();
- iput(ds1.dir);
- iput(ds1.node);
- iput(ds2.dir);
+ jffs2_iput(ds1.dir);
+ jffs2_iput(ds1.node);
+ jffs2_iput(ds2.dir);
return -err;
}
@@ -1115,14 +1115,14 @@
err = jffs2_find(&ds);
- iput(ds.dir);
+ jffs2_iput(ds.dir);
if (err != ENOERR)
return err;
// check it is really a directory.
if (!S_ISDIR(ds.node->i_mode)) {
- iput(ds.node);
+ jffs2_iput(ds.node);
return ENOTDIR;
}
@@ -1158,7 +1158,7 @@
init_dirsearch(&ds, (struct _inode *) dir, name);
err = jffs2_find(&ds);
- iput(ds.dir);
+ jffs2_iput(ds.dir);
if (err != ENOERR)
return err;
@@ -1177,7 +1177,7 @@
struct _inode *node = (struct _inode *) dir;
// Just decrement directory reference count.
- iput(node);
+ jffs2_iput(node);
}
return ENOERR;
@@ -1198,7 +1198,7 @@
init_dirsearch(&ds, (struct _inode *) dir, name);
err = jffs2_find(&ds);
- iput(ds.dir);
+ jffs2_iput(ds.dir);
if (err != ENOERR)
return err;
@@ -1215,7 +1215,7 @@
buf->st_mtime = ds.node->i_mtime;
buf->st_ctime = ds.node->i_ctime;
- iput(ds.node);
+ jffs2_iput(ds.node);
return ENOERR;
}
@@ -1235,7 +1235,7 @@
init_dirsearch(&ds, (struct _inode *) dir, name);
err = jffs2_find(&ds);
- iput(ds.dir);
+ jffs2_iput(ds.dir);
if (err != ENOERR)
return err;
@@ -1249,7 +1249,7 @@
err = EINVAL;
}
- iput(ds.node);
+ jffs2_iput(ds.node);
return err;
}
@@ -1537,7 +1537,7 @@
D2(printf("jffs2_fo_close\n"));
- iput(node);
+ jffs2_iput(node);
fp->f_data = 0; // zero data pointer
@@ -1783,7 +1783,7 @@
return inode;
}
-struct _inode *ilookup(struct super_block *sb, cyg_uint32 ino)
+static struct _inode *ilookup(struct super_block *sb, cyg_uint32 ino)
{
struct _inode *inode = NULL;
@@ -1799,7 +1799,7 @@
return inode;
}
-struct _inode *iget(struct super_block *sb, cyg_uint32 ino)
+struct _inode *jffs2_iget(struct super_block *sb, cyg_uint32 ino)
{
// Called in super.c jffs2_read_super, dir.c jffs2_lookup,
// and gc.c jffs2_garbage_collect_pass
@@ -1810,7 +1810,7 @@
struct _inode *inode;
int err;
- D2(printf("iget\n"));
+ D2(printf("jffs2_iget\n"));
inode = ilookup(sb, ino);
if (inode)
@@ -1826,7 +1826,7 @@
err = jffs2_read_inode(inode);
if (err) {
printf("jffs2_read_inode() failed\n");
- iput(inode);
+ jffs2_iput(inode);
inode = NULL;
return ERR_PTR(err);
}
@@ -1837,7 +1837,7 @@
// Decrement the reference count on an inode. If this makes the ref count
// zero, then this inode can be freed.
-void iput(struct _inode *i)
+void jffs2_iput(struct _inode *i)
{
// Called in jffs2_find
// (and jffs2_open and jffs2_ops_mkdir?)
@@ -1845,7 +1845,7 @@
// and gc.c jffs2_garbage_collect_pass
recurse:
if (!i) {
- printf("iput() called with NULL inode\n");
+ printf("jffs2_iput() called with NULL inode\n");
// and let it fault...
}
@@ -2079,7 +2079,7 @@
ri->mode = cpu_to_jemode(mode);
ret = jffs2_do_new_inode (c, f, mode, ri);
if (ret) {
- iput(inode);
+ jffs2_iput(inode);
return ERR_PTR(ret);
}
inode->i_nlink = 1;
@@ -2135,7 +2135,7 @@
void jffs2_gc_release_inode(struct jffs2_sb_info *c,
struct jffs2_inode_info *f)
{
- iput(OFNI_EDONI_2SFFJ(f));
+ jffs2_iput(OFNI_EDONI_2SFFJ(f));
}
struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c,
@@ -2146,13 +2146,13 @@
if (!nlink) {
/* The inode has zero nlink but its nodes weren't yet marked
obsolete. This has to be because we're still waiting for
- the final (close() and) iput() to happen.
+ the final (close() and) jffs2_iput() to happen.
- There's a possibility that the final iput() could have
+ There's a possibility that the final jffs2_iput() could have
happened while we were contemplating. In order to ensure
that we don't cause a new read_inode() (which would fail)
for the inode in question, we use ilookup() in this case
- instead of iget().
+ instead of jffs2_iget().
The nlink can't _become_ zero at this point because we're
holding the alloc_sem, and jffs2_do_unlink() would also
@@ -2184,9 +2184,9 @@
} else {
/* Inode has links to it still; they're not going away because
jffs2_do_unlink() would need the alloc_sem and we have it.
- Just iget() it, and if read_inode() is necessary that's OK.
+ Just jffs2_iget() it, and if read_inode() is necessary that's OK.
*/
- inode = iget(OFNI_BS_2SFFJ(c), inum);
+ inode = jffs2_iget(OFNI_BS_2SFFJ(c), inum);
if (IS_ERR(inode))
return (void *)inode;
}
Index: jffs2port.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/jffs2port.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- jffs2port.h 26 Nov 2003 13:23:30 -0000 1.10
+++ jffs2port.h 26 Nov 2003 13:28:10 -0000 1.11
@@ -86,9 +86,8 @@
#define MAJOR(rdev) (rdev)>>8
#define MINOR(rdev) (rdev)
-struct _inode * ilookup(struct super_block *sb, cyg_uint32 ino);
-struct _inode * iget(struct super_block *sb, cyg_uint32 ino);
-void iput(struct _inode * i);
+struct _inode *jffs2_iget(struct super_block *sb, cyg_uint32 ino);
+void jffs2_iput(struct _inode * i);
struct jffs2_sb_info;
struct jffs2_eraseblock;
More information about the linux-mtd-cvs
mailing list