Filesystem quota management in Go

Stephan demonstrate here how Go interacts with operating system and how he developed our quota library.

by Stephan Peijnik
Reading time 6 min
Stephan Peijnik
Software Development
Stephan Peijnik

Filesystem quotas are a rather simple concept. Instead of allowing every user to use all of the available space on a filesystem (or drive, to be less technical) each user is confined to limits - so called quotas. These quotas determine how much space an individual user or group may use. Currently Go does not include support for controlling filesystem quotas in its otherwise vast standard library. Unfortunately, no third-party libraries which would add this functionality exist either. One of our current project at the Anexia R&D department has to control quotas from within Go, therefore, we decided to come up with a solution of our own: a Go-native implementation. This gives me the opportunity to demonstrate how Go interacts with the underlying operating system at the deepest layers, namely at the syscall level. We will go over the steps again taken during the development of our solution. This will explain how the neccessary research was conducted and how we developed our quota library.