diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 12:16:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 12:16:20 -0500 |
commit | 1d32bdafaaa8bcc4c39b41ab9f674887d147f188 (patch) | |
tree | c1aae09d8b98b033fd4dd85ba3dbf97a25776e90 /fs/xfs/xfs_iops.c | |
parent | 0dc3fd0249a295863900984e02dd4bb89204205b (diff) | |
parent | bf3964c188d686424ff7b69a45941851b9f437f0 (diff) |
Merge tag 'xfs-for-linus-v3.14-rc1' of git://oss.sgi.com/xfs/xfs
Pull xfs update from Ben Myers:
"This is primarily bug fixes, many of which you already have. New
stuff includes a series to decouple the in-memory and on-disk log
format, helpers in the area of inode clusters, and i_version handling.
We decided to try to use more topic branches this release, so there
are some merge commits in there on account of that. I'm afraid I
didn't do a good job of putting meaningful comments in the first
couple of merges. Sorry about that. I think I have the hang of it
now.
For 3.14-rc1 there are fixes in the areas of remote attributes,
discard, growfs, memory leaks in recovery, directory v2, quotas, the
MAINTAINERS file, allocation alignment, extent list locking, and in
xfs_bmapi_allocate. There are cleanups in xfs_setsize_buftarg,
removing unused macros, quotas, setattr, and freeing of inode
clusters. The in-memory and on-disk log format have been decoupled, a
common helper to calculate the number of blocks in an inode cluster
has been added, and handling of i_version has been pulled into the
filesystems that use it.
- cleanup in xfs_setsize_buftarg
- removal of remaining unused flags for vop toss/flush/flushinval
- fix for memory corruption in xfs_attrlist_by_handle
- fix for out-of-date comment in xfs_trans_dqlockedjoin
- fix for discard if range length is less than one block
- fix for overrun of agfl buffer using growfs on v4 superblock
filesystems
- pull i_version handling out into the filesystems that use it
- don't leak recovery items on error
- fix for memory leak in xfs_dir2_node_removename
- several cleanups for quotas
- fix bad assertion in xfs_qm_vop_create_dqattach
- cleanup for xfs_setattr_mode, and add xfs_setattr_time
- fix quota assert in xfs_setattr_nonsize
- fix an infinite loop when turning off group/project quota before
user quota
- fix for temporary buffer allocation failure in xfs_dir2_block_to_sf
with large directory block sizes
- fix Dave's email address in MAINTAINERS
- cleanup calculation of freed inode cluster blocks
- fix alignment of initial file allocations to match filesystem
geometry
- decouple in-memory and on-disk log format
- introduce a common helper to calculate the number of filesystem
blocks in an inode cluster
- fixes for extent list locking
- fix for off-by-one in xfs_attr3_rmt_verify
- fix for missing destroy_work_on_stack in xfs_bmapi_allocate"
* tag 'xfs-for-linus-v3.14-rc1' of git://oss.sgi.com/xfs/xfs: (51 commits)
xfs: Calling destroy_work_on_stack() to pair with INIT_WORK_ONSTACK()
xfs: fix off-by-one error in xfs_attr3_rmt_verify
xfs: assert that we hold the ilock for extent map access
xfs: use xfs_ilock_attr_map_shared in xfs_attr_list_int
xfs: use xfs_ilock_attr_map_shared in xfs_attr_get
xfs: use xfs_ilock_data_map_shared in xfs_qm_dqiterate
xfs: use xfs_ilock_data_map_shared in xfs_qm_dqtobp
xfs: take the ilock around xfs_bmapi_read in xfs_zero_remaining_bytes
xfs: reinstate the ilock in xfs_readdir
xfs: add xfs_ilock_attr_map_shared
xfs: rename xfs_ilock_map_shared
xfs: remove xfs_iunlock_map_shared
xfs: no need to lock the inode in xfs_find_handle
xfs: use xfs_icluster_size_fsb in xfs_imap
xfs: use xfs_icluster_size_fsb in xfs_ifree_cluster
xfs: use xfs_icluster_size_fsb in xfs_ialloc_inode_init
xfs: use xfs_icluster_size_fsb in xfs_bulkstat
xfs: introduce a common helper xfs_icluster_size_fsb
xfs: get rid of XFS_IALLOC_BLOCKS macros
xfs: get rid of XFS_INODE_CLUSTER_SIZE macros
...
Diffstat (limited to 'fs/xfs/xfs_iops.c')
-rw-r--r-- | fs/xfs/xfs_iops.c | 76 |
1 files changed, 34 insertions, 42 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 104455b8046c..0ce1d759156e 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -459,14 +459,12 @@ xfs_vn_getattr( | |||
459 | 459 | ||
460 | static void | 460 | static void |
461 | xfs_setattr_mode( | 461 | xfs_setattr_mode( |
462 | struct xfs_trans *tp, | ||
463 | struct xfs_inode *ip, | 462 | struct xfs_inode *ip, |
464 | struct iattr *iattr) | 463 | struct iattr *iattr) |
465 | { | 464 | { |
466 | struct inode *inode = VFS_I(ip); | 465 | struct inode *inode = VFS_I(ip); |
467 | umode_t mode = iattr->ia_mode; | 466 | umode_t mode = iattr->ia_mode; |
468 | 467 | ||
469 | ASSERT(tp); | ||
470 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | 468 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
471 | 469 | ||
472 | ip->i_d.di_mode &= S_IFMT; | 470 | ip->i_d.di_mode &= S_IFMT; |
@@ -476,6 +474,32 @@ xfs_setattr_mode( | |||
476 | inode->i_mode |= mode & ~S_IFMT; | 474 | inode->i_mode |= mode & ~S_IFMT; |
477 | } | 475 | } |
478 | 476 | ||
477 | static void | ||
478 | xfs_setattr_time( | ||
479 | struct xfs_inode *ip, | ||
480 | struct iattr *iattr) | ||
481 | { | ||
482 | struct inode *inode = VFS_I(ip); | ||
483 | |||
484 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | ||
485 | |||
486 | if (iattr->ia_valid & ATTR_ATIME) { | ||
487 | inode->i_atime = iattr->ia_atime; | ||
488 | ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; | ||
489 | ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; | ||
490 | } | ||
491 | if (iattr->ia_valid & ATTR_CTIME) { | ||
492 | inode->i_ctime = iattr->ia_ctime; | ||
493 | ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; | ||
494 | ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; | ||
495 | } | ||
496 | if (iattr->ia_valid & ATTR_MTIME) { | ||
497 | inode->i_mtime = iattr->ia_mtime; | ||
498 | ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; | ||
499 | ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; | ||
500 | } | ||
501 | } | ||
502 | |||
479 | int | 503 | int |
480 | xfs_setattr_nonsize( | 504 | xfs_setattr_nonsize( |
481 | struct xfs_inode *ip, | 505 | struct xfs_inode *ip, |
@@ -630,30 +654,10 @@ xfs_setattr_nonsize( | |||
630 | } | 654 | } |
631 | } | 655 | } |
632 | 656 | ||
633 | /* | ||
634 | * Change file access modes. | ||
635 | */ | ||
636 | if (mask & ATTR_MODE) | 657 | if (mask & ATTR_MODE) |
637 | xfs_setattr_mode(tp, ip, iattr); | 658 | xfs_setattr_mode(ip, iattr); |
638 | 659 | if (mask & (ATTR_ATIME|ATTR_CTIME|ATTR_MTIME)) | |
639 | /* | 660 | xfs_setattr_time(ip, iattr); |
640 | * Change file access or modified times. | ||
641 | */ | ||
642 | if (mask & ATTR_ATIME) { | ||
643 | inode->i_atime = iattr->ia_atime; | ||
644 | ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; | ||
645 | ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; | ||
646 | } | ||
647 | if (mask & ATTR_CTIME) { | ||
648 | inode->i_ctime = iattr->ia_ctime; | ||
649 | ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; | ||
650 | ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; | ||
651 | } | ||
652 | if (mask & ATTR_MTIME) { | ||
653 | inode->i_mtime = iattr->ia_mtime; | ||
654 | ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; | ||
655 | ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; | ||
656 | } | ||
657 | 661 | ||
658 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 662 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
659 | 663 | ||
@@ -868,22 +872,10 @@ xfs_setattr_size( | |||
868 | xfs_inode_clear_eofblocks_tag(ip); | 872 | xfs_inode_clear_eofblocks_tag(ip); |
869 | } | 873 | } |
870 | 874 | ||
871 | /* | ||
872 | * Change file access modes. | ||
873 | */ | ||
874 | if (mask & ATTR_MODE) | 875 | if (mask & ATTR_MODE) |
875 | xfs_setattr_mode(tp, ip, iattr); | 876 | xfs_setattr_mode(ip, iattr); |
876 | 877 | if (mask & (ATTR_ATIME|ATTR_CTIME|ATTR_MTIME)) | |
877 | if (mask & ATTR_CTIME) { | 878 | xfs_setattr_time(ip, iattr); |
878 | inode->i_ctime = iattr->ia_ctime; | ||
879 | ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; | ||
880 | ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; | ||
881 | } | ||
882 | if (mask & ATTR_MTIME) { | ||
883 | inode->i_mtime = iattr->ia_mtime; | ||
884 | ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; | ||
885 | ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; | ||
886 | } | ||
887 | 879 | ||
888 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 880 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
889 | 881 | ||