[JFFS2] Add symlink caching support.
Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
committed by
Thomas Gleixner
parent
20a6c21190
commit
32f1a95d50
+1
-31
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* For licensing information, see the file 'LICENCE' in this directory.
|
||||
*
|
||||
* $Id: read.c,v 1.38 2004/11/16 20:36:12 dwmw2 Exp $
|
||||
* $Id: read.c,v 1.39 2005/03/01 10:34:03 dedekind Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -214,33 +214,3 @@ int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Core function to read symlink target. */
|
||||
char *jffs2_getlink(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
|
||||
{
|
||||
char *buf;
|
||||
int ret;
|
||||
|
||||
down(&f->sem);
|
||||
|
||||
if (!f->metadata) {
|
||||
printk(KERN_NOTICE "No metadata for symlink inode #%u\n", f->inocache->ino);
|
||||
up(&f->sem);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
buf = kmalloc(f->metadata->size+1, GFP_USER);
|
||||
if (!buf) {
|
||||
up(&f->sem);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
buf[f->metadata->size]=0;
|
||||
|
||||
ret = jffs2_read_dnode(c, f, f->metadata, buf, 0, f->metadata->size);
|
||||
|
||||
up(&f->sem);
|
||||
|
||||
if (ret) {
|
||||
kfree(buf);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user