src/searchnupdate.c

Go to the documentation of this file.
00001 /*
00002 * /giis/searchnupdate.c - This file performs search and update operations on files.
00003 *
00004 * Copyright (C) 2007 G.Lakshmipathi.<lakshmipathi_g@rediffmail.com>
00005 *
00006 */
00007 
00008 #include"giis.h"
00009 
00010 /*
00011 * search4dir() - This function is used to record all entries of Directory into 
00012 * corresponding  info_files.
00013 * Modification for giis2:
00014 * First we record directories and avoid any duplication with the help avoid_dups()
00015 * After recording all directories then record files by setting install_file.And 
00016 * make a recursive call to search4dir().
00017 * Modification for giis2.1:
00018 * Use of update_dir variable
00019 */
00020 
00021 int search4dir ()
00022 {
00023   int i, fp, level_count = 0;
00024   while (level_count < LEVEL_VALUE)
00025   {
00026 
00027     fp = open (DIR_INFO_FILE, 0);
00028     if (fp == -1)
00029     {
00030       perror ("open");
00031       return -1;
00032     }
00033 
00034     i = read (fp, giis_d.buffer, GIIS_DSIZE);
00035     CHECK while (i > 0)
00036     {
00037       if (giis_d.info.search_flag == 1)
00038       {
00039 
00040         fs.inode_number = giis_d.info.inode_number;
00041         i = find_inode_offset ();
00042         CHECK i = read_inode ();
00043         CHECK i = set_content_offset ();
00044         CHECK if (dir)
00045         {
00046 
00047           i = read_dir ();
00048           CHECK i = show_dir ();
00049         CHECK}
00050 
00051       }
00052       i = read (fp, giis_d.buffer, GIIS_DSIZE);
00053     CHECK}
00054     if ((install == 1 && install_file == 0))
00055     {
00056       i = update_dir_info_file (level_count);
00057       CHECK i = avoid_dups ();
00058     CHECK}
00059     /* First update all directories above and now update files */
00060     if (update_dir == 1)
00061     {
00062       close (fp);
00063       update_dir = 0;
00064       i = search4dir ();        /* Update files */
00065       if (i == 444)
00066       {
00067         close (fp);
00068         get_sample_data ();
00069         printf ("\n\n\t\t giis updated...");
00070         return 1;
00071 
00072       }
00073 
00074 
00075     }
00076 
00077     if (install_file == 1 || update_file == 1)  /* Because we want record files only once . */
00078       return 444;
00079 
00080     level_count++;
00081     close (fp);
00082   }
00083 
00084 
00085 
00086   /* During installation we need to record fiels so now store 
00087      only those files from DIR file  */
00088 
00089   if (install == 1 && install_file == 0)
00090   {
00091     install_file = 1;
00092     search4dir ();              /* Recursive */
00093   }
00094 
00095   return 1;
00096 }
00097 
00098 
00099 /* 
00100 * update_dir_info_file()-After entries  are recorded directories search_flags are set.
00101 * This is called during installation.
00102 * This update_dir_info_file() ironically will not be called during updates.
00103 */
00104 
00105 int update_dir_info_file (int level_count)
00106 {
00107   int fp, i, flag, count = 0;
00108 
00109 
00110   fp = open (DIR_INFO_FILE, 2);
00111   if (fp == -1)
00112   {
00113     perror ("open");
00114     return -1;
00115   }
00116   i = read (fp, giis_d.buffer, GIIS_DSIZE);
00117   CHECK
00118     /* Set flags of  newly found entries */
00119     while (i > 0)
00120   {
00121     if ((giis_d.info.search_flag == 0) && (giis_d.info.parent_inode_number != 2))
00122     {
00123       flag = get_parent_inode_flag (giis_d.info.parent_inode_number);
00124       if (flag == -1)
00125         break;
00126       if (flag == 1)
00127       {                         /* Parent is set so set sub-directory flag */
00128         lseek (fp, count * GIIS_DSIZE, 0);
00129         i = read (fp, giis_d.buffer, GIIS_DSIZE);
00130         if (i != GIIS_DSIZE)
00131         {
00132           perror ("read");
00133           return -1;
00134         }
00135         giis_d.info.search_flag = 1;
00136         lseek (fp, -GIIS_DSIZE, 1);
00137         i = write (fp, giis_d.buffer, GIIS_DSIZE);
00138         if (i != GIIS_DSIZE)
00139         {
00140           perror ("write");
00141           return -1;
00142         }
00143 
00144       }
00145     }
00146     i = read (fp, giis_d.buffer, GIIS_DSIZE);
00147     /* if end of file just quits loop */
00148     count++;
00149 
00150   }
00151 
00152   printf ("\n\t Files at  Directory Level %d are updated......", level_count + 1);
00153   close (fp);
00154   return 1;
00155 }
00156 
00157 /*
00158 * get_parent_inode_flag() is a helper function to update_dir_file_info().
00159 * It returns parent inode flag.
00160 */
00161 
00162 int get_parent_inode_flag (unsigned long parent)
00163 {
00164   int fp, i;
00165 
00166   fp = open (DIR_INFO_FILE, 0);
00167   if (fp == -1)
00168   {
00169     perror ("open");
00170     return -1;
00171   }
00172 
00173   i = read (fp, giis_d.buffer, GIIS_DSIZE);
00174   CHECK while (i > 0)
00175   {
00176     if (giis_d.info.inode_number == parent)
00177     {
00178       close (fp);
00179       return 1;
00180     }
00181     i = read (fp, giis_d.buffer, GIIS_DSIZE);
00182   CHECK}
00183 
00184   close (fp);
00185   return -1;
00186 }
00187 
00188 /*
00189 * search4sequence12() 
00190 * In giis1 holes concept used:
00191 * If we have holes less than  five then store it in member d/sindirect_block_hole[]
00192 * Since if store it in a files which uses fixed record size of 1024 unsigned long.
00193 * If we have 4 records then remaining 1020 are wasted.
00194 * To avoid this we used s/dindirect_block_hole.-Thus saves space when holes<5 
00195 * And hole=100 we use file though still there will be 924 are wasted.
00196 * Lot of space still wasted. 
00197 *
00198 * Modified for giis.2
00199 * Get rid of that holes concept since we use variable size records instead of fixed size
00200 * record.Now with variable records  which doesnot waste space.We do not need holes at all.
00201 *
00202 * In giis2 we have following flags,
00203 * sfragment_flag=0 files not uses single indirect at all.
00204 * sfragment_flag=1 file uses single indirect but it's already in sequence.
00205 * sfragment_flag=2 file uses single indirect with SIND FILE .
00206 */
00207 
00208 
00209 int search4sequence12 ()
00210 {
00211   unsigned long indirect_block[1024], prev;
00212   int i, hole, fp, count;
00213   count = hole = 0;
00214   lseek64 (fd, (unsigned long long) giis_f.info.data_block[12] * fs.block_size, 0);
00215   read (fd, indirect_block, fs.block_size);
00216 
00217   /* Check 4 holes */
00218   if (indirect_block[0] - giis_f.info.data_block[12] != 1)
00219   {
00220     idata_block[count++] = giis_f.info.data_block[12];
00221     idata_block[count++] = indirect_block[0];
00222     hole++;
00223   }
00224 
00225   prev = indirect_block[0];
00226 
00227   for (i = 1; i < 1024 && indirect_block[i]; i++)
00228   {
00229 
00230     if (indirect_block[i] - prev == 1)
00231     {
00232       prev = indirect_block[i];
00233       continue;
00234     }
00235 
00236     else
00237     {                           /* Hole uses {this_block,that_block} format */
00238       idata_block[count++] = prev;
00239       idata_block[count++] = indirect_block[i];
00240       hole++;
00241       prev = indirect_block[i];
00242     }
00243 
00244   }
00245 
00246   /* Update is_offset and sfragment_flag and last_data_block */
00247 
00248   if ((i == 1024 || indirect_block[i] == 0) && (hole == 0))
00249   {
00250     giis_f.info.is_offset = 0;
00251     giis_f.info.sfragment_flag = 1;
00252     giis_f.info.last_data_block = indirect_block[i - 1];
00253     return (hole);
00254   }
00255 
00256   if ((i == 1024 || indirect_block[i] == 0) && hole)
00257   {
00258     giis_f.info.is_offset = count;
00259     giis_f.info.sfragment_flag = 2;
00260     giis_f.info.last_data_block = indirect_block[i - 1];
00261 
00262 
00263     /* Write into file */
00264     fp = open (SIND_INFO_FILE, 1);
00265     if (fp == -1)
00266     {
00267       perror ("Open:");
00268       printf ("Error no :%d", errno);
00269       return -1;
00270     }
00271     lseek (fp, 0, 2);
00272     i = write (fp, idata_block, count * sizeof (unsigned long));
00273     if (i != count * sizeof (unsigned long))
00274     {
00275       perror ("write");
00276       printf ("Error no :%d", errno);
00277       return -1;
00278     }
00279     close (fp);
00280     return 1;
00281   }
00282 
00283   return 1;
00284 }
00285 
00286 /* 
00287 * search4sequence13() Exactly sames as above but it deals with double indirect blocks
00288 * Modified for giis.2
00289 * Get rid of that holes.variable size records used instead of fixed size records.
00290 *
00291 * In giis2 we have following flags,
00292 * dfragment_flag=0 files not uses double indirect at all.
00293 * dfragment_flag=1 file uses double indirect but it's already in sequence.
00294 * dfragment_flag=2 file uses double indirect with DIND FILE .
00295 *
00296 * Here files greater than 8.04MB are also recorded with an recursive call to 
00297 * search4sequence13() untill all blocks are scanned.
00298 *
00299 */
00300 
00301 int search4sequence13 ()
00302 {
00303   unsigned long indirect_block[1024];
00304   int i, fp, count, err, ret;
00305   static unsigned long prev;
00306   count = 0, ret = 0;
00307 
00308   /*
00309      Consider the following cases,
00310      1) When all block number of file is less than 1048575 there is no problem.
00311      2) When all block number of file is greater than 1048575 still no problem.
00312      3) When there is a file with block numbers that switches from less to
00313      greater than 1048575 we come acroess some problem.
00314 
00315      When we use block numbers more than 1048575 we make shift beyond range of 
00316      unsigned long (i.e)4294967295.But for some reasons-Which i don't know- it                    throws up raw data. So in these cases where we make a shift from blocks
00317      less then greater we tend the skip the second lseek().
00318 
00319      *Since I'm not sure what's the problem is? I'm unsure about this solution
00320      too.
00321    */
00322 
00323   if (i_round == 0)
00324   {
00325     count = hole = 0;           /* Counts holes */
00326     lseek64 (fd, (unsigned long long) giis_f.info.data_block[13] * fs.block_size, 0);
00327     read (fd, indirect_block, fs.block_size);
00328 
00329     lseek64 (fd, (unsigned long long) indirect_block[0] * fs.block_size, 0);
00330     read (fd, indirect_block, fs.block_size);
00331     prev = giis_f.info.data_block[13];
00332 
00333   }
00334   else
00335   {
00336     lseek64 (fd, (unsigned long long) prev * 4096, 0);
00337     read (fd, indirect_block, fs.block_size);
00338     lseek64 (fd, (unsigned long long) indirect_block[0] * 4096, 0);
00339     read (fd, indirect_block, fs.block_size);
00340   }
00341 
00342   if (indirect_block[0] - prev != 2)
00343   {
00344 
00345     idata_block[count++] = prev;
00346     idata_block[count++] = indirect_block[0];
00347     hole++;
00348   }
00349 
00350   prev = indirect_block[0];
00351 
00352   for (i = 1; i < 1024 && indirect_block[i]; i++)
00353   {
00354 
00355     if (indirect_block[i] - prev == 1)
00356     {
00357       prev = indirect_block[i];
00358       continue;
00359     }
00360 
00361     else
00362     {
00363       idata_block[count++] = prev;
00364       idata_block[count++] = indirect_block[i];
00365       hole++;
00366       prev = indirect_block[i];
00367     }
00368 
00369 
00370   }
00371 
00372   /* Update id_offset and dfragment_flag and last_data_block */
00373 
00374   if ((indirect_block[i] == 0) && (hole == 0))
00375   {
00376     giis_f.info.id_offset = 0;
00377     giis_f.info.dfragment_flag = 1;
00378     giis_f.info.last_data_block = indirect_block[i - 1];
00379 
00380     return 444;
00381   }
00382 
00383   if ((i == 1024 || indirect_block[i] == 0) && hole)
00384   {
00385     giis_f.info.id_offset += count;
00386     giis_f.info.dfragment_flag = 2;
00387     giis_f.info.last_data_block = indirect_block[i - 1];
00388 
00389     /* Write into file */
00390 
00391     fp = open (DIND_INFO_FILE, 1);
00392     if (fp == -1)
00393     {
00394       perror ("Open:");
00395       printf ("Error no :%d", errno);
00396       return -1;
00397     }
00398     lseek (fp, 0, 2);
00399     err = write (fp, idata_block, count * sizeof (unsigned long));
00400     if (err != count * sizeof (unsigned long))
00401     {
00402       perror ("write");
00403       printf ("Error no :%d", errno);
00404       return -1;
00405     }
00406     close (fp);
00407   }
00408 
00409   if (i == 1024 && indirect_block[1023] != 0)
00410   {
00411     prev = indirect_block[1023];
00412     i_round++;
00413     ret = search4sequence13 ();
00414     if (ret == 444)
00415       return 1;
00416 
00417   }
00418 
00419 
00420   return 444;                   /* Will be caught by recursive function */
00421 }
00422 
00423 /*       
00424 * Introduced for giis2:
00425 * avoid_dups():Called Only during installtion 
00426 * This is used to figureout whether we have any duplication of directory entry.
00427 * call2remove() if found.
00428 */
00429 
00430 int avoid_dups ()
00431 {
00432   int fp1, fp2, i, record_no, bity;
00433   unsigned long temp, end;
00434 
00435   fp1 = open (DIR_INFO_FILE, 0);
00436   if (fp1 == -1)
00437   {
00438     perror ("open:");
00439     printf ("\nError No:%d", errno);
00440     close (fp1);
00441     return -1;
00442   }
00443   fp2 = open (DIR_INFO_FILE, 0);
00444   if (fp2 == -1)
00445   {
00446     perror ("open:");
00447     printf ("\nError No:%d", errno);
00448     close (fp1);
00449     return -1;
00450   }
00451 
00452   /* Not so elegant code/method to check 4 repeatation 
00453      but i think...it's different */
00454 
00455 
00456 
00457   end = lseek (fp1, 0, 2);      /* EOF */
00458   lseek (fp1, 0, 0);
00459   temp = bity = 0;
00460 
00461   while (temp < (end - GIIS_DSIZE))
00462   {
00463     i = read (fp1, giis_d.buffer, GIIS_DSIZE);
00464     if (i != GIIS_DSIZE)
00465     {
00466       perror ("read1()");
00467       printf ("\nError No:%d \t fp=%d", errno, fp1);
00468       close (fp1);
00469       return -1;
00470     }
00471     temp += GIIS_DSIZE;
00472 
00473     /* Read next record in fp2 from current record of fp1 */
00474 
00475     lseek (fp2, lseek (fp1, 0, 1), 0);
00476 
00477     while (i > 0)
00478     {
00479       i = read (fp2, giis_dt.buffer, GIIS_DSIZE);
00480 
00481       if ((giis_d.info.inode_number == giis_dt.info.inode_number)
00482           && (giis_dt.info.search_flag == 1))
00483       {
00484 
00485         /* Get the duplicate record number */
00486 
00487         record_no = lseek (fp2, 0, 1) / GIIS_DSIZE;
00488         call2remove (record_no);
00489       }
00490     }
00491   }
00492   close (fp1);
00493   close (fp2);
00494   return 1;
00495 }
00496 
00497 /*
00498 * Introduced for giis2:
00499 * call2remove()- This removes a directory entry from future processing by just resetting its 
00500 * search flag to zero.
00501 * This is helper funtion to avoid_dups().
00502 */
00503 
00504 int call2remove (int record_no)
00505 {
00506   int fdes, i;
00507   fdes = open (DIR_INFO_FILE, 2);
00508   if (fdes == -1)
00509   {
00510     perror ("open");
00511     return -1;
00512   }
00513 
00514   lseek (fdes, (record_no - 1) * GIIS_DSIZE, 0);
00515   i = read (fdes, giis_dt.buffer, GIIS_DSIZE);
00516   if (i != GIIS_DSIZE)
00517   {
00518     perror ("read1()");
00519     printf ("\nError No:%d \t fp=%d", errno, fdes);
00520     close (fdes);
00521     return -1;
00522   }
00523 
00524 
00525   giis_dt.info.search_flag = 0;
00526   lseek (fdes, -GIIS_DSIZE, 1);
00527   i = write (fdes, giis_dt.buffer, GIIS_DSIZE);
00528 
00529   if (i != GIIS_DSIZE)
00530   {
00531     perror ("read1()");
00532     printf ("\nError No:%d \t fp=%d", errno, fdes);
00533     close (fdes);
00534     return -1;
00535   }
00536 
00537 
00538   close (fdes);
00539   return 1;
00540 
00541 }
00542 
00543 /*
00544 * Introduced for giis2.1:
00545 * check4file_dups() : Checks whether a file is a valid entry or not.
00546 */
00547 int check4file_dups (unsigned long parent)
00548 {
00549   int i, fp;
00550 
00551   fp = open (FILE_INFO_FILE, 0);
00552   if (fp == -1)
00553   {
00554     perror ("open");
00555     return -1;
00556   }
00557   if (lseek (fp, 0, 0) == lseek (fp, 0, 2))
00558   {                             /* Empty file */
00559     close (fp);
00560     return 1;
00561   }
00562   lseek (fp, 0, 0);             /* Reset */
00563 
00564   i = read (fp, giis_f.buffer, GIIS_FSIZE);
00565   while (i > 0)
00566   {
00567     if ((giis_f.info.inode_number == ide.de.inode)
00568         && (giis_f.info.parent_inode_number == parent)
00569         && (giis_f.info.file_size == iin.in.i_size))
00570     {
00571       close (fp);
00572       return 0;
00573     }
00574     i = read (fp, giis_f.buffer, GIIS_FSIZE);
00575   CHECK}
00576   close (fp);
00577   return 1;
00578 }
00579 
00580 /*
00581 * Introduced for giis2.1:
00582 * check4dir_dups() : Checks whether a directory  is a valid entry or not.
00583 */
00584 int check4dir_dups (unsigned long parent)
00585 {
00586   int i, fp;
00587 
00588   if (ide.de.inode == ROOT_INODE)
00589     return 0;
00590   if (ide.de.name[0] == '.')
00591     return 0;
00592   fp = open (DIR_INFO_FILE, 0);
00593   if (fp == -1)
00594   {
00595     perror ("open");
00596     return -1;
00597   }
00598   if (lseek (fp, 0, 0) == lseek (fp, 0, 2))
00599   {                             /* Empty file */
00600     close (fp);
00601     return 1;
00602   }
00603   lseek (fp, 0, 0);             /* Reset */
00604 
00605   i = read (fp, giis_d.buffer, GIIS_DSIZE);
00606   while (i > 0)
00607   {
00608     if (giis_d.info.inode_number == ide.de.inode)
00609     {                           /* We already have it */
00610       close (fp);
00611       return 0;
00612     }
00613     i = read (fp, giis_d.buffer, GIIS_DSIZE);
00614   CHECK}
00615   close (fp);
00616   dir_level = 1;
00617   i = dir_depth (parent);
00618   CHECK if ((i == 444) && (dir_level < LEVEL_VALUE))
00619     return 1;                   /* Record this new entry  */
00620 
00621   if ((i == 444) && (dir_level > LEVEL_VALUE))
00622     return 0;                   /* Don't record  since out of range of  LEVEL_VALUE */
00623 
00624   return 0;
00625 }
00626 
00627 /*
00628 * Introduced for giis2.1:
00629 * dir_depth() : Returns level_value of newly found dir.
00630 */
00631 int dir_depth (unsigned long inode)
00632 {
00633   int i, fp;
00634 
00635   if (inode == ROOT_INODE)      /* We reached the depth */
00636     return 444;
00637   fp = open (DIR_INFO_FILE, 0);
00638   if (fp == -1)
00639   {
00640     perror ("open");
00641     return -1;
00642   }
00643 
00644   i = read (fp, giis_d.buffer, GIIS_DSIZE);
00645 
00646   while (i > 0)
00647   {
00648     if (inode == ROOT_INODE)
00649       return 444;
00650 
00651     if (giis_d.info.inode_number == inode)
00652     {                           /* When parent and grandparent is same */
00653       close (fp);
00654       dir_level++;
00655       i = dir_depth (giis_d.info.parent_inode_number);
00656       if (i == 444)
00657         return i;
00658       else
00659         return 0;
00660     }
00661     i = read (fp, giis_d.buffer, GIIS_DSIZE);
00662   CHECK}
00663   close (fp);
00664   return 0;
00665 }
00666 
00667 /*
00668 * Introduced for giis3.0:
00669 * get_sample_data() : Get content of  each file and store them.
00670 */
00671 int get_sample_data ()
00672 {
00673   int sfp, ffp, dfp, i, ret;
00674   unsigned long device_block_number;
00675   char sample[32];
00676 
00677   //Open sample file 
00678   sfp = open (SAMPLE_DATA_FILE, O_RDWR);
00679   if (sfp == -1)
00680   {
00681     printf ("\nFile Not found %s", SAMPLE_DATA_FILE);
00682     return -1;
00683   }
00684   //Open the device
00685   dfp = open (device_name, 0);
00686   if (dfp == -1)
00687   {
00688     perror ("open");
00689   ERROR}
00690 
00691   //Open the FILE informations file 
00692   ffp = open (FILE_INFO_FILE, 0);
00693   if (ffp == -1)
00694   {
00695     perror ("open");
00696     return -1;
00697   }
00698   //Now read each file records 
00699   i = read (ffp, giis_f.buffer, GIIS_FSIZE);
00700 
00701   while (i > 0)
00702   {
00703 
00704     /* Check whether the inode alread available in SAMPLE FILE  */
00705     ret = check4samplefile_dups (giis_f.info.inode_number);
00706 
00707     if (ret)
00708     {
00709       fs.block_number = giis_f.info.data_block[0];
00710       if (fs.block_number != 0)
00711       {
00712         i = eye_on_gd ();
00713         if (i == -1)
00714         {
00715           printf ("\n\tAbnormal : Group Descriptor not found ");
00716           close (ffp);
00717           close (dfp);
00718           close (sfp);
00719           return -1;
00720         }
00721         device_block_number =
00722           ((fs.block_number - 1) % fs.blocks_per_group) +
00723           fs.group_number * fs.blocks_per_group;
00724         device_block_number += fs.first_data_block;
00725         fs.content_offset =
00726           (unsigned long long) device_block_number *(unsigned long long) fs.block_size;
00727         fs.content_offset += fs.block_size;
00728         //set device file to appropriate location
00729         lseek64 (dfp, fs.content_offset, 0);
00730         //Empty the buffer - sample
00731         for (i = 0; i < 32; i++)
00732         {
00733           giis_s.info.sdata[i] = '\0';
00734         }
00735         //read data from disk
00736         i = read (dfp, sample, 32);     //0-31
00737         if (i != 32)
00738         {
00739           perror ("read():get_sample_data()");
00740           printf ("\nError No:%d", errno);
00741           close (ffp);
00742           close (dfp);
00743           close (sfp);
00744           return -1;
00745         }
00746         sample[31] = '\0';      //32 is 
00747         strcpy (giis_s.info.sdata, sample);
00748         giis_s.info.inode_number = giis_f.info.inode_number;
00749 
00750 
00751         //Inode and sample data is in struct now write into sample file 
00752         i = write (sfp, giis_s.buffer, GIIS_SSIZE);
00753         if (i != GIIS_SSIZE)
00754         {
00755           perror (" write():");
00756           printf ("\nError No:%d", errno);
00757           close (ffp);
00758           close (dfp);
00759           close (sfp);
00760           return -1;
00761 
00762         }
00763       }
00764     }
00765     //Next  record
00766     i = read (ffp, giis_f.buffer, GIIS_FSIZE);
00767   CHECK}
00768   close (ffp);
00769   close (dfp);
00770   close (sfp);
00771   return 0;
00772 }
00773 
00774 /*
00775 * Introduced for giis4.1:
00776 * check4samplefile_dups() : Checks whether a file's data should be retireved or not ..
00777 */
00778 int check4samplefile_dups (unsigned long temp_inode_number)
00779 {
00780   int i, fp;
00781   fp = open (SAMPLE_DATA_FILE, 0);
00782   if (fp == -1)
00783   {
00784     perror ("open");
00785     return -1;
00786   }
00787   if (lseek (fp, 0, 0) == lseek (fp, 0, 2))
00788   {                             /* Empty file */
00789     close (fp);
00790     return 1;
00791   }
00792   lseek (fp, 0, 0);             /* Reset */
00793 
00794   i = read (fp, giis_s.buffer, GIIS_SSIZE);
00795   while (i > 0)
00796   {
00797     if (giis_s.info.inode_number == temp_inode_number)
00798     {
00799       close (fp);
00800       return 0;                 //already exists 
00801     }
00802     i = read (fp, giis_s.buffer, GIIS_SSIZE);
00803   CHECK}
00804   close (fp);
00805   return 1;
00806 }

Generated on Wed Jul 25 20:43:33 2007 for giis by  doxygen 1.5.1