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

Re: [Minios-devel] [UNIKRAFT PATCH v2 8/8] lib/uk9p: Clunk fids on fid release



On 29.06.19 10:56, Cristian Banu wrote:
On fid release, the 9p server is sent a clunk message to disassociate
the fid from its previous association, such that it has a clean slate
on both the server and the client when it will eventually be reused.

Signed-off-by: Cristian Banu <cristb@xxxxxxxxx>
---
  lib/uk9p/9pdev.c | 19 +++++++++++++++++--
  1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/lib/uk9p/9pdev.c b/lib/uk9p/9pdev.c
index 11ca4d965893..eead4ff63442 100644
--- a/lib/uk9p/9pdev.c
+++ b/lib/uk9p/9pdev.c
@@ -42,6 +42,7 @@
  #include <uk/bitmap.h>
  #include <uk/refcount.h>
  #include <uk/wait.h>
+#include <uk/9p.h>
  #include <uk/9pdev.h>
  #include <uk/9pdev_trans.h>
  #include <uk/9preq.h>
@@ -95,7 +96,7 @@ static int _fid_mgmt_add_fid_locked(struct uk_9pdev_fid_mgmt 
*fid_mgmt,
static void _fid_mgmt_del_fid_locked(struct uk_9pdev_fid_mgmt *fid_mgmt,
                                struct uk_9pfid *fid,
-                               int move_to_freelist)
+                               bool move_to_freelist)

Couldn't this be bool in the patches even before?

  {
        uk_list_del(&fid->_list);
@@ -433,9 +434,23 @@ void uk_9pdev_fid_release(struct uk_9pfid *fid)
  {
        struct uk_9pdev *dev = fid->_dev;
        unsigned long flags;
+       bool move_to_freelist = false;
+       int rc;
+ /* First clunk the fid. */
+       rc = uk_9p_do_clunk(fid->_dev, fid);
+       if (rc < 0) {
+               uk_pr_warn("Could not clunk fid %d: %d\n", fid->fid, rc);
+               goto out;
+       }
+
+       /* If successfully clunked, move it to a freelist. */
+       move_to_freelist = true;
+
+out:
+       /* Then remove it from any internal data structures. */
        ukplat_spin_lock_irqsave(&dev->_fid_mgmt.spinlock, flags);
-       _fid_mgmt_del_fid_locked(&dev->_fid_mgmt, fid, 1);
+       _fid_mgmt_del_fid_locked(&dev->_fid_mgmt, fid, move_to_freelist);
        ukplat_spin_unlock_irqrestore(&dev->_fid_mgmt.spinlock, flags);
  }

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.