UFS and BIO_DELETE

January 30, 2007 by · 17 Comments 

BIO_DELETE is yet another I/O request. The two most famous I/O requests are of course BIO_READ and BIO_WRITE.

The BIO_DELETE bascially can be used to say “I don’t need this range of data anymore”. The underlying provider, which receives such a request can do various things, depending on its purpose. The geli(8) GEOM class, which implements disk encryption can, for example, fill the range of data with random bits. Memory- and swap-backed md(4) device could just free memory. Unfortunately there is currently no support for BIO_DELETE on file systems side. When UFS free some blocks, it should send BIO_DELETE.

And this is bascially what I recently implemented. Actually, it was surprisingly easy to implement, but it is not implemented correctly yet. The problem is that UFS use the buffer cache for writes. If it sends delayed write request, which is ment to update blocks used by the given inode and update free blocks bitmap I can’t send BIO_DELETE immediately. Sending BIO_DELETE right away means, that if a system crash or a power failure occurs between BIO_DELETE and inode update, we may end up with a file pointing to a garbage.

Why BIO_DELETE is worth implementing? Because once it’s in place we can implement a lot of really nice features on top of it. Let me name a few:

- md swap-backed temporary file system, on which when you delete a file, memory is freed,

- blocks deallocation for gvirstor; gvirstor is a GEOM class implemented by Ivan Voras during Google SoC, which allows to initially define very large virtual provider, but with limited physical storage available, which one can add when needed; unfortunately currently when file is deleted, gvirstor has no way to reassign those blocks elsewhere,

- GEOM compresion layer; actually it could be implemented without BIO_DELETE, but compression layer is about saving space, right? Actually adding compression to gvirstor may be not a bad idea,
- maybe gjournal can hold its gjournal in free blocks and migrate journal when blocks are allocated?:) Silly idea, but having BIO_DELETE in place we can tell which blocks are really used by the file system and this is very powerful information.

About pjd

Comments

17 Responses to “UFS and BIO_DELETE”
  1. Maledictus says:

    Yay. Really cool stuff, thanks for your work!

    Apropos BIO_*: I always wondered how sync and fflush could do their work without the BIO_FLUSH request you recently added.

  2. Ender says:

    Thanks for your work!

  3. Nix says:

    Just wanted to say thanks for all the hard work.

  4. Advance Cash says:

    If your friend aches for a brisk and manageable cash advance loans just search for for http://www.2minutecashadvance.com . They are convenient for loan seekers in Michigan and even for applicants from Wisconsin.

  5. zxevil162 says:

    YbjkqA cool blog, man!

  6. zxevil161 says:

    4913CY U from Russia?

  7. Max says:

    Please keep these excellent posts coming.

  8. wery good, respect!

  9. ? ??? ????, ???? ?? ?????

  10. ? ??? ????, ???? ?? ?????

  11. pay per head says:

    great post. thank you for sharing. all my respects for you and your work!

  12. pph software says:

    Your blog is distinctive. I have found your blog innovative. You have chosen very incredible theme for your sketch. I cherished it.

Trackbacks

Check out what others are saying about this post...
  1. $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,…

    $anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,nc…

  2. Kennethssportsgrid7567$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsb…

    Kennethssportsgrid7567$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsboo…



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!