aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_sf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dir2_sf.c')
-rw-r--r--fs/xfs/xfs_dir2_sf.c59
1 files changed, 19 insertions, 40 deletions
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c
index 6bbc61674411..ec8e7476c8b7 100644
--- a/fs/xfs/xfs_dir2_sf.c
+++ b/fs/xfs/xfs_dir2_sf.c
@@ -1,60 +1,39 @@
1/* 1/*
2 * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. 2 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
3 * 4 *
4 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or
5 * under the terms of version 2 of the GNU General Public License as 6 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
7 * 8 *
8 * This program is distributed in the hope that it would be useful, but 9 * This program is distributed in the hope that it would be useful,
9 * WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
11 * 13 *
12 * Further, this software is distributed without any warranty that it is 14 * You should have received a copy of the GNU General Public License
13 * free of the rightful claim of any third person regarding infringement 15 * along with this program; if not, write the Free Software Foundation,
14 * or the like. Any license provided herein, whether implied or 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
25 *
26 * http://www.sgi.com
27 *
28 * For further information regarding this notice, see:
29 *
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31 */ 17 */
32
33/*
34 * xfs_dir2_sf.c
35 * Shortform directory implementation for v2 directories.
36 */
37
38#include "xfs.h" 18#include "xfs.h"
39 19#include "xfs_fs.h"
40#include "xfs_macros.h"
41#include "xfs_types.h" 20#include "xfs_types.h"
42#include "xfs_inum.h"
43#include "xfs_log.h" 21#include "xfs_log.h"
22#include "xfs_inum.h"
44#include "xfs_trans.h" 23#include "xfs_trans.h"
45#include "xfs_sb.h" 24#include "xfs_sb.h"
46#include "xfs_dir.h" 25#include "xfs_dir.h"
47#include "xfs_dir2.h" 26#include "xfs_dir2.h"
48#include "xfs_dmapi.h" 27#include "xfs_dmapi.h"
49#include "xfs_mount.h" 28#include "xfs_mount.h"
29#include "xfs_da_btree.h"
50#include "xfs_bmap_btree.h" 30#include "xfs_bmap_btree.h"
51#include "xfs_attr_sf.h"
52#include "xfs_dir_sf.h" 31#include "xfs_dir_sf.h"
53#include "xfs_dir2_sf.h" 32#include "xfs_dir2_sf.h"
33#include "xfs_attr_sf.h"
54#include "xfs_dinode.h" 34#include "xfs_dinode.h"
55#include "xfs_inode_item.h"
56#include "xfs_inode.h" 35#include "xfs_inode.h"
57#include "xfs_da_btree.h" 36#include "xfs_inode_item.h"
58#include "xfs_dir_leaf.h" 37#include "xfs_dir_leaf.h"
59#include "xfs_error.h" 38#include "xfs_error.h"
60#include "xfs_dir2_data.h" 39#include "xfs_dir2_data.h"
@@ -107,7 +86,7 @@ xfs_dir2_block_sfsize(
107 int isdotdot; /* entry is ".." */ 86 int isdotdot; /* entry is ".." */
108 xfs_mount_t *mp; /* mount structure pointer */ 87 xfs_mount_t *mp; /* mount structure pointer */
109 int namelen; /* total name bytes */ 88 int namelen; /* total name bytes */
110 xfs_ino_t parent; /* parent inode number */ 89 xfs_ino_t parent = 0; /* parent inode number */
111 int size=0; /* total computed size */ 90 int size=0; /* total computed size */
112 91
113 mp = dp->i_mount; 92 mp = dp->i_mount;
@@ -298,11 +277,11 @@ xfs_dir2_sf_addname(
298 int incr_isize; /* total change in size */ 277 int incr_isize; /* total change in size */
299 int new_isize; /* di_size after adding name */ 278 int new_isize; /* di_size after adding name */
300 int objchange; /* changing to 8-byte inodes */ 279 int objchange; /* changing to 8-byte inodes */
301 xfs_dir2_data_aoff_t offset; /* offset for new entry */ 280 xfs_dir2_data_aoff_t offset = 0; /* offset for new entry */
302 int old_isize; /* di_size before adding name */ 281 int old_isize; /* di_size before adding name */
303 int pick; /* which algorithm to use */ 282 int pick; /* which algorithm to use */
304 xfs_dir2_sf_t *sfp; /* shortform structure */ 283 xfs_dir2_sf_t *sfp; /* shortform structure */
305 xfs_dir2_sf_entry_t *sfep; /* shortform entry */ 284 xfs_dir2_sf_entry_t *sfep = NULL; /* shortform entry */
306 285
307 xfs_dir2_trace_args("sf_addname", args); 286 xfs_dir2_trace_args("sf_addname", args);
308 ASSERT(xfs_dir2_sf_lookup(args) == ENOENT); 287 ASSERT(xfs_dir2_sf_lookup(args) == ENOENT);