
 
 p a c k a g e   q u o t a   / /   i m p o r t   " i m u s l a b . c o m / a r o z _ o n l i n e / m o d / q u o t a " 
 
 
 
 
 
 T Y P E S 
 
 
 
 t y p e   Q u o t a H a n d l e r   s t r u c t   { 
 
 	 T o t a l S t o r a g e Q u o t a   i n t 6 4 
 
 	 U s e d S t o r a g e Q u o t a     i n t 6 4 
 
 	 / /   H a s   u n e x p o r t e d   f i e l d s . 
 
 } 
 
 
 
 f u n c   N e w U s e r Q u o t a H a n d l e r ( d a t a b a s e   * d b . D a t a b a s e ,   u s e r n a m e   s t r i n g ,   f s h   [ ] * f s . F i l e S y s t e m H a n d l e r ,   d e f a u l t Q u o t a   i n t 6 4 )   * Q u o t a H a n d l e r 
 
         C r e a t e   a   s t o r a g e   q u o t a t i o n   h a n d l e r   f o r   t h i s   u s e r 
 
 
 
 f u n c   ( q   * Q u o t a H a n d l e r )   A l l o c a t e S p a c e ( f i l e s i z e   i n t 6 4 )   e r r o r 
 
         C l a i m   a   s p a c e   f o r   t h e   g i v e n   f i l e   a n d   s e t   t h e   f i l e   o w n e r s h i p   t o   t h i s   u s e r 
 
 
 
 f u n c   ( q   * Q u o t a H a n d l e r )   C a l c u l a t e Q u o t a U s a g e ( ) 
 
 
 
 f u n c   ( q   * Q u o t a H a n d l e r )   G e t U s e r S t o r a g e Q u o t a ( )   i n t 6 4 
 
 
 
 f u n c   ( q   * Q u o t a H a n d l e r )   H a v e S p a c e ( s i z e   i n t 6 4 )   b o o l 
 
 
 
 f u n c   ( q   * Q u o t a H a n d l e r )   R e c l a i m S p a c e ( f i l e s i z e   i n t 6 4 )   e r r o r 
 
         R e c l a i m   f i l e   o c c u p i e d   s p a c e   ( C a l l   t h i s   b e f o r e   r e m o v i n g   i t ) 
 
 
 
 f u n c   ( q   * Q u o t a H a n d l e r )   R e m o v e U s e r Q u o t a ( ) 
 
 
 
 f u n c   ( q   * Q u o t a H a n d l e r )   S e t U s e r S t o r a g e Q u o t a ( q u o t a   i n t 6 4 ) 
 
         S e t   a n d   G e t   t h e   u s e r   s t o r a g e   q u o t a 
 
 
 
 f u n c   ( q   * Q u o t a H a n d l e r )   U p d a t e U s e r S t o r a g e P o o l ( f s h   [ ] * f s . F i l e S y s t e m H a n d l e r ) 
 
         U p d a t e   t h e   u s e r ' s   s t o r a g e   p o o l   t o   n e w   o n e 
 
 
 
 