diff options
author | Artem B. Bityutskiy <dedekind@infradead.org> | 2005-07-17 07:13:51 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 10:25:55 -0500 |
commit | 2b79adcca147c9f8fd1094ab4cb342d7e1790d70 (patch) | |
tree | 11238349e1e7861d8d4bb290719fc52269b78e65 /fs/jffs2/dir.c | |
parent | 730554d94607572ef8300c5c9848540b42394897 (diff) |
[JFFS2] Use f->target instead of f->dents for symlink target
JFFS2 uses f->dents to store the pointer to the symlink target string (in case
the inode is symlink). This is somewhat ugly to use the same field for
different reasons. Introduce distinct field f->target for this purpose.
Note, f->fragtree, f->dents, f->target may probably be put in a union.
Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/dir.c')
-rw-r--r-- | fs/jffs2/dir.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 3ca0d25eef1d..5738df223775 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * For licensing information, see the file 'LICENCE' in this directory. | 8 | * For licensing information, see the file 'LICENCE' in this directory. |
9 | * | 9 | * |
10 | * $Id: dir.c,v 1.86 2005/07/06 12:13:09 dwmw2 Exp $ | 10 | * $Id: dir.c,v 1.87 2005/07/17 11:13:46 dedekind Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -344,9 +344,9 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
344 | return PTR_ERR(fn); | 344 | return PTR_ERR(fn); |
345 | } | 345 | } |
346 | 346 | ||
347 | /* We use f->dents field to store the target path. */ | 347 | /* We use f->target field to store the target path. */ |
348 | f->dents = kmalloc(targetlen + 1, GFP_KERNEL); | 348 | f->target = kmalloc(targetlen + 1, GFP_KERNEL); |
349 | if (!f->dents) { | 349 | if (!f->target) { |
350 | printk(KERN_WARNING "Can't allocate %d bytes of memory\n", targetlen + 1); | 350 | printk(KERN_WARNING "Can't allocate %d bytes of memory\n", targetlen + 1); |
351 | up(&f->sem); | 351 | up(&f->sem); |
352 | jffs2_complete_reservation(c); | 352 | jffs2_complete_reservation(c); |
@@ -354,8 +354,8 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
354 | return -ENOMEM; | 354 | return -ENOMEM; |
355 | } | 355 | } |
356 | 356 | ||
357 | memcpy(f->dents, target, targetlen + 1); | 357 | memcpy(f->target, target, targetlen + 1); |
358 | D1(printk(KERN_DEBUG "jffs2_symlink: symlink's target '%s' cached\n", (char *)f->dents)); | 358 | D1(printk(KERN_DEBUG "jffs2_symlink: symlink's target '%s' cached\n", (char *)f->target)); |
359 | 359 | ||
360 | /* No data here. Only a metadata node, which will be | 360 | /* No data here. Only a metadata node, which will be |
361 | obsoleted by the first data write | 361 | obsoleted by the first data write |