patch-2.0.34 linux/fs/isofs/rock.c

Next file: linux/fs/isofs/util.c
Previous file: linux/fs/isofs/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.33/linux/fs/isofs/rock.c linux/fs/isofs/rock.c
@@ -168,15 +168,16 @@
 }
 
 int get_rock_ridge_filename(struct iso_directory_record * de,
-			   char ** name, int * namlen, struct inode * inode)
+			    char * retname, struct inode * inode)
 {
   int len;
   unsigned char * chr;
   CONTINUE_DECLS;
-  char * retname = NULL;
   int retnamlen = 0, truncate=0;
  
   if (!inode->i_sb->u.isofs_sb.s_rock) return 0;
+  *retname = 0;
+  retnamlen = 0;
 
   SETUP_ROCK_RIDGE(de, chr, len);
  repeat:
@@ -207,18 +208,6 @@
 	  printk("Unsupported NM flag settings (%d)\n",rr->u.NM.flags);
 	  break;
 	};
-	if (!retname){
-	  retname = (char *) kmalloc (255,GFP_KERNEL);
-	  /* This may be a waste, but we only
-	     need this for a moment.  The layers
-	     that call this function should
-	     deallocate the mem fairly soon
-	     after control is returned */
-
-	  if (!retname) goto out;
-	  *retname = 0; /* Zero length string */
-	  retnamlen = 0;
-	};
 	if((strlen(retname) + rr->len - 5) >= 254) {
 	  truncate = 1;
 	  break;
@@ -231,7 +220,6 @@
 	printk("RR: RE (%x)\n", inode->i_ino);
 #endif
 	if (buffer) kfree(buffer);
-	if (retname) kfree(retname);
 	return -1;
       default:
 	break;
@@ -239,15 +227,9 @@
     };
   }
   MAYBE_CONTINUE(repeat,inode);
-  if(retname){
-    *name = retname;
-    *namlen = retnamlen;
-    return 1;
-  };
-  return 0;  /* This file did not have a NM field */
+  return retnamlen; /* If 0, this file did not have a NM field */
  out:
   if(buffer) kfree(buffer);
-  if (retname) kfree(retname);
   return 0;
 }
 
@@ -287,6 +269,7 @@
 	CHECK_CE;
 	break;
       case SIG('E','R'):
+	inode->i_sb->u.isofs_sb.s_rock = 1;
 	printk(KERN_DEBUG"ISO9660 Extensions: ");
 	{ int p;
 	  for(p=0;p<rr->u.ER.len_id;p++) printk("%c",rr->u.ER.data[p]);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov