]> arthur.barton.de Git - netatalk.git/commitdiff
delete files from the cache in afp_delete
authorFrank Lahm <franklahm@googlemail.com>
Mon, 5 Jul 2010 12:59:35 +0000 (14:59 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 5 Jul 2010 12:59:35 +0000 (14:59 +0200)
etc/afpd/filedir.c
etc/cnid_dbd/comm.c
etc/cnid_dbd/main.c

index fd7cc8899e46283f3c90cf8c3972dbb1f0cf711e..bf3a8c0681c1fea7b5ab371ef53a923923716998 100644 (file)
@@ -43,6 +43,7 @@ char *strchr (), *strrchr ();
 #include <atalk/bstradd.h>
 
 #include "directory.h"
+#include "dircache.h"
 #include "desktop.h"
 #include "volume.h"
 #include "fork.h"
@@ -581,6 +582,12 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size
         }
         else {
             rc = deletefile(vol, -1, upath, 1);
+
+            struct dir *cachedfile;
+            if (cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath))) {
+                dircache_remove(vol, dir, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX);
+                dir_free(cachedfile);
+            }
         }
     }
     if ( rc == AFP_OK ) {
index 04e43420707684dcc3f5c974bcac4605094ddf32..0dae7be74f13ded2e1043f975422dafcb1303690 100644 (file)
@@ -264,6 +264,9 @@ int comm_rcv(struct cnid_dbd_rqst *rqst, time_t timeout, const sigset_t *sigmask
 
     if (!cur_fd)
         return 0;
+
+    LOG(log_maxdebug, logtype_cnid, "comm_rcv: got data on fd %u", cur_fd);
+
     nametmp = rqst->name;
     if ((b = read(cur_fd, rqst, sizeof(struct cnid_dbd_rqst))) != sizeof(struct cnid_dbd_rqst)) {
         if (b)
@@ -282,6 +285,8 @@ int comm_rcv(struct cnid_dbd_rqst *rqst, time_t timeout, const sigset_t *sigmask
        needs zero terminated strings. */
     rqst->name[rqst->namelen] = '\0';
 
+    LOG(log_maxdebug, logtype_cnid, "comm_rcv: got %u bytes", b + rqst->namelen);
+
     return 1;
 }
 
index 42cf28489f14e61c055a73a73eb9a75a74742347..a715c19a4cea5e1ad2b1cc048c0218cf96507413 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: main.c,v 1.16 2009-11-25 14:59:15 franklahm Exp $
- *
  * Copyright (C) Joerg Lenneis 2003
  * Copyright (c) Frank Lahm 2009
  * All Rights Reserved.  See COPYING.
@@ -181,7 +179,7 @@ static int loop(struct db_param *dbp)
                 ret = -1;
                 break;
             }
-            
+
             if ((cret = comm_snd(&rply)) < 0 || ret < 0) {
                 dbif_txn_abort(dbd);
                 return -1;