From: Dave Chinner Date: Thu, 13 Mar 2014 08:14:43 +0000 (+1100) Subject: Merge branch 'xfs-O_TMPFILE-support' into for-next X-Git-Tag: v3.15-rc1~90^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fe986f9d88ab8079c91669b7f175081f15491a80;p=karo-tx-linux.git Merge branch 'xfs-O_TMPFILE-support' into for-next Conflicts: fs/xfs/xfs_trans_resv.c - fix for XFS_INODE_CLUSTER_SIZE macro removal --- fe986f9d88ab8079c91669b7f175081f15491a80 diff --cc fs/xfs/xfs_iops.c index bb3bb658e39c,cb06cc4d0003..89b07e43ca28 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@@ -1046,9 -1044,21 +1047,22 @@@ xfs_vn_fiemap return 0; } + STATIC int + xfs_vn_tmpfile( + struct inode *dir, + struct dentry *dentry, + umode_t mode) + { + int error; + + error = xfs_create_tmpfile(XFS_I(dir), dentry, mode); + + return -error; + } + static const struct inode_operations xfs_inode_operations = { .get_acl = xfs_get_acl, + .set_acl = xfs_set_acl, .getattr = xfs_vn_getattr, .setattr = xfs_vn_setattr, .setxattr = generic_setxattr, diff --cc fs/xfs/xfs_trans_resv.c index d2c8e4a6ee2a,76f9a02bc36b..ae368165244d --- a/fs/xfs/xfs_trans_resv.c +++ b/fs/xfs/xfs_trans_resv.c @@@ -211,6 -203,20 +211,19 @@@ xfs_calc_rename_reservation XFS_FSB_TO_B(mp, 1)))); } + /* + * For removing an inode from unlinked list at first, we can modify: + * the agi hash list and counters: sector size + * the on disk inode before ours in the agi hash list: inode cluster size + */ + STATIC uint + xfs_calc_iunlink_remove_reservation( + struct xfs_mount *mp) + { + return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) + - MAX((__uint16_t)XFS_FSB_TO_B(mp, 1), - (__uint16_t)XFS_INODE_CLUSTER_SIZE(mp)); ++ max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size); + } + /* * For creating a link to an inode: * the parent directory inode: inode size @@@ -391,11 -425,11 +432,11 @@@ xfs_calc_ifree_reservation { return XFS_DQUOT_LOGRES(mp) + xfs_calc_inode_res(mp, 1) + - xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) + + xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) + xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, 1)) + - max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size) + + xfs_calc_iunlink_remove_reservation(mp) + xfs_calc_buf_res(1, 0) + - xfs_calc_buf_res(2 + XFS_IALLOC_BLOCKS(mp) + + xfs_calc_buf_res(2 + mp->m_ialloc_blks + mp->m_in_maxlevels, 0) + xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1), XFS_FSB_TO_B(mp, 1));