From: jeff.liu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org Subject: [PATCH 10/12] container quota: bill container inodes alloc/free on ext4. Date: Wed, 30 May 2012 22:59:04 +0800 Message-ID: <1338389946-13711-11-git-send-email-jeff.liu@oracle.com> References: <1338389946-13711-1-git-send-email-jeff.liu@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: tytso-3s7WtUTddSA@public.gmane.org, jack-AlSwsSmVLrQ@public.gmane.org, david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org, hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, bpm-sJ/iWh9BUns@public.gmane.org, christopher.jones-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, tm-d1IQDZat3X0@public.gmane.org, linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, chris.mason-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, tinguely-sJ/iWh9BUns@public.gmane.org To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Return-path: In-Reply-To: <1338389946-13711-1-git-send-email-jeff.liu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: linux-ext4.vger.kernel.org Bill up container inodes allocation and free on ext4. Signed-off-by: Jie Liu --- fs/ext4/ialloc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 9f9acac..510fa41 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -31,6 +31,8 @@ #include +#include "../ns_quotaops.h" + /* * ialloc.c contains the inodes allocation and deallocation routines */ @@ -233,6 +235,7 @@ void ext4_free_inode(handle_t *handle, struct inode *inode) dquot_initialize(inode); ext4_xattr_delete_inode(handle, inode); dquot_free_inode(inode); + ns_dquot_free_inode(inode); dquot_drop(inode); is_directory = S_ISDIR(inode->i_mode); @@ -861,6 +864,10 @@ got: if (err) goto fail_drop; + err = ns_dquot_alloc_inode(inode); + if (err) + goto fail_drop; + err = ext4_init_acl(handle, inode, dir); if (err) goto fail_free_drop; @@ -902,6 +909,7 @@ really_out: fail_free_drop: dquot_free_inode(inode); + ns_dquot_free_inode(inode); fail_drop: dquot_drop(inode); -- 1.7.9