diff options
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/alloc.c | 1 | ||||
-rw-r--r-- | fs/ocfs2/aops.c | 37 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 5 | ||||
-rw-r--r-- | fs/ocfs2/localalloc.c | 8 | ||||
-rw-r--r-- | fs/ocfs2/localalloc.h | 2 | ||||
-rw-r--r-- | fs/ocfs2/suballoc.c | 29 | ||||
-rw-r--r-- | fs/ocfs2/suballoc.h | 11 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 69 | ||||
-rw-r--r-- | fs/ocfs2/vote.c | 4 |
9 files changed, 101 insertions, 65 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 4f517665c9a0..778a850b4634 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -5602,6 +5602,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb, | |||
5602 | clusters_to_del; | 5602 | clusters_to_del; |
5603 | spin_unlock(&OCFS2_I(inode)->ip_lock); | 5603 | spin_unlock(&OCFS2_I(inode)->ip_lock); |
5604 | le32_add_cpu(&fe->i_clusters, -clusters_to_del); | 5604 | le32_add_cpu(&fe->i_clusters, -clusters_to_del); |
5605 | inode->i_blocks = ocfs2_inode_sector_count(inode); | ||
5605 | 5606 | ||
5606 | status = ocfs2_trim_tree(inode, path, handle, tc, | 5607 | status = ocfs2_trim_tree(inode, path, handle, tc, |
5607 | clusters_to_del, &delete_blk); | 5608 | clusters_to_del, &delete_blk); |
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 460d440310f2..f37f25c931f5 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -855,6 +855,7 @@ static int ocfs2_alloc_write_ctxt(struct ocfs2_write_ctxt **wcp, | |||
855 | struct ocfs2_super *osb, loff_t pos, | 855 | struct ocfs2_super *osb, loff_t pos, |
856 | unsigned len, struct buffer_head *di_bh) | 856 | unsigned len, struct buffer_head *di_bh) |
857 | { | 857 | { |
858 | u32 cend; | ||
858 | struct ocfs2_write_ctxt *wc; | 859 | struct ocfs2_write_ctxt *wc; |
859 | 860 | ||
860 | wc = kzalloc(sizeof(struct ocfs2_write_ctxt), GFP_NOFS); | 861 | wc = kzalloc(sizeof(struct ocfs2_write_ctxt), GFP_NOFS); |
@@ -862,7 +863,8 @@ static int ocfs2_alloc_write_ctxt(struct ocfs2_write_ctxt **wcp, | |||
862 | return -ENOMEM; | 863 | return -ENOMEM; |
863 | 864 | ||
864 | wc->w_cpos = pos >> osb->s_clustersize_bits; | 865 | wc->w_cpos = pos >> osb->s_clustersize_bits; |
865 | wc->w_clen = ocfs2_clusters_for_bytes(osb->sb, len); | 866 | cend = (pos + len - 1) >> osb->s_clustersize_bits; |
867 | wc->w_clen = cend - wc->w_cpos + 1; | ||
866 | get_bh(di_bh); | 868 | get_bh(di_bh); |
867 | wc->w_di_bh = di_bh; | 869 | wc->w_di_bh = di_bh; |
868 | 870 | ||
@@ -928,18 +930,11 @@ static void ocfs2_write_failure(struct inode *inode, | |||
928 | loff_t user_pos, unsigned user_len) | 930 | loff_t user_pos, unsigned user_len) |
929 | { | 931 | { |
930 | int i; | 932 | int i; |
931 | unsigned from, to; | 933 | unsigned from = user_pos & (PAGE_CACHE_SIZE - 1), |
934 | to = user_pos + user_len; | ||
932 | struct page *tmppage; | 935 | struct page *tmppage; |
933 | 936 | ||
934 | ocfs2_zero_new_buffers(wc->w_target_page, user_pos, user_len); | 937 | ocfs2_zero_new_buffers(wc->w_target_page, from, to); |
935 | |||
936 | if (wc->w_large_pages) { | ||
937 | from = wc->w_target_from; | ||
938 | to = wc->w_target_to; | ||
939 | } else { | ||
940 | from = 0; | ||
941 | to = PAGE_CACHE_SIZE; | ||
942 | } | ||
943 | 938 | ||
944 | for(i = 0; i < wc->w_num_pages; i++) { | 939 | for(i = 0; i < wc->w_num_pages; i++) { |
945 | tmppage = wc->w_pages[i]; | 940 | tmppage = wc->w_pages[i]; |
@@ -989,9 +984,6 @@ static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno, | |||
989 | map_from = cluster_start; | 984 | map_from = cluster_start; |
990 | map_to = cluster_end; | 985 | map_to = cluster_end; |
991 | } | 986 | } |
992 | |||
993 | wc->w_target_from = map_from; | ||
994 | wc->w_target_to = map_to; | ||
995 | } else { | 987 | } else { |
996 | /* | 988 | /* |
997 | * If we haven't allocated the new page yet, we | 989 | * If we haven't allocated the new page yet, we |
@@ -1209,18 +1201,33 @@ static int ocfs2_write_cluster_by_desc(struct address_space *mapping, | |||
1209 | loff_t pos, unsigned len) | 1201 | loff_t pos, unsigned len) |
1210 | { | 1202 | { |
1211 | int ret, i; | 1203 | int ret, i; |
1204 | loff_t cluster_off; | ||
1205 | unsigned int local_len = len; | ||
1212 | struct ocfs2_write_cluster_desc *desc; | 1206 | struct ocfs2_write_cluster_desc *desc; |
1207 | struct ocfs2_super *osb = OCFS2_SB(mapping->host->i_sb); | ||
1213 | 1208 | ||
1214 | for (i = 0; i < wc->w_clen; i++) { | 1209 | for (i = 0; i < wc->w_clen; i++) { |
1215 | desc = &wc->w_desc[i]; | 1210 | desc = &wc->w_desc[i]; |
1216 | 1211 | ||
1212 | /* | ||
1213 | * We have to make sure that the total write passed in | ||
1214 | * doesn't extend past a single cluster. | ||
1215 | */ | ||
1216 | local_len = len; | ||
1217 | cluster_off = pos & (osb->s_clustersize - 1); | ||
1218 | if ((cluster_off + local_len) > osb->s_clustersize) | ||
1219 | local_len = osb->s_clustersize - cluster_off; | ||
1220 | |||
1217 | ret = ocfs2_write_cluster(mapping, desc->c_phys, | 1221 | ret = ocfs2_write_cluster(mapping, desc->c_phys, |
1218 | desc->c_unwritten, data_ac, meta_ac, | 1222 | desc->c_unwritten, data_ac, meta_ac, |
1219 | wc, desc->c_cpos, pos, len); | 1223 | wc, desc->c_cpos, pos, local_len); |
1220 | if (ret) { | 1224 | if (ret) { |
1221 | mlog_errno(ret); | 1225 | mlog_errno(ret); |
1222 | goto out; | 1226 | goto out; |
1223 | } | 1227 | } |
1228 | |||
1229 | len -= local_len; | ||
1230 | pos += local_len; | ||
1224 | } | 1231 | } |
1225 | 1232 | ||
1226 | ret = 0; | 1233 | ret = 0; |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 4ffa715be09c..f3bc3658e7a5 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -314,7 +314,6 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, | |||
314 | } | 314 | } |
315 | 315 | ||
316 | i_size_write(inode, new_i_size); | 316 | i_size_write(inode, new_i_size); |
317 | inode->i_blocks = ocfs2_align_bytes_to_sectors(new_i_size); | ||
318 | inode->i_ctime = inode->i_mtime = CURRENT_TIME; | 317 | inode->i_ctime = inode->i_mtime = CURRENT_TIME; |
319 | 318 | ||
320 | di = (struct ocfs2_dinode *) fe_bh->b_data; | 319 | di = (struct ocfs2_dinode *) fe_bh->b_data; |
@@ -492,8 +491,8 @@ int ocfs2_do_extend_allocation(struct ocfs2_super *osb, | |||
492 | goto leave; | 491 | goto leave; |
493 | } | 492 | } |
494 | 493 | ||
495 | status = ocfs2_claim_clusters(osb, handle, data_ac, 1, | 494 | status = __ocfs2_claim_clusters(osb, handle, data_ac, 1, |
496 | &bit_off, &num_bits); | 495 | clusters_to_add, &bit_off, &num_bits); |
497 | if (status < 0) { | 496 | if (status < 0) { |
498 | if (status != -ENOSPC) | 497 | if (status != -ENOSPC) |
499 | mlog_errno(status); | 498 | mlog_errno(status); |
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 545f7892cdf3..d272847d5a07 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c | |||
@@ -514,8 +514,10 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, | |||
514 | ac->ac_bh = osb->local_alloc_bh; | 514 | ac->ac_bh = osb->local_alloc_bh; |
515 | status = 0; | 515 | status = 0; |
516 | bail: | 516 | bail: |
517 | if (status < 0 && local_alloc_inode) | 517 | if (status < 0 && local_alloc_inode) { |
518 | mutex_unlock(&local_alloc_inode->i_mutex); | ||
518 | iput(local_alloc_inode); | 519 | iput(local_alloc_inode); |
520 | } | ||
519 | 521 | ||
520 | mlog_exit(status); | 522 | mlog_exit(status); |
521 | return status; | 523 | return status; |
@@ -524,13 +526,12 @@ bail: | |||
524 | int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, | 526 | int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, |
525 | handle_t *handle, | 527 | handle_t *handle, |
526 | struct ocfs2_alloc_context *ac, | 528 | struct ocfs2_alloc_context *ac, |
527 | u32 min_bits, | 529 | u32 bits_wanted, |
528 | u32 *bit_off, | 530 | u32 *bit_off, |
529 | u32 *num_bits) | 531 | u32 *num_bits) |
530 | { | 532 | { |
531 | int status, start; | 533 | int status, start; |
532 | struct inode *local_alloc_inode; | 534 | struct inode *local_alloc_inode; |
533 | u32 bits_wanted; | ||
534 | void *bitmap; | 535 | void *bitmap; |
535 | struct ocfs2_dinode *alloc; | 536 | struct ocfs2_dinode *alloc; |
536 | struct ocfs2_local_alloc *la; | 537 | struct ocfs2_local_alloc *la; |
@@ -538,7 +539,6 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, | |||
538 | mlog_entry_void(); | 539 | mlog_entry_void(); |
539 | BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL); | 540 | BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL); |
540 | 541 | ||
541 | bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given; | ||
542 | local_alloc_inode = ac->ac_inode; | 542 | local_alloc_inode = ac->ac_inode; |
543 | alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; | 543 | alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data; |
544 | la = OCFS2_LOCAL_ALLOC(alloc); | 544 | la = OCFS2_LOCAL_ALLOC(alloc); |
diff --git a/fs/ocfs2/localalloc.h b/fs/ocfs2/localalloc.h index 385a10152f9c..3f76631e110c 100644 --- a/fs/ocfs2/localalloc.h +++ b/fs/ocfs2/localalloc.h | |||
@@ -48,7 +48,7 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, | |||
48 | int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, | 48 | int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, |
49 | handle_t *handle, | 49 | handle_t *handle, |
50 | struct ocfs2_alloc_context *ac, | 50 | struct ocfs2_alloc_context *ac, |
51 | u32 min_bits, | 51 | u32 bits_wanted, |
52 | u32 *bit_off, | 52 | u32 *bit_off, |
53 | u32 *num_bits); | 53 | u32 *num_bits); |
54 | 54 | ||
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index d9c5c9fcb30f..8f09f5235e3a 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -1486,21 +1486,21 @@ static inline void ocfs2_block_to_cluster_group(struct inode *inode, | |||
1486 | * contig. allocation, set to '1' to indicate we can deal with extents | 1486 | * contig. allocation, set to '1' to indicate we can deal with extents |
1487 | * of any size. | 1487 | * of any size. |
1488 | */ | 1488 | */ |
1489 | int ocfs2_claim_clusters(struct ocfs2_super *osb, | 1489 | int __ocfs2_claim_clusters(struct ocfs2_super *osb, |
1490 | handle_t *handle, | 1490 | handle_t *handle, |
1491 | struct ocfs2_alloc_context *ac, | 1491 | struct ocfs2_alloc_context *ac, |
1492 | u32 min_clusters, | 1492 | u32 min_clusters, |
1493 | u32 *cluster_start, | 1493 | u32 max_clusters, |
1494 | u32 *num_clusters) | 1494 | u32 *cluster_start, |
1495 | u32 *num_clusters) | ||
1495 | { | 1496 | { |
1496 | int status; | 1497 | int status; |
1497 | unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given; | 1498 | unsigned int bits_wanted = max_clusters; |
1498 | u64 bg_blkno = 0; | 1499 | u64 bg_blkno = 0; |
1499 | u16 bg_bit_off; | 1500 | u16 bg_bit_off; |
1500 | 1501 | ||
1501 | mlog_entry_void(); | 1502 | mlog_entry_void(); |
1502 | 1503 | ||
1503 | BUG_ON(!ac); | ||
1504 | BUG_ON(ac->ac_bits_given >= ac->ac_bits_wanted); | 1504 | BUG_ON(ac->ac_bits_given >= ac->ac_bits_wanted); |
1505 | 1505 | ||
1506 | BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL | 1506 | BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL |
@@ -1557,6 +1557,19 @@ bail: | |||
1557 | return status; | 1557 | return status; |
1558 | } | 1558 | } |
1559 | 1559 | ||
1560 | int ocfs2_claim_clusters(struct ocfs2_super *osb, | ||
1561 | handle_t *handle, | ||
1562 | struct ocfs2_alloc_context *ac, | ||
1563 | u32 min_clusters, | ||
1564 | u32 *cluster_start, | ||
1565 | u32 *num_clusters) | ||
1566 | { | ||
1567 | unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given; | ||
1568 | |||
1569 | return __ocfs2_claim_clusters(osb, handle, ac, min_clusters, | ||
1570 | bits_wanted, cluster_start, num_clusters); | ||
1571 | } | ||
1572 | |||
1560 | static inline int ocfs2_block_group_clear_bits(handle_t *handle, | 1573 | static inline int ocfs2_block_group_clear_bits(handle_t *handle, |
1561 | struct inode *alloc_inode, | 1574 | struct inode *alloc_inode, |
1562 | struct ocfs2_group_desc *bg, | 1575 | struct ocfs2_group_desc *bg, |
diff --git a/fs/ocfs2/suballoc.h b/fs/ocfs2/suballoc.h index f212dc01a84b..cafe93703095 100644 --- a/fs/ocfs2/suballoc.h +++ b/fs/ocfs2/suballoc.h | |||
@@ -85,6 +85,17 @@ int ocfs2_claim_clusters(struct ocfs2_super *osb, | |||
85 | u32 min_clusters, | 85 | u32 min_clusters, |
86 | u32 *cluster_start, | 86 | u32 *cluster_start, |
87 | u32 *num_clusters); | 87 | u32 *num_clusters); |
88 | /* | ||
89 | * Use this variant of ocfs2_claim_clusters to specify a maxiumum | ||
90 | * number of clusters smaller than the allocation reserved. | ||
91 | */ | ||
92 | int __ocfs2_claim_clusters(struct ocfs2_super *osb, | ||
93 | handle_t *handle, | ||
94 | struct ocfs2_alloc_context *ac, | ||
95 | u32 min_clusters, | ||
96 | u32 max_clusters, | ||
97 | u32 *cluster_start, | ||
98 | u32 *num_clusters); | ||
88 | 99 | ||
89 | int ocfs2_free_suballoc_bits(handle_t *handle, | 100 | int ocfs2_free_suballoc_bits(handle_t *handle, |
90 | struct inode *alloc_inode, | 101 | struct inode *alloc_inode, |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index f2fc9a795deb..c034b5129c1e 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -81,8 +81,15 @@ static struct dentry *ocfs2_debugfs_root = NULL; | |||
81 | MODULE_AUTHOR("Oracle"); | 81 | MODULE_AUTHOR("Oracle"); |
82 | MODULE_LICENSE("GPL"); | 82 | MODULE_LICENSE("GPL"); |
83 | 83 | ||
84 | struct mount_options | ||
85 | { | ||
86 | unsigned long mount_opt; | ||
87 | unsigned int atime_quantum; | ||
88 | signed short slot; | ||
89 | }; | ||
90 | |||
84 | static int ocfs2_parse_options(struct super_block *sb, char *options, | 91 | static int ocfs2_parse_options(struct super_block *sb, char *options, |
85 | unsigned long *mount_opt, s16 *slot, | 92 | struct mount_options *mopt, |
86 | int is_remount); | 93 | int is_remount); |
87 | static void ocfs2_put_super(struct super_block *sb); | 94 | static void ocfs2_put_super(struct super_block *sb); |
88 | static int ocfs2_mount_volume(struct super_block *sb); | 95 | static int ocfs2_mount_volume(struct super_block *sb); |
@@ -367,24 +374,23 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data) | |||
367 | { | 374 | { |
368 | int incompat_features; | 375 | int incompat_features; |
369 | int ret = 0; | 376 | int ret = 0; |
370 | unsigned long parsed_options; | 377 | struct mount_options parsed_options; |
371 | s16 slot; | ||
372 | struct ocfs2_super *osb = OCFS2_SB(sb); | 378 | struct ocfs2_super *osb = OCFS2_SB(sb); |
373 | 379 | ||
374 | if (!ocfs2_parse_options(sb, data, &parsed_options, &slot, 1)) { | 380 | if (!ocfs2_parse_options(sb, data, &parsed_options, 1)) { |
375 | ret = -EINVAL; | 381 | ret = -EINVAL; |
376 | goto out; | 382 | goto out; |
377 | } | 383 | } |
378 | 384 | ||
379 | if ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) != | 385 | if ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) != |
380 | (parsed_options & OCFS2_MOUNT_HB_LOCAL)) { | 386 | (parsed_options.mount_opt & OCFS2_MOUNT_HB_LOCAL)) { |
381 | ret = -EINVAL; | 387 | ret = -EINVAL; |
382 | mlog(ML_ERROR, "Cannot change heartbeat mode on remount\n"); | 388 | mlog(ML_ERROR, "Cannot change heartbeat mode on remount\n"); |
383 | goto out; | 389 | goto out; |
384 | } | 390 | } |
385 | 391 | ||
386 | if ((osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK) != | 392 | if ((osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK) != |
387 | (parsed_options & OCFS2_MOUNT_DATA_WRITEBACK)) { | 393 | (parsed_options.mount_opt & OCFS2_MOUNT_DATA_WRITEBACK)) { |
388 | ret = -EINVAL; | 394 | ret = -EINVAL; |
389 | mlog(ML_ERROR, "Cannot change data mode on remount\n"); | 395 | mlog(ML_ERROR, "Cannot change data mode on remount\n"); |
390 | goto out; | 396 | goto out; |
@@ -435,7 +441,9 @@ unlock_osb: | |||
435 | 441 | ||
436 | /* Only save off the new mount options in case of a successful | 442 | /* Only save off the new mount options in case of a successful |
437 | * remount. */ | 443 | * remount. */ |
438 | osb->s_mount_opt = parsed_options; | 444 | osb->s_mount_opt = parsed_options.mount_opt; |
445 | osb->s_atime_quantum = parsed_options.atime_quantum; | ||
446 | osb->preferred_slot = parsed_options.slot; | ||
439 | } | 447 | } |
440 | out: | 448 | out: |
441 | return ret; | 449 | return ret; |
@@ -547,8 +555,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
547 | { | 555 | { |
548 | struct dentry *root; | 556 | struct dentry *root; |
549 | int status, sector_size; | 557 | int status, sector_size; |
550 | unsigned long parsed_opt; | 558 | struct mount_options parsed_options; |
551 | s16 slot; | ||
552 | struct inode *inode = NULL; | 559 | struct inode *inode = NULL; |
553 | struct ocfs2_super *osb = NULL; | 560 | struct ocfs2_super *osb = NULL; |
554 | struct buffer_head *bh = NULL; | 561 | struct buffer_head *bh = NULL; |
@@ -556,14 +563,14 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
556 | 563 | ||
557 | mlog_entry("%p, %p, %i", sb, data, silent); | 564 | mlog_entry("%p, %p, %i", sb, data, silent); |
558 | 565 | ||
559 | if (!ocfs2_parse_options(sb, data, &parsed_opt, &slot, 0)) { | 566 | if (!ocfs2_parse_options(sb, data, &parsed_options, 0)) { |
560 | status = -EINVAL; | 567 | status = -EINVAL; |
561 | goto read_super_error; | 568 | goto read_super_error; |
562 | } | 569 | } |
563 | 570 | ||
564 | /* for now we only have one cluster/node, make sure we see it | 571 | /* for now we only have one cluster/node, make sure we see it |
565 | * in the heartbeat universe */ | 572 | * in the heartbeat universe */ |
566 | if (parsed_opt & OCFS2_MOUNT_HB_LOCAL) { | 573 | if (parsed_options.mount_opt & OCFS2_MOUNT_HB_LOCAL) { |
567 | if (!o2hb_check_local_node_heartbeating()) { | 574 | if (!o2hb_check_local_node_heartbeating()) { |
568 | status = -EINVAL; | 575 | status = -EINVAL; |
569 | goto read_super_error; | 576 | goto read_super_error; |
@@ -585,8 +592,9 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
585 | } | 592 | } |
586 | brelse(bh); | 593 | brelse(bh); |
587 | bh = NULL; | 594 | bh = NULL; |
588 | osb->s_mount_opt = parsed_opt; | 595 | osb->s_mount_opt = parsed_options.mount_opt; |
589 | osb->preferred_slot = slot; | 596 | osb->s_atime_quantum = parsed_options.atime_quantum; |
597 | osb->preferred_slot = parsed_options.slot; | ||
590 | 598 | ||
591 | sb->s_magic = OCFS2_SUPER_MAGIC; | 599 | sb->s_magic = OCFS2_SUPER_MAGIC; |
592 | 600 | ||
@@ -728,8 +736,7 @@ static struct file_system_type ocfs2_fs_type = { | |||
728 | 736 | ||
729 | static int ocfs2_parse_options(struct super_block *sb, | 737 | static int ocfs2_parse_options(struct super_block *sb, |
730 | char *options, | 738 | char *options, |
731 | unsigned long *mount_opt, | 739 | struct mount_options *mopt, |
732 | s16 *slot, | ||
733 | int is_remount) | 740 | int is_remount) |
734 | { | 741 | { |
735 | int status; | 742 | int status; |
@@ -738,8 +745,9 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
738 | mlog_entry("remount: %d, options: \"%s\"\n", is_remount, | 745 | mlog_entry("remount: %d, options: \"%s\"\n", is_remount, |
739 | options ? options : "(none)"); | 746 | options ? options : "(none)"); |
740 | 747 | ||
741 | *mount_opt = 0; | 748 | mopt->mount_opt = 0; |
742 | *slot = OCFS2_INVALID_SLOT; | 749 | mopt->atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM; |
750 | mopt->slot = OCFS2_INVALID_SLOT; | ||
743 | 751 | ||
744 | if (!options) { | 752 | if (!options) { |
745 | status = 1; | 753 | status = 1; |
@@ -749,7 +757,6 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
749 | while ((p = strsep(&options, ",")) != NULL) { | 757 | while ((p = strsep(&options, ",")) != NULL) { |
750 | int token, option; | 758 | int token, option; |
751 | substring_t args[MAX_OPT_ARGS]; | 759 | substring_t args[MAX_OPT_ARGS]; |
752 | struct ocfs2_super * osb = OCFS2_SB(sb); | ||
753 | 760 | ||
754 | if (!*p) | 761 | if (!*p) |
755 | continue; | 762 | continue; |
@@ -757,10 +764,10 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
757 | token = match_token(p, tokens, args); | 764 | token = match_token(p, tokens, args); |
758 | switch (token) { | 765 | switch (token) { |
759 | case Opt_hb_local: | 766 | case Opt_hb_local: |
760 | *mount_opt |= OCFS2_MOUNT_HB_LOCAL; | 767 | mopt->mount_opt |= OCFS2_MOUNT_HB_LOCAL; |
761 | break; | 768 | break; |
762 | case Opt_hb_none: | 769 | case Opt_hb_none: |
763 | *mount_opt &= ~OCFS2_MOUNT_HB_LOCAL; | 770 | mopt->mount_opt &= ~OCFS2_MOUNT_HB_LOCAL; |
764 | break; | 771 | break; |
765 | case Opt_barrier: | 772 | case Opt_barrier: |
766 | if (match_int(&args[0], &option)) { | 773 | if (match_int(&args[0], &option)) { |
@@ -768,27 +775,27 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
768 | goto bail; | 775 | goto bail; |
769 | } | 776 | } |
770 | if (option) | 777 | if (option) |
771 | *mount_opt |= OCFS2_MOUNT_BARRIER; | 778 | mopt->mount_opt |= OCFS2_MOUNT_BARRIER; |
772 | else | 779 | else |
773 | *mount_opt &= ~OCFS2_MOUNT_BARRIER; | 780 | mopt->mount_opt &= ~OCFS2_MOUNT_BARRIER; |
774 | break; | 781 | break; |
775 | case Opt_intr: | 782 | case Opt_intr: |
776 | *mount_opt &= ~OCFS2_MOUNT_NOINTR; | 783 | mopt->mount_opt &= ~OCFS2_MOUNT_NOINTR; |
777 | break; | 784 | break; |
778 | case Opt_nointr: | 785 | case Opt_nointr: |
779 | *mount_opt |= OCFS2_MOUNT_NOINTR; | 786 | mopt->mount_opt |= OCFS2_MOUNT_NOINTR; |
780 | break; | 787 | break; |
781 | case Opt_err_panic: | 788 | case Opt_err_panic: |
782 | *mount_opt |= OCFS2_MOUNT_ERRORS_PANIC; | 789 | mopt->mount_opt |= OCFS2_MOUNT_ERRORS_PANIC; |
783 | break; | 790 | break; |
784 | case Opt_err_ro: | 791 | case Opt_err_ro: |
785 | *mount_opt &= ~OCFS2_MOUNT_ERRORS_PANIC; | 792 | mopt->mount_opt &= ~OCFS2_MOUNT_ERRORS_PANIC; |
786 | break; | 793 | break; |
787 | case Opt_data_ordered: | 794 | case Opt_data_ordered: |
788 | *mount_opt &= ~OCFS2_MOUNT_DATA_WRITEBACK; | 795 | mopt->mount_opt &= ~OCFS2_MOUNT_DATA_WRITEBACK; |
789 | break; | 796 | break; |
790 | case Opt_data_writeback: | 797 | case Opt_data_writeback: |
791 | *mount_opt |= OCFS2_MOUNT_DATA_WRITEBACK; | 798 | mopt->mount_opt |= OCFS2_MOUNT_DATA_WRITEBACK; |
792 | break; | 799 | break; |
793 | case Opt_atime_quantum: | 800 | case Opt_atime_quantum: |
794 | if (match_int(&args[0], &option)) { | 801 | if (match_int(&args[0], &option)) { |
@@ -796,9 +803,7 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
796 | goto bail; | 803 | goto bail; |
797 | } | 804 | } |
798 | if (option >= 0) | 805 | if (option >= 0) |
799 | osb->s_atime_quantum = option; | 806 | mopt->atime_quantum = option; |
800 | else | ||
801 | osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM; | ||
802 | break; | 807 | break; |
803 | case Opt_slot: | 808 | case Opt_slot: |
804 | option = 0; | 809 | option = 0; |
@@ -807,7 +812,7 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
807 | goto bail; | 812 | goto bail; |
808 | } | 813 | } |
809 | if (option) | 814 | if (option) |
810 | *slot = (s16)option; | 815 | mopt->slot = (s16)option; |
811 | break; | 816 | break; |
812 | default: | 817 | default: |
813 | mlog(ML_ERROR, | 818 | mlog(ML_ERROR, |
diff --git a/fs/ocfs2/vote.c b/fs/ocfs2/vote.c index 66a13ee63d4c..c05358538f2b 100644 --- a/fs/ocfs2/vote.c +++ b/fs/ocfs2/vote.c | |||
@@ -66,7 +66,7 @@ struct ocfs2_vote_msg | |||
66 | { | 66 | { |
67 | struct ocfs2_msg_hdr v_hdr; | 67 | struct ocfs2_msg_hdr v_hdr; |
68 | __be32 v_reserved1; | 68 | __be32 v_reserved1; |
69 | }; | 69 | } __attribute__ ((packed)); |
70 | 70 | ||
71 | /* Responses are given these values to maintain backwards | 71 | /* Responses are given these values to maintain backwards |
72 | * compatibility with older ocfs2 versions */ | 72 | * compatibility with older ocfs2 versions */ |
@@ -78,7 +78,7 @@ struct ocfs2_response_msg | |||
78 | { | 78 | { |
79 | struct ocfs2_msg_hdr r_hdr; | 79 | struct ocfs2_msg_hdr r_hdr; |
80 | __be32 r_response; | 80 | __be32 r_response; |
81 | }; | 81 | } __attribute__ ((packed)); |
82 | 82 | ||
83 | struct ocfs2_vote_work { | 83 | struct ocfs2_vote_work { |
84 | struct list_head w_list; | 84 | struct list_head w_list; |