aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_lrw.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_lrw.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c72
1 files changed, 22 insertions, 50 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index acab58c48043..279e9bc92aba 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -1,44 +1,25 @@
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 * fs/xfs/linux/xfs_lrw.c (Linux Read Write stuff)
34 *
35 */
36
37#include "xfs.h" 18#include "xfs.h"
38
39#include "xfs_fs.h" 19#include "xfs_fs.h"
40#include "xfs_inum.h" 20#include "xfs_bit.h"
41#include "xfs_log.h" 21#include "xfs_log.h"
22#include "xfs_inum.h"
42#include "xfs_trans.h" 23#include "xfs_trans.h"
43#include "xfs_sb.h" 24#include "xfs_sb.h"
44#include "xfs_ag.h" 25#include "xfs_ag.h"
@@ -48,18 +29,17 @@
48#include "xfs_dmapi.h" 29#include "xfs_dmapi.h"
49#include "xfs_quota.h" 30#include "xfs_quota.h"
50#include "xfs_mount.h" 31#include "xfs_mount.h"
51#include "xfs_alloc_btree.h"
52#include "xfs_bmap_btree.h" 32#include "xfs_bmap_btree.h"
33#include "xfs_alloc_btree.h"
53#include "xfs_ialloc_btree.h" 34#include "xfs_ialloc_btree.h"
54#include "xfs_btree.h"
55#include "xfs_ialloc.h"
56#include "xfs_attr_sf.h"
57#include "xfs_dir_sf.h" 35#include "xfs_dir_sf.h"
58#include "xfs_dir2_sf.h" 36#include "xfs_dir2_sf.h"
37#include "xfs_attr_sf.h"
59#include "xfs_dinode.h" 38#include "xfs_dinode.h"
60#include "xfs_inode.h" 39#include "xfs_inode.h"
61#include "xfs_bmap.h" 40#include "xfs_bmap.h"
62#include "xfs_bit.h" 41#include "xfs_btree.h"
42#include "xfs_ialloc.h"
63#include "xfs_rtalloc.h" 43#include "xfs_rtalloc.h"
64#include "xfs_error.h" 44#include "xfs_error.h"
65#include "xfs_itable.h" 45#include "xfs_itable.h"
@@ -302,7 +282,7 @@ xfs_read(
302 xfs_iunlock(ip, XFS_IOLOCK_SHARED); 282 xfs_iunlock(ip, XFS_IOLOCK_SHARED);
303 283
304 if (likely(!(ioflags & IO_INVIS))) 284 if (likely(!(ioflags & IO_INVIS)))
305 xfs_ichgtime(ip, XFS_ICHGTIME_ACC); 285 xfs_ichgtime_fast(ip, inode, XFS_ICHGTIME_ACC);
306 286
307unlock_isem: 287unlock_isem:
308 if (unlikely(ioflags & IO_ISDIRECT)) 288 if (unlikely(ioflags & IO_ISDIRECT))
@@ -367,7 +347,7 @@ xfs_sendfile(
367 XFS_STATS_ADD(xs_read_bytes, ret); 347 XFS_STATS_ADD(xs_read_bytes, ret);
368 348
369 if (likely(!(ioflags & IO_INVIS))) 349 if (likely(!(ioflags & IO_INVIS)))
370 xfs_ichgtime(ip, XFS_ICHGTIME_ACC); 350 xfs_ichgtime_fast(ip, LINVFS_GET_IP(vp), XFS_ICHGTIME_ACC);
371 351
372 return ret; 352 return ret;
373} 353}
@@ -660,9 +640,6 @@ xfs_write(
660 (xip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? 640 (xip->i_d.di_flags & XFS_DIFLAG_REALTIME) ?
661 mp->m_rtdev_targp : mp->m_ddev_targp; 641 mp->m_rtdev_targp : mp->m_ddev_targp;
662 642
663 if (ioflags & IO_ISAIO)
664 return XFS_ERROR(-ENOSYS);
665
666 if ((pos & target->pbr_smask) || (count & target->pbr_smask)) 643 if ((pos & target->pbr_smask) || (count & target->pbr_smask))
667 return XFS_ERROR(-EINVAL); 644 return XFS_ERROR(-EINVAL);
668 645
@@ -735,15 +712,10 @@ start:
735 } 712 }
736 } 713 }
737 714
738 /* 715 if (likely(!(ioflags & IO_INVIS))) {
739 * On Linux, generic_file_write updates the times even if
740 * no data is copied in so long as the write had a size.
741 *
742 * We must update xfs' times since revalidate will overcopy xfs.
743 */
744 if (!(ioflags & IO_INVIS)) {
745 xfs_ichgtime(xip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
746 inode_update_time(inode, 1); 716 inode_update_time(inode, 1);
717 xfs_ichgtime_fast(xip, inode,
718 XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
747 } 719 }
748 720
749 /* 721 /*