/[hurd]/hurd/fatfs/inode.c
ViewVC logotype

Diff of /hurd/fatfs/inode.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by marcus, Tue Dec 3 20:52:59 2002 UTC revision 1.2 by marcus, Sat May 10 00:12:29 2003 UTC
# Line 1  Line 1 
1  /* inode.c - Inode management routines.  /* inode.c - Inode management routines.
2     Copyright (C) 1994,95,96,97,98,99, 2000, 2002 Free Software Foundation, Inc.     Copyright (C) 1994,95,96,97,98,99,2000,02,03 Free Software Foundation, Inc.
3     Modified for fatfs by Marcus Brinkmann <marcus@gnu.org>     Modified for fatfs by Marcus Brinkmann <marcus@gnu.org>
4    
5     This file is part of the GNU Hurd.     This file is part of the GNU Hurd.
# Line 273  read_node (struct node *np, vm_address_t Line 273  read_node (struct node *np, vm_address_t
273      {      {
274        if (buf == 0)        if (buf == 0)
275          {          {
276            err = diskfs_cached_lookup (vk.dir_inode, &dp);            /* FIXME: We know intimately that the parent dir is locked
277            if (err)               by libdiskfs.  The only case it is not locked is for NFS
278              return err;               (fsys_getfile) and we disabled that.  */
279              dp = ifind (vk.dir_inode);
280                
281            /* Map in the directory contents. */            /* Map in the directory contents. */
282            memobj = diskfs_get_filemap (dp, prot);            memobj = diskfs_get_filemap (dp, prot);
283                
284            if (memobj == MACH_PORT_NULL)            if (memobj == MACH_PORT_NULL)
285              {              return errno;
               diskfs_nput (dp);  
               return errno;  
             }  
286    
287            buflen = round_page (dp->dn_stat.st_size);            buflen = round_page (dp->dn_stat.st_size);
288            err = vm_map (mach_task_self (),            err = vm_map (mach_task_self (),
# Line 347  read_node (struct node *np, vm_address_t Line 345  read_node (struct node *np, vm_address_t
345              {              {
346                if (our_buf && buf)                if (our_buf && buf)
347                  munmap ((caddr_t) buf, buflen);                  munmap ((caddr_t) buf, buflen);
               if (dp)  
                 diskfs_nput (dp);  
348                return err;                return err;
349              }              }
350            st->st_size = np->allocsize;            st->st_size = np->allocsize;
# Line 384  read_node (struct node *np, vm_address_t Line 380  read_node (struct node *np, vm_address_t
380    
381    if (our_buf && buf)    if (our_buf && buf)
382      munmap ((caddr_t) buf, buflen);      munmap ((caddr_t) buf, buflen);
   if (dp)  
     diskfs_nput (dp);  
383    return 0;    return 0;
384  }  }
385    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26