aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_block.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 14:40:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 14:40:24 -0400
commit239dab4636f7f5f971ac39b5ca84254cff112cac (patch)
treeba16a01035dd13bb87795911da436b6295f9b341 /fs/xfs/xfs_dir2_block.c
parentf1c410885288e0042099960ee9e0c260dfea4cfb (diff)
parentc31ad439e8d111bf911c9cc80619cebde411a44d (diff)
Merge tag 'for-linus-v3.11-rc1-2' of git://oss.sgi.com/xfs/xfs
Pull more xfs updates from Ben Myers: "Here are a fix for xfs_fsr, a cleanup in bulkstat, a cleanup in xfs_open_by_handle, updated mount options documentation, a cleanup in xfs_bmapi_write, a fix for the size of dquot log reservations, a fix for sgid inheritance when acls are in use, a fix for cleaning up quotainfo structures, and some more of the work which allows group and project quotas to be used together. We had a few more in this last quota category that we might have liked to get in, but it looks there are still a few items that need to be addressed. - fix for xfs_fsr returning -EINVAL - cleanup in xfs_bulkstat - cleanup in xfs_open_by_handle - update mount options documentation - clean up local format handling in xfs_bmapi_write - fix dquot log reservations which were too small - fix sgid inheritance for subdirectories when default acls are in use - add project quota fields to various structures - fix teardown of quotainfo structures when quotas are turned off" * tag 'for-linus-v3.11-rc1-2' of git://oss.sgi.com/xfs/xfs: xfs: Fix the logic check for all quotas being turned off xfs: Add pquota fields where gquota is used. xfs: fix sgid inheritance for subdirectories inheriting default acls [V3] xfs: dquot log reservations are too small xfs: remove local fork format handling from xfs_bmapi_write() xfs: update mount options documentation xfs: use get_unused_fd_flags(0) instead of get_unused_fd() xfs: clean up unused codes at xfs_bulkstat() xfs: use XFS_BMAP_BMDR_SPACE vs. XFS_BROOT_SIZE_ADJ
Diffstat (limited to 'fs/xfs/xfs_dir2_block.c')
-rw-r--r--fs/xfs/xfs_dir2_block.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 09aea0247d96..5e7fbd72cf52 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -29,6 +29,7 @@
29#include "xfs_dinode.h" 29#include "xfs_dinode.h"
30#include "xfs_inode.h" 30#include "xfs_inode.h"
31#include "xfs_inode_item.h" 31#include "xfs_inode_item.h"
32#include "xfs_bmap.h"
32#include "xfs_buf_item.h" 33#include "xfs_buf_item.h"
33#include "xfs_dir2.h" 34#include "xfs_dir2.h"
34#include "xfs_dir2_format.h" 35#include "xfs_dir2_format.h"
@@ -1164,13 +1165,15 @@ xfs_dir2_sf_to_block(
1164 __be16 *tagp; /* end of data entry */ 1165 __be16 *tagp; /* end of data entry */
1165 xfs_trans_t *tp; /* transaction pointer */ 1166 xfs_trans_t *tp; /* transaction pointer */
1166 struct xfs_name name; 1167 struct xfs_name name;
1168 struct xfs_ifork *ifp;
1167 1169
1168 trace_xfs_dir2_sf_to_block(args); 1170 trace_xfs_dir2_sf_to_block(args);
1169 1171
1170 dp = args->dp; 1172 dp = args->dp;
1171 tp = args->trans; 1173 tp = args->trans;
1172 mp = dp->i_mount; 1174 mp = dp->i_mount;
1173 ASSERT(dp->i_df.if_flags & XFS_IFINLINE); 1175 ifp = XFS_IFORK_PTR(dp, XFS_DATA_FORK);
1176 ASSERT(ifp->if_flags & XFS_IFINLINE);
1174 /* 1177 /*
1175 * Bomb out if the shortform directory is way too short. 1178 * Bomb out if the shortform directory is way too short.
1176 */ 1179 */
@@ -1179,22 +1182,23 @@ xfs_dir2_sf_to_block(
1179 return XFS_ERROR(EIO); 1182 return XFS_ERROR(EIO);
1180 } 1183 }
1181 1184
1182 oldsfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; 1185 oldsfp = (xfs_dir2_sf_hdr_t *)ifp->if_u1.if_data;
1183 1186
1184 ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); 1187 ASSERT(ifp->if_bytes == dp->i_d.di_size);
1185 ASSERT(dp->i_df.if_u1.if_data != NULL); 1188 ASSERT(ifp->if_u1.if_data != NULL);
1186 ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(oldsfp->i8count)); 1189 ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(oldsfp->i8count));
1190 ASSERT(dp->i_d.di_nextents == 0);
1187 1191
1188 /* 1192 /*
1189 * Copy the directory into a temporary buffer. 1193 * Copy the directory into a temporary buffer.
1190 * Then pitch the incore inode data so we can make extents. 1194 * Then pitch the incore inode data so we can make extents.
1191 */ 1195 */
1192 sfp = kmem_alloc(dp->i_df.if_bytes, KM_SLEEP); 1196 sfp = kmem_alloc(ifp->if_bytes, KM_SLEEP);
1193 memcpy(sfp, oldsfp, dp->i_df.if_bytes); 1197 memcpy(sfp, oldsfp, ifp->if_bytes);
1194 1198
1195 xfs_idata_realloc(dp, -dp->i_df.if_bytes, XFS_DATA_FORK); 1199 xfs_idata_realloc(dp, -ifp->if_bytes, XFS_DATA_FORK);
1200 xfs_bmap_local_to_extents_empty(dp, XFS_DATA_FORK);
1196 dp->i_d.di_size = 0; 1201 dp->i_d.di_size = 0;
1197 xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
1198 1202
1199 /* 1203 /*
1200 * Add block 0 to the inode. 1204 * Add block 0 to the inode.