fn finalize<'a, 'id: 'a>(&mut self, ctx: Self::Ctx<'a, 'id>) {
        let (tx, ctx) = ctx;
        if self.inner.get_mut().valid && self.inner.get_mut().nlink == 0 {
            // inode has no links and no other references: truncate and free.

            // self->ref == 1 means no other process can have self locked,
            // so this acquiresleep() won't block (or deadlock).
            let mut ip = self.lock(ctx);

            ip.itrunc(tx, ctx);
            ip.deref_inner_mut().typ = InodeType::None;
            ip.update(tx, ctx);
            ip.deref_inner_mut().valid = false;

            ip.free(ctx);
        }
    }
/// Drop a reference to an in-memory inode.
/// If that was the last reference, the inode table entry can
/// be recycled.
/// If that was the last reference and the inode has no links
/// to it, free the inode (and its content) on disk.
/// All calls to Inode::put() must be inside a transaction in
/// case it has to free the inode.
Drop a reference to an in-memory inode.
If that was the last reference, the inode table entry can
be recycled.
If that was the last reference and the inode has no links
to it, free the inode (and its content) on disk.
All calls to Inode::put() must be inside a transaction in
case it has to free the inode.
Drop a reference to an in - memory inode . If that was the last reference the inode table entry can be recycled . If that was the last reference and the inode has no links to it free the inode ( and its content ) on disk . All calls to Inode :: put () must be inside a transaction in case it has to free the inode .
fn finalize<'a, 'id: 'a>(&mut self, ctx: Self::Ctx<'a, 'id>) {
        let (tx, ctx) = ctx;
        if self.inner.get_mut().valid && self.inner.get_mut().nlink == 0 {
            // inode has no links and no other references: truncate and free.
            // self->ref == 1 means no other process can have self locked,
            // so this acquiresleep() won't block (or deadlock).
            let mut ip = self.lock(ctx);
            ip.itrunc(tx, ctx);
            ip.deref_inner_mut().typ = InodeType::None;
            ip.update(tx, ctx);
            ip.deref_inner_mut().valid = false;
            ip.free(ctx);
        }
    }
fn finalize < ' a , ' id : ' a > ( & mut self , ctx : Self :: Ctx < ' a , ' id > ) { let ( tx , ctx ) = ctx ; if self . inner . get_mut ( ) . valid && self . inner . get_mut ( ) . nlink == 0 { // inode has no links and no other references: truncate and free. // self->ref == 1 means no other process can have self locked, // so this acquiresleep() won't block (or deadlock). let mut ip = self . lock ( ctx ) ; ip . itrunc ( tx , ctx ) ; ip . deref_inner_mut ( ) . typ = InodeType :: None ; ip . update ( tx , ctx ) ; ip . deref_inner_mut ( ) . valid = false ; ip . free ( ctx ) ; } }
Drop a reference to an in-memory inode.
Drop a reference to an in - memory inode .
&mut self
ctx
Self::Ctx<'a, 'id>
&mut self
ctx
Self::Ctx<'a, 'id>