From patchwork Fri Feb 13 22:12:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 23133 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id A9BF1DDDB0 for ; Sat, 14 Feb 2009 09:13:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761238AbZBMWNf (ORCPT ); Fri, 13 Feb 2009 17:13:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760846AbZBMWNf (ORCPT ); Fri, 13 Feb 2009 17:13:35 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:60802 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753328AbZBMWNe (ORCPT ); Fri, 13 Feb 2009 17:13:34 -0500 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id n1DMCK8I027804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Feb 2009 14:12:21 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id n1DMCKB8027990; Fri, 13 Feb 2009 14:12:20 -0800 Message-Id: <200902132212.n1DMCKB8027990@imap1.linux-foundation.org> Subject: + ext4-use-unsigned-instead-of-int-for-type-of-blocksize-in-fs-ext4-nameic.patch added to -mm tree To: mm-commits@vger.kernel.org Cc: yjwei@cn.fujitsu.com, linux-ext4@vger.kernel.org, tytso@mit.edu From: akpm@linux-foundation.org Date: Fri, 13 Feb 2009 14:12:20 -0800 X-Spam-Status: No, hits=-2.942 required=5 tests=AWL,BAYES_00 X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The patch titled ext4: use unsigned instead of int for type of blocksize in fs/ext4/namei.c has been added to the -mm tree. Its filename is ext4-use-unsigned-instead-of-int-for-type-of-blocksize-in-fs-ext4-nameic.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: ext4: use unsigned instead of int for type of blocksize in fs/ext4/namei.c From: Wei Yongjun - Use unsigned instead of int for the parameter which carries a blocksize. (ported from Wei Yongjun's ext3 patch). - coding-style fixes - rename `size' to `blocksize'] Cc: Wei Yongjun Cc: Theodore Ts'o Cc: Signed-off-by: Andrew Morton --- fs/ext4/namei.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff -puN fs/ext4/namei.c~ext4-use-unsigned-instead-of-int-for-type-of-blocksize-in-fs-ext4-nameic fs/ext4/namei.c --- a/fs/ext4/namei.c~ext4-use-unsigned-instead-of-int-for-type-of-blocksize-in-fs-ext4-nameic +++ a/fs/ext4/namei.c @@ -161,12 +161,12 @@ static struct dx_frame *dx_probe(const s struct dx_frame *frame, int *err); static void dx_release(struct dx_frame *frames); -static int dx_make_map(struct ext4_dir_entry_2 *de, int size, +static int dx_make_map(struct ext4_dir_entry_2 *de, unsigned blocksize, struct dx_hash_info *hinfo, struct dx_map_entry map[]); static void dx_sort_map(struct dx_map_entry *map, unsigned count); static struct ext4_dir_entry_2 *dx_move_dirents(char *from, char *to, struct dx_map_entry *offsets, int count); -static struct ext4_dir_entry_2* dx_pack_dirents(char *base, int size); +static struct ext4_dir_entry_2 *dx_pack_dirents(char *base, unsigned blocksize); static void dx_insert_block(struct dx_frame *frame, u32 hash, ext4_lblk_t block); static int ext4_htree_next_block(struct inode *dir, __u32 hash, @@ -713,15 +713,14 @@ errout: * Create map of hash values, offsets, and sizes, stored at end of block. * Returns number of entries mapped. */ -static int dx_make_map (struct ext4_dir_entry_2 *de, int size, - struct dx_hash_info *hinfo, struct dx_map_entry *map_tail) +static int dx_make_map(struct ext4_dir_entry_2 *de, unsigned blocksize, + struct dx_hash_info *hinfo, struct dx_map_entry *map_tail) { int count = 0; - char *base = (char *) de; + char *base = (char *)de; struct dx_hash_info h = *hinfo; - while ((char *) de < base + size) - { + while ((char *) de < base + blocksize) { if (de->name_len && de->inode) { ext4fs_dirhash(de->name, de->name_len, &h); map_tail--; @@ -1130,13 +1129,14 @@ dx_move_dirents(char *from, char *to, st * Compact each dir entry in the range to the minimal rec_len. * Returns pointer to last entry in range. */ -static struct ext4_dir_entry_2* dx_pack_dirents(char *base, int size) +static struct ext4_dir_entry_2 *dx_pack_dirents(char *base, unsigned blocksize) { - struct ext4_dir_entry_2 *next, *to, *prev, *de = (struct ext4_dir_entry_2 *) base; + struct ext4_dir_entry_2 *next, *to, *prev; + struct ext4_dir_entry_2 *de = (struct ext4_dir_entry_2 *)base; unsigned rec_len = 0; prev = to = de; - while ((char*)de < base + size) { + while ((char *)de < base + blocksize) { next = ext4_next_entry(de); if (de->inode && de->name_len) { rec_len = EXT4_DIR_REC_LEN(de->name_len);