From patchwork Wed Feb 10 20:00:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 78563 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1AK0pQD002918 for ; Wed, 10 Feb 2010 20:00:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755948Ab0BJUAN (ORCPT ); Wed, 10 Feb 2010 15:00:13 -0500 Received: from smtp.mujha-vel.cz ([81.30.225.246]:46283 "EHLO smtp.mujha-vel.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751452Ab0BJUAL (ORCPT ); Wed, 10 Feb 2010 15:00:11 -0500 Received: from [217.66.174.142] (helo=localhost.localdomain) by smtp.mujha-vel.cz with esmtp (Exim 4.63) (envelope-from ) id 1NfIjK-0006Ih-88; Wed, 10 Feb 2010 21:00:10 +0100 From: Jiri Slaby To: chris.mason@oracle.com Cc: linux-kernel@vger.kernel.org, jirislaby@gmail.com, linux-btrfs@vger.kernel.org Subject: [PATCH 1/1] FS: btrfs, use helpers for rlimits Date: Wed, 10 Feb 2010 21:00:09 +0100 Message-Id: <1265832009-8070-1-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 1.6.6.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 10 Feb 2010 20:00:51 +0000 (UTC) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c41db6d..5aa0cef 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3256,8 +3256,7 @@ static int btrfs_setattr_size(struct inode *inode, struct iattr *attr) return 0; if (attr->ia_size > inode->i_size) { - unsigned long limit; - limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; + unsigned long limit = rlimit(RLIMIT_FSIZE); if (attr->ia_size > inode->i_sb->s_maxbytes) return -EFBIG; if (limit != RLIM_INFINITY && attr->ia_size > limit) {