aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/Makefile4
-rw-r--r--fs/ocfs2/acl.c2
-rw-r--r--fs/ocfs2/aops.c1
-rw-r--r--fs/ocfs2/cluster/heartbeat.c4
-rw-r--r--fs/ocfs2/dir.c2
-rw-r--r--fs/ocfs2/dlm/Makefile2
-rw-r--r--fs/ocfs2/dlmfs/Makefile2
-rw-r--r--fs/ocfs2/ioctl.c2
-rw-r--r--fs/ocfs2/namei.c4
-rw-r--r--fs/ocfs2/ocfs2.h10
-rw-r--r--fs/ocfs2/quota.h3
-rw-r--r--fs/ocfs2/quota_global.c27
-rw-r--r--fs/ocfs2/refcounttree.c3
-rw-r--r--fs/ocfs2/super.c7
-rw-r--r--fs/ocfs2/xattr.c10
-rw-r--r--fs/ocfs2/xattr.h4
16 files changed, 29 insertions, 58 deletions
diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile
index 07d9fd854350..d8a0313e99e6 100644
--- a/fs/ocfs2/Makefile
+++ b/fs/ocfs2/Makefile
@@ -1,6 +1,6 @@
1EXTRA_CFLAGS += -Ifs/ocfs2 1ccflags-y := -Ifs/ocfs2
2 2
3EXTRA_CFLAGS += -DCATCH_BH_JBD_RACES 3ccflags-y += -DCATCH_BH_JBD_RACES
4 4
5obj-$(CONFIG_OCFS2_FS) += \ 5obj-$(CONFIG_OCFS2_FS) += \
6 ocfs2.o \ 6 ocfs2.o \
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
index 69786e3eb43c..e913ad130fdd 100644
--- a/fs/ocfs2/acl.c
+++ b/fs/ocfs2/acl.c
@@ -496,7 +496,7 @@ static int ocfs2_xattr_set_acl(struct dentry *dentry, const char *name,
496 if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL)) 496 if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL))
497 return -EOPNOTSUPP; 497 return -EOPNOTSUPP;
498 498
499 if (!is_owner_or_cap(inode)) 499 if (!inode_owner_or_capable(inode))
500 return -EPERM; 500 return -EPERM;
501 501
502 if (value) { 502 if (value) {
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index b5d7fb9ab1f3..ac97bca282d2 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -2039,7 +2039,6 @@ const struct address_space_operations ocfs2_aops = {
2039 .write_begin = ocfs2_write_begin, 2039 .write_begin = ocfs2_write_begin,
2040 .write_end = ocfs2_write_end, 2040 .write_end = ocfs2_write_end,
2041 .bmap = ocfs2_bmap, 2041 .bmap = ocfs2_bmap,
2042 .sync_page = block_sync_page,
2043 .direct_IO = ocfs2_direct_IO, 2042 .direct_IO = ocfs2_direct_IO,
2044 .invalidatepage = ocfs2_invalidatepage, 2043 .invalidatepage = ocfs2_invalidatepage,
2045 .releasepage = ocfs2_releasepage, 2044 .releasepage = ocfs2_releasepage,
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index fc9e96a03a6b..2461eb3272ed 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -367,11 +367,7 @@ static inline void o2hb_bio_wait_dec(struct o2hb_bio_wait_ctxt *wc,
367static void o2hb_wait_on_io(struct o2hb_region *reg, 367static void o2hb_wait_on_io(struct o2hb_region *reg,
368 struct o2hb_bio_wait_ctxt *wc) 368 struct o2hb_bio_wait_ctxt *wc)
369{ 369{
370 struct address_space *mapping = reg->hr_bdev->bd_inode->i_mapping;
371
372 blk_run_address_space(mapping);
373 o2hb_bio_wait_dec(wc, 1); 370 o2hb_bio_wait_dec(wc, 1);
374
375 wait_for_completion(&wc->wc_io_complete); 371 wait_for_completion(&wc->wc_io_complete);
376} 372}
377 373
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index b0c17490bbbc..9fe5b8fd658f 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -356,7 +356,7 @@ static inline int ocfs2_match(int len,
356/* 356/*
357 * Returns 0 if not found, -1 on failure, and 1 on success 357 * Returns 0 if not found, -1 on failure, and 1 on success
358 */ 358 */
359static int inline ocfs2_search_dirblock(struct buffer_head *bh, 359static inline int ocfs2_search_dirblock(struct buffer_head *bh,
360 struct inode *dir, 360 struct inode *dir,
361 const char *name, int namelen, 361 const char *name, int namelen,
362 unsigned long offset, 362 unsigned long offset,
diff --git a/fs/ocfs2/dlm/Makefile b/fs/ocfs2/dlm/Makefile
index dcebf0d920fa..c8a044efbb15 100644
--- a/fs/ocfs2/dlm/Makefile
+++ b/fs/ocfs2/dlm/Makefile
@@ -1,4 +1,4 @@
1EXTRA_CFLAGS += -Ifs/ocfs2 1ccflags-y := -Ifs/ocfs2
2 2
3obj-$(CONFIG_OCFS2_FS_O2CB) += ocfs2_dlm.o 3obj-$(CONFIG_OCFS2_FS_O2CB) += ocfs2_dlm.o
4 4
diff --git a/fs/ocfs2/dlmfs/Makefile b/fs/ocfs2/dlmfs/Makefile
index df69b4856d0d..f14be89a6701 100644
--- a/fs/ocfs2/dlmfs/Makefile
+++ b/fs/ocfs2/dlmfs/Makefile
@@ -1,4 +1,4 @@
1EXTRA_CFLAGS += -Ifs/ocfs2 1ccflags-y := -Ifs/ocfs2
2 2
3obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o 3obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o
4 4
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index f97a213223e8..8f13c5989eae 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -96,7 +96,7 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
96 } 96 }
97 97
98 status = -EACCES; 98 status = -EACCES;
99 if (!is_owner_or_cap(inode)) 99 if (!inode_owner_or_capable(inode))
100 goto bail_unlock; 100 goto bail_unlock;
101 101
102 if (!S_ISDIR(inode->i_mode)) 102 if (!S_ISDIR(inode->i_mode))
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index b6fa9eb2d298..28f2cc1080d8 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -291,7 +291,7 @@ static int ocfs2_mknod(struct inode *dir,
291 } 291 }
292 292
293 /* get security xattr */ 293 /* get security xattr */
294 status = ocfs2_init_security_get(inode, dir, &si); 294 status = ocfs2_init_security_get(inode, dir, &dentry->d_name, &si);
295 if (status) { 295 if (status) {
296 if (status == -EOPNOTSUPP) 296 if (status == -EOPNOTSUPP)
297 si.enable = 0; 297 si.enable = 0;
@@ -1662,7 +1662,7 @@ static int ocfs2_symlink(struct inode *dir,
1662 } 1662 }
1663 1663
1664 /* get security xattr */ 1664 /* get security xattr */
1665 status = ocfs2_init_security_get(inode, dir, &si); 1665 status = ocfs2_init_security_get(inode, dir, &dentry->d_name, &si);
1666 if (status) { 1666 if (status) {
1667 if (status == -EOPNOTSUPP) 1667 if (status == -EOPNOTSUPP)
1668 si.enable = 0; 1668 si.enable = 0;
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 4e3d3c1363f3..409285854f64 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -836,18 +836,18 @@ static inline unsigned int ocfs2_clusters_to_megabytes(struct super_block *sb,
836 836
837static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap) 837static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap)
838{ 838{
839 ext2_set_bit(bit, bitmap); 839 __test_and_set_bit_le(bit, bitmap);
840} 840}
841#define ocfs2_set_bit(bit, addr) _ocfs2_set_bit((bit), (unsigned long *)(addr)) 841#define ocfs2_set_bit(bit, addr) _ocfs2_set_bit((bit), (unsigned long *)(addr))
842 842
843static inline void _ocfs2_clear_bit(unsigned int bit, unsigned long *bitmap) 843static inline void _ocfs2_clear_bit(unsigned int bit, unsigned long *bitmap)
844{ 844{
845 ext2_clear_bit(bit, bitmap); 845 __test_and_clear_bit_le(bit, bitmap);
846} 846}
847#define ocfs2_clear_bit(bit, addr) _ocfs2_clear_bit((bit), (unsigned long *)(addr)) 847#define ocfs2_clear_bit(bit, addr) _ocfs2_clear_bit((bit), (unsigned long *)(addr))
848 848
849#define ocfs2_test_bit ext2_test_bit 849#define ocfs2_test_bit test_bit_le
850#define ocfs2_find_next_zero_bit ext2_find_next_zero_bit 850#define ocfs2_find_next_zero_bit find_next_zero_bit_le
851#define ocfs2_find_next_bit ext2_find_next_bit 851#define ocfs2_find_next_bit find_next_bit_le
852#endif /* OCFS2_H */ 852#endif /* OCFS2_H */
853 853
diff --git a/fs/ocfs2/quota.h b/fs/ocfs2/quota.h
index 196fcb52d95d..d5ab56cbe5c5 100644
--- a/fs/ocfs2/quota.h
+++ b/fs/ocfs2/quota.h
@@ -114,7 +114,4 @@ int ocfs2_local_write_dquot(struct dquot *dquot);
114extern const struct dquot_operations ocfs2_quota_operations; 114extern const struct dquot_operations ocfs2_quota_operations;
115extern struct quota_format_type ocfs2_quota_format; 115extern struct quota_format_type ocfs2_quota_format;
116 116
117int ocfs2_quota_setup(void);
118void ocfs2_quota_shutdown(void);
119
120#endif /* _OCFS2_QUOTA_H */ 117#endif /* _OCFS2_QUOTA_H */
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index 64346f836c09..279aef68025b 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -63,8 +63,6 @@
63 * write to gf 63 * write to gf
64 */ 64 */
65 65
66static struct workqueue_struct *ocfs2_quota_wq = NULL;
67
68static void qsync_work_fn(struct work_struct *work); 66static void qsync_work_fn(struct work_struct *work);
69 67
70static void ocfs2_global_disk2memdqb(struct dquot *dquot, void *dp) 68static void ocfs2_global_disk2memdqb(struct dquot *dquot, void *dp)
@@ -397,8 +395,8 @@ int ocfs2_global_read_info(struct super_block *sb, int type)
397 OCFS2_QBLK_RESERVED_SPACE; 395 OCFS2_QBLK_RESERVED_SPACE;
398 oinfo->dqi_gi.dqi_qtree_depth = qtree_depth(&oinfo->dqi_gi); 396 oinfo->dqi_gi.dqi_qtree_depth = qtree_depth(&oinfo->dqi_gi);
399 INIT_DELAYED_WORK(&oinfo->dqi_sync_work, qsync_work_fn); 397 INIT_DELAYED_WORK(&oinfo->dqi_sync_work, qsync_work_fn);
400 queue_delayed_work(ocfs2_quota_wq, &oinfo->dqi_sync_work, 398 schedule_delayed_work(&oinfo->dqi_sync_work,
401 msecs_to_jiffies(oinfo->dqi_syncms)); 399 msecs_to_jiffies(oinfo->dqi_syncms));
402 400
403out_err: 401out_err:
404 if (status) 402 if (status)
@@ -633,8 +631,8 @@ static void qsync_work_fn(struct work_struct *work)
633 struct super_block *sb = oinfo->dqi_gqinode->i_sb; 631 struct super_block *sb = oinfo->dqi_gqinode->i_sb;
634 632
635 dquot_scan_active(sb, ocfs2_sync_dquot_helper, oinfo->dqi_type); 633 dquot_scan_active(sb, ocfs2_sync_dquot_helper, oinfo->dqi_type);
636 queue_delayed_work(ocfs2_quota_wq, &oinfo->dqi_sync_work, 634 schedule_delayed_work(&oinfo->dqi_sync_work,
637 msecs_to_jiffies(oinfo->dqi_syncms)); 635 msecs_to_jiffies(oinfo->dqi_syncms));
638} 636}
639 637
640/* 638/*
@@ -922,20 +920,3 @@ const struct dquot_operations ocfs2_quota_operations = {
922 .alloc_dquot = ocfs2_alloc_dquot, 920 .alloc_dquot = ocfs2_alloc_dquot,
923 .destroy_dquot = ocfs2_destroy_dquot, 921 .destroy_dquot = ocfs2_destroy_dquot,
924}; 922};
925
926int ocfs2_quota_setup(void)
927{
928 ocfs2_quota_wq = create_workqueue("o2quot");
929 if (!ocfs2_quota_wq)
930 return -ENOMEM;
931 return 0;
932}
933
934void ocfs2_quota_shutdown(void)
935{
936 if (ocfs2_quota_wq) {
937 flush_workqueue(ocfs2_quota_wq);
938 destroy_workqueue(ocfs2_quota_wq);
939 ocfs2_quota_wq = NULL;
940 }
941}
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 93a81f853e66..5d32749c896d 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -4326,7 +4326,8 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir,
4326 4326
4327 /* If the security isn't preserved, we need to re-initialize them. */ 4327 /* If the security isn't preserved, we need to re-initialize them. */
4328 if (!preserve) { 4328 if (!preserve) {
4329 error = ocfs2_init_security_and_acl(dir, new_orphan_inode); 4329 error = ocfs2_init_security_and_acl(dir, new_orphan_inode,
4330 &new_dentry->d_name);
4330 if (error) 4331 if (error)
4331 mlog_errno(error); 4332 mlog_errno(error);
4332 } 4333 }
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 0e4083987d2b..69fa11b35aa4 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1645,16 +1645,11 @@ static int __init ocfs2_init(void)
1645 mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n"); 1645 mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n");
1646 } 1646 }
1647 1647
1648 status = ocfs2_quota_setup();
1649 if (status)
1650 goto leave;
1651
1652 ocfs2_set_locking_protocol(); 1648 ocfs2_set_locking_protocol();
1653 1649
1654 status = register_quota_format(&ocfs2_quota_format); 1650 status = register_quota_format(&ocfs2_quota_format);
1655leave: 1651leave:
1656 if (status < 0) { 1652 if (status < 0) {
1657 ocfs2_quota_shutdown();
1658 ocfs2_free_mem_caches(); 1653 ocfs2_free_mem_caches();
1659 exit_ocfs2_uptodate_cache(); 1654 exit_ocfs2_uptodate_cache();
1660 mlog_errno(status); 1655 mlog_errno(status);
@@ -1668,8 +1663,6 @@ leave:
1668 1663
1669static void __exit ocfs2_exit(void) 1664static void __exit ocfs2_exit(void)
1670{ 1665{
1671 ocfs2_quota_shutdown();
1672
1673 if (ocfs2_wq) { 1666 if (ocfs2_wq) {
1674 flush_workqueue(ocfs2_wq); 1667 flush_workqueue(ocfs2_wq);
1675 destroy_workqueue(ocfs2_wq); 1668 destroy_workqueue(ocfs2_wq);
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 52e3dadd3642..57a215dc2d9b 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -7180,7 +7180,8 @@ out:
7180 * must not hold any lock expect i_mutex. 7180 * must not hold any lock expect i_mutex.
7181 */ 7181 */
7182int ocfs2_init_security_and_acl(struct inode *dir, 7182int ocfs2_init_security_and_acl(struct inode *dir,
7183 struct inode *inode) 7183 struct inode *inode,
7184 const struct qstr *qstr)
7184{ 7185{
7185 int ret = 0; 7186 int ret = 0;
7186 struct buffer_head *dir_bh = NULL; 7187 struct buffer_head *dir_bh = NULL;
@@ -7188,7 +7189,7 @@ int ocfs2_init_security_and_acl(struct inode *dir,
7188 .enable = 1, 7189 .enable = 1,
7189 }; 7190 };
7190 7191
7191 ret = ocfs2_init_security_get(inode, dir, &si); 7192 ret = ocfs2_init_security_get(inode, dir, qstr, &si);
7192 if (!ret) { 7193 if (!ret) {
7193 ret = ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_SECURITY, 7194 ret = ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_SECURITY,
7194 si.name, si.value, si.value_len, 7195 si.name, si.value, si.value_len,
@@ -7256,13 +7257,14 @@ static int ocfs2_xattr_security_set(struct dentry *dentry, const char *name,
7256 7257
7257int ocfs2_init_security_get(struct inode *inode, 7258int ocfs2_init_security_get(struct inode *inode,
7258 struct inode *dir, 7259 struct inode *dir,
7260 const struct qstr *qstr,
7259 struct ocfs2_security_xattr_info *si) 7261 struct ocfs2_security_xattr_info *si)
7260{ 7262{
7261 /* check whether ocfs2 support feature xattr */ 7263 /* check whether ocfs2 support feature xattr */
7262 if (!ocfs2_supports_xattr(OCFS2_SB(dir->i_sb))) 7264 if (!ocfs2_supports_xattr(OCFS2_SB(dir->i_sb)))
7263 return -EOPNOTSUPP; 7265 return -EOPNOTSUPP;
7264 return security_inode_init_security(inode, dir, &si->name, &si->value, 7266 return security_inode_init_security(inode, dir, qstr, &si->name,
7265 &si->value_len); 7267 &si->value, &si->value_len);
7266} 7268}
7267 7269
7268int ocfs2_init_security_set(handle_t *handle, 7270int ocfs2_init_security_set(handle_t *handle,
diff --git a/fs/ocfs2/xattr.h b/fs/ocfs2/xattr.h
index aa64bb37a65b..d63cfb72316b 100644
--- a/fs/ocfs2/xattr.h
+++ b/fs/ocfs2/xattr.h
@@ -57,6 +57,7 @@ int ocfs2_has_inline_xattr_value_outside(struct inode *inode,
57 struct ocfs2_dinode *di); 57 struct ocfs2_dinode *di);
58int ocfs2_xattr_remove(struct inode *, struct buffer_head *); 58int ocfs2_xattr_remove(struct inode *, struct buffer_head *);
59int ocfs2_init_security_get(struct inode *, struct inode *, 59int ocfs2_init_security_get(struct inode *, struct inode *,
60 const struct qstr *,
60 struct ocfs2_security_xattr_info *); 61 struct ocfs2_security_xattr_info *);
61int ocfs2_init_security_set(handle_t *, struct inode *, 62int ocfs2_init_security_set(handle_t *, struct inode *,
62 struct buffer_head *, 63 struct buffer_head *,
@@ -94,5 +95,6 @@ int ocfs2_reflink_xattrs(struct inode *old_inode,
94 struct buffer_head *new_bh, 95 struct buffer_head *new_bh,
95 bool preserve_security); 96 bool preserve_security);
96int ocfs2_init_security_and_acl(struct inode *dir, 97int ocfs2_init_security_and_acl(struct inode *dir,
97 struct inode *inode); 98 struct inode *inode,
99 const struct qstr *qstr);
98#endif /* OCFS2_XATTR_H */ 100#endif /* OCFS2_XATTR_H */