[BACK]Return to vfs_task.c CVS log [TXT][DIR] Up to [local] / prex-old / usr / server / fs / vfs

Diff for /prex-old/usr/server/fs/vfs/vfs_task.c between version 1.1.1.1 and 1.1.1.1.2.1

version 1.1.1.1, 2008/06/03 10:38:51 version 1.1.1.1.2.1, 2008/08/13 17:12:45
Line 63 
Line 63 
 #endif  #endif
   
 /*  /*
  * Lookup task by task id.   * Convert task ID to a task structure.
  * Returns locked task. Caller must unlock it after using it.   * Returns locked task. Caller must unlock it after using it.
  */   */
 struct task *  struct task *
Line 134 
Line 134 
 }  }
   
 /*  /*
  * Update task id of specified task.   * Update task id of the specified task.
  */   */
 void  void
 task_update(struct task *t, task_t task)  task_update(struct task *t, task_t task)
Line 168 
Line 168 
 }  }
   
 /*  /*
    * Get new file descriptor in the task.
    * Find the smallest empty slot in the fd array.
    * Returns -1 if there is no empty slot.
    */
   int
   task_newfd(struct task *t)
   {
           int fd;
   
           for (fd = 0; fd < OPEN_MAX; fd++)
                   if (t->file[fd] == NULL)
                           break;
           if (fd == OPEN_MAX)
                   return -1;      /* slot full */
   
           return fd;
   }
   
   /*
  * Convert to full path from the cwd of task and path.   * Convert to full path from the cwd of task and path.
  * @t:    task structure   * @t:    task structure
  * @path: target path   * @path: target path
Line 250 
Line 269 
         int i;          int i;
   
         TASK_LOCK();          TASK_LOCK();
         printf("Dump file data\n");          dprintf("Dump file data\n");
         printf(" task     nr_open cwd\n");          dprintf(" task     opens   cwd\n");
         printf(" -------- ------- ------------------------------\n");          dprintf(" -------- ------- ------------------------------\n");
         for (i = 0; i < TASK_MAXBUCKETS; i++) {          for (i = 0; i < TASK_MAXBUCKETS; i++) {
                 head = &task_table[i];                  head = &task_table[i];
                 for (n = list_first(head); n != head; n = list_next(n)) {                  for (n = list_first(head); n != head; n = list_next(n)) {
                         t = list_entry(n, struct task, link);                          t = list_entry(n, struct task, link);
                         printf(" %08x %7x %s\n", t->task, t->nr_open, t->cwd);                          dprintf(" %08x %7x %s\n", (int)t->task, t->nopens,
                                  t->cwd);
                 }                  }
         }          }
         printf("\n");          dprintf("\n");
         TASK_UNLOCK();          TASK_UNLOCK();
 #endif  #endif
 }  }
Line 275 
Line 295 
                 list_init(&task_table[i]);                  list_init(&task_table[i]);
 }  }
   
   #ifdef DEBUG_VFS
 void  void
 task_debug(void)  task_debug(void)
 {  {
Line 283 
Line 304 
   
         for (i = 0; i < TASK_MAXBUCKETS; i++) {          for (i = 0; i < TASK_MAXBUCKETS; i++) {
                 head = &task_table[i];                  head = &task_table[i];
                 syslog(LOG_DEBUG, "head=%x head->next=%x head->prev=%x\n",                  dprintf("head=%x head->next=%x head->prev=%x\n", head,
                        head, head->next, head->prev);                          head->next, head->prev);
                 ASSERT(head->next);                  ASSERT(head->next);
                 ASSERT(head->prev);                  ASSERT(head->prev);
         }          }
 }  }
   #endif

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.1.2.1

CVSweb