2
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
2
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of version 2 of the GNU General Public License as
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
6
7
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it would be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* Further, this software is distributed without any warranty that it is
13
* free of the rightful claim of any third person regarding infringement
14
* or the like. Any license provided herein, whether implied or
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.
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.
23
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
* Mountain View, CA 94043, or:
28
* For further information regarding this notice, see:
30
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
9
* This program is distributed in the hope that it would be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write the Free Software Foundation,
16
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
37
* Wrapper around call to libxfs_ialloc. Takes care of committing and
38
* allocating a new transaction as needed.
40
* Originally there were two copies of this code - one in mkfs, the
41
* other in repair - now there is just the one.
55
xfs_buf_t *ialloc_context;
61
ialloc_context = (xfs_buf_t *)0;
62
error = libxfs_ialloc(*tp, pip, mode, nlink, rdev, cr, (xfs_prid_t) 0,
63
1, &ialloc_context, &call_again, &ip);
68
xfs_trans_bhold(*tp, ialloc_context);
69
ntp = xfs_trans_dup(*tp);
70
xfs_trans_commit(*tp, 0, NULL);
72
if ((i = xfs_trans_reserve(*tp, 0, 0, 0, 0, 0))) {
73
fprintf(stderr, _("%s: cannot reserve space: %s\n"),
74
progname, strerror(errno));
77
xfs_trans_bjoin(*tp, ialloc_context);
78
error = libxfs_ialloc(*tp, pip, mode, nlink, rdev, cr,
79
(xfs_prid_t) 0, 1, &ialloc_context,
94
23
* Change the requested timestamp in the given inode.
96
25
* This was once shared with the kernel, but has diverged to the point
150
if (pip && (pip->i_d.di_flags & XFS_DIFLAG_ANY)) {
153
if ((mode & S_IFMT) == S_IFDIR) {
154
if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT)
155
di_flags |= XFS_DIFLAG_RTINHERIT;
156
if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
157
di_flags |= XFS_DIFLAG_EXTSZINHERIT;
158
ip->i_d.di_extsize = pip->i_d.di_extsize;
161
if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) {
162
di_flags |= XFS_DIFLAG_REALTIME;
164
if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
165
di_flags |= XFS_DIFLAG_EXTSIZE;
166
ip->i_d.di_extsize = pip->i_d.di_extsize;
169
if (pip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
170
di_flags |= XFS_DIFLAG_PROJINHERIT;
171
ip->i_d.di_flags |= di_flags;
216
175
ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
217
176
ip->i_df.if_flags = XFS_IFEXTENTS;
737
697
for (i = 0; i < dabuf->nbuf; i++)
738
698
xfs_trans_bjoin(tp, dabuf->bps[i]);
702
* Wrapper around call to libxfs_ialloc. Takes care of committing and
703
* allocating a new transaction as needed.
705
* Originally there were two copies of this code - one in mkfs, the
706
* other in repair - now there is just the one.
719
boolean_t call_again;
721
xfs_buf_t *ialloc_context;
726
call_again = B_FALSE;
727
ialloc_context = (xfs_buf_t *)0;
728
error = libxfs_ialloc(*tp, pip, mode, nlink, rdev, cr, fsx,
729
1, &ialloc_context, &call_again, &ip);
734
xfs_trans_bhold(*tp, ialloc_context);
735
ntp = xfs_trans_dup(*tp);
736
xfs_trans_commit(*tp, 0, NULL);
738
if ((i = xfs_trans_reserve(*tp, 0, 0, 0, 0, 0))) {
739
fprintf(stderr, _("%s: cannot reserve space: %s\n"),
740
progname, strerror(errno));
743
xfs_trans_bjoin(*tp, ialloc_context);
744
error = libxfs_ialloc(*tp, pip, mode, nlink, rdev, cr,
745
fsx, 1, &ialloc_context,