commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hurd/fatfs ChangeLog dir.c inode.c main.c


From: Marcus Brinkmann
Subject: hurd/fatfs ChangeLog dir.c inode.c main.c
Date: Fri, 09 May 2003 20:12:29 -0400

CVSROOT:        /cvsroot/hurd
Module name:    hurd
Changes by:     Marcus Brinkmann <address@hidden>       03/05/09 20:12:29

Modified files:
        fatfs          : ChangeLog dir.c inode.c main.c 

Log message:
        2003-04-26  Marco Gerards  <address@hidden>
        
        * dir.c (diskfs_get_directs): Consider ENTRY when adding
        "." and ".." for the rootnode.
        
        * inode.c (read_node): Use ifind instead of diskfs_cached_lookup
        and do not use diskfs_nput anymore.
        * main.c (diskfs_S_fsys_getfile): New function.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd/fatfs/ChangeLog.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd/fatfs/dir.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd/fatfs/inode.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd/fatfs/main.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: hurd/fatfs/ChangeLog
diff -u hurd/fatfs/ChangeLog:1.1 hurd/fatfs/ChangeLog:1.2
--- hurd/fatfs/ChangeLog:1.1    Tue Dec  3 15:52:59 2002
+++ hurd/fatfs/ChangeLog        Fri May  9 20:12:29 2003
@@ -1,3 +1,12 @@
+2003-04-26  Marco Gerards  <address@hidden>
+
+       * dir.c (diskfs_get_directs): Consider ENTRY when adding
+       "." and ".." for the rootnode.
+
+       * inode.c (read_node): Use ifind instead of diskfs_cached_lookup
+       and do not use diskfs_nput anymore.
+       * main.c (diskfs_S_fsys_getfile): New function.
+
 2002-10-06  Marcus Brinkmann  <address@hidden>
 
        * main.c (diskfs_server_version): Set to HURD_VERSION.
Index: hurd/fatfs/dir.c
diff -u hurd/fatfs/dir.c:1.1 hurd/fatfs/dir.c:1.2
--- hurd/fatfs/dir.c:1.1        Tue Dec  3 15:52:59 2002
+++ hurd/fatfs/dir.c    Fri May  9 20:12:29 2003
@@ -839,7 +839,7 @@
         filenames).  */
       if ((char)ep->name[0] == FAT_DIR_NAME_DELETED
          || (ep->attribute & FAT_DIR_ATTR_LABEL))
-         i--;
+       i--;
       bufp = bufp + FAT_DIR_REC_LEN;
     }
 
@@ -857,13 +857,10 @@
 
       /* The root directory in FAT file systems doesn't contain
         entries for DOT and DOTDOT, they are special cased below.  */
-      if (dp == diskfs_root_node && i < 2)
-       {
-         if (i == 0)
-           ep = &dot;
-         else
-           ep = &dotdot;
-       }
+      if (dp == diskfs_root_node && (i + entry == 0))
+        ep = &dot;
+      else if (dp == diskfs_root_node && (i + entry == 1))
+        ep = &dotdot;
       else
        ep = (struct dirrect *) bufp;
 
@@ -931,7 +928,7 @@
 
       /* And move along.  */
       datap = datap + reclen;
-      if (!(dp == diskfs_root_node && i < 2))
+      if (!(dp == diskfs_root_node && i + entry < 2))
        bufp = bufp + FAT_DIR_REC_LEN;
       i++;
     }
Index: hurd/fatfs/inode.c
diff -u hurd/fatfs/inode.c:1.1 hurd/fatfs/inode.c:1.2
--- hurd/fatfs/inode.c:1.1      Tue Dec  3 15:52:59 2002
+++ hurd/fatfs/inode.c  Fri May  9 20:12:29 2003
@@ -1,5 +1,5 @@
 /* inode.c - Inode management routines.
-   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.
    Modified for fatfs by Marcus Brinkmann <address@hidden>
 
    This file is part of the GNU Hurd.
@@ -273,18 +273,16 @@
     {
       if (buf == 0)
        {
-         err = diskfs_cached_lookup (vk.dir_inode, &dp);
-         if (err)
-           return err;
+         /* FIXME: We know intimately that the parent dir is locked
+            by libdiskfs.  The only case it is not locked is for NFS
+            (fsys_getfile) and we disabled that.  */
+         dp = ifind (vk.dir_inode);
       
          /* Map in the directory contents. */
          memobj = diskfs_get_filemap (dp, prot);
       
          if (memobj == MACH_PORT_NULL)
-           {
-             diskfs_nput (dp);
-             return errno;
-           }
+           return errno;
 
          buflen = round_page (dp->dn_stat.st_size);
          err = vm_map (mach_task_self (),
@@ -347,8 +345,6 @@
            {
              if (our_buf && buf)
                munmap ((caddr_t) buf, buflen);
-             if (dp)
-               diskfs_nput (dp);
              return err;
            }
          st->st_size = np->allocsize;
@@ -384,8 +380,6 @@
 
   if (our_buf && buf)
     munmap ((caddr_t) buf, buflen);
-  if (dp)
-    diskfs_nput (dp);
   return 0;
 }
 
Index: hurd/fatfs/main.c
diff -u hurd/fatfs/main.c:1.1 hurd/fatfs/main.c:1.2
--- hurd/fatfs/main.c:1.1       Tue Dec  3 15:52:59 2002
+++ hurd/fatfs/main.c   Fri May  9 20:12:29 2003
@@ -1,5 +1,5 @@
 /* main.c - FAT filesystem.
-   Copyright (C) 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
    Written by Thomas Bushnell, n/BSG and Marcus Brinkmann.
 
    This file is part of the GNU Hurd.
@@ -263,3 +263,15 @@
   abort ();
 }
 
+/* FIXME: libdiskfs doesn't lock the parent dir when looking up a node
+   for fsys_getfile, so we disable NFS.  */
+error_t
+diskfs_S_fsys_getfile (mach_port_t fsys,
+                      mach_port_t reply, mach_msg_type_name_t reply_type,
+                      uid_t *uids, mach_msg_type_number_t nuids,
+                      gid_t *gids, mach_msg_type_number_t ngids,
+                      char *handle, mach_msg_type_number_t handle_len,
+                      mach_port_t *file, mach_msg_type_name_t *file_type)
+{
+  return EOPNOTSUPP;
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]