aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/alloc.c6
-rw-r--r--fs/ocfs2/aops.c11
-rw-r--r--fs/ocfs2/cluster/heartbeat.c2
-rw-r--r--fs/ocfs2/cluster/tcp.c10
-rw-r--r--fs/ocfs2/dir.c7
-rw-r--r--fs/ocfs2/dlm/dlmast.c12
-rw-r--r--fs/ocfs2/dlm/dlmrecovery.c4
-rw-r--r--fs/ocfs2/dlm/dlmthread.c2
-rw-r--r--fs/ocfs2/dlmglue.c54
-rw-r--r--fs/ocfs2/dlmglue.h7
-rw-r--r--fs/ocfs2/export.c6
-rw-r--r--fs/ocfs2/file.c17
-rw-r--r--fs/ocfs2/file.h5
-rw-r--r--fs/ocfs2/inode.c35
-rw-r--r--fs/ocfs2/inode.h1
-rw-r--r--fs/ocfs2/ioctl.c24
-rw-r--r--fs/ocfs2/ioctl.h1
-rw-r--r--fs/ocfs2/journal.c7
-rw-r--r--fs/ocfs2/namei.c5
-rw-r--r--fs/ocfs2/ocfs2.h12
-rw-r--r--fs/ocfs2/ocfs2_fs.h2
-rw-r--r--fs/ocfs2/suballoc.c10
-rw-r--r--fs/ocfs2/super.c2
23 files changed, 151 insertions, 91 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index a0c8667caa72..19712a7d145f 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -2869,7 +2869,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
2869 tl = &tl_copy->id2.i_dealloc; 2869 tl = &tl_copy->id2.i_dealloc;
2870 num_recs = le16_to_cpu(tl->tl_used); 2870 num_recs = le16_to_cpu(tl->tl_used);
2871 mlog(0, "cleanup %u records from %llu\n", num_recs, 2871 mlog(0, "cleanup %u records from %llu\n", num_recs,
2872 (unsigned long long)tl_copy->i_blkno); 2872 (unsigned long long)le64_to_cpu(tl_copy->i_blkno));
2873 2873
2874 mutex_lock(&tl_inode->i_mutex); 2874 mutex_lock(&tl_inode->i_mutex);
2875 for(i = 0; i < num_recs; i++) { 2875 for(i = 0; i < num_recs; i++) {
@@ -3801,8 +3801,8 @@ int ocfs2_prepare_truncate(struct ocfs2_super *osb,
3801 fe = (struct ocfs2_dinode *) fe_bh->b_data; 3801 fe = (struct ocfs2_dinode *) fe_bh->b_data;
3802 3802
3803 mlog(0, "fe->i_clusters = %u, new_i_clusters = %u, fe->i_size =" 3803 mlog(0, "fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
3804 "%llu\n", fe->i_clusters, new_i_clusters, 3804 "%llu\n", le32_to_cpu(fe->i_clusters), new_i_clusters,
3805 (unsigned long long)fe->i_size); 3805 (unsigned long long)le64_to_cpu(fe->i_size));
3806 3806
3807 *tc = kzalloc(sizeof(struct ocfs2_truncate_context), GFP_KERNEL); 3807 *tc = kzalloc(sizeof(struct ocfs2_truncate_context), GFP_KERNEL);
3808 if (!(*tc)) { 3808 if (!(*tc)) {
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 56963e6c46c0..8e7cafb5fc6c 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -78,7 +78,8 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
78 78
79 if (!OCFS2_IS_VALID_DINODE(fe)) { 79 if (!OCFS2_IS_VALID_DINODE(fe)) {
80 mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n", 80 mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n",
81 (unsigned long long)fe->i_blkno, 7, fe->i_signature); 81 (unsigned long long)le64_to_cpu(fe->i_blkno), 7,
82 fe->i_signature);
82 goto bail; 83 goto bail;
83 } 84 }
84 85
@@ -939,9 +940,9 @@ out:
939 * Returns a negative error code or the number of bytes copied into 940 * Returns a negative error code or the number of bytes copied into
940 * the page. 941 * the page.
941 */ 942 */
942int ocfs2_write_data_page(struct inode *inode, handle_t *handle, 943static int ocfs2_write_data_page(struct inode *inode, handle_t *handle,
943 u64 *p_blkno, struct page *page, 944 u64 *p_blkno, struct page *page,
944 struct ocfs2_write_ctxt *wc, int new) 945 struct ocfs2_write_ctxt *wc, int new)
945{ 946{
946 int ret, copied = 0; 947 int ret, copied = 0;
947 unsigned int from = 0, to = 0; 948 unsigned int from = 0, to = 0;
@@ -1086,7 +1087,7 @@ static ssize_t ocfs2_write(struct file *file, u32 phys, handle_t *handle,
1086 for(i = 0; i < numpages; i++) { 1087 for(i = 0; i < numpages; i++) {
1087 index = start + i; 1088 index = start + i;
1088 1089
1089 cpages[i] = grab_cache_page(mapping, index); 1090 cpages[i] = find_or_create_page(mapping, index, GFP_NOFS);
1090 if (!cpages[i]) { 1091 if (!cpages[i]) {
1091 ret = -ENOMEM; 1092 ret = -ENOMEM;
1092 mlog_errno(ret); 1093 mlog_errno(ret);
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index eba282da500e..979113479c66 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -438,7 +438,7 @@ static inline void o2hb_prepare_block(struct o2hb_region *reg,
438 hb_block)); 438 hb_block));
439 439
440 mlog(ML_HB_BIO, "our node generation = 0x%llx, cksum = 0x%x\n", 440 mlog(ML_HB_BIO, "our node generation = 0x%llx, cksum = 0x%x\n",
441 (long long)cpu_to_le64(generation), 441 (long long)generation,
442 le32_to_cpu(hb_block->hb_cksum)); 442 le32_to_cpu(hb_block->hb_cksum));
443} 443}
444 444
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index 69caf3e12fea..0b229a9c7952 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1496,7 +1496,7 @@ static void o2net_start_connect(struct work_struct *work)
1496 sock->sk->sk_allocation = GFP_ATOMIC; 1496 sock->sk->sk_allocation = GFP_ATOMIC;
1497 1497
1498 myaddr.sin_family = AF_INET; 1498 myaddr.sin_family = AF_INET;
1499 myaddr.sin_addr.s_addr = (__force u32)mynode->nd_ipv4_address; 1499 myaddr.sin_addr.s_addr = mynode->nd_ipv4_address;
1500 myaddr.sin_port = (__force u16)htons(0); /* any port */ 1500 myaddr.sin_port = (__force u16)htons(0); /* any port */
1501 1501
1502 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, 1502 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr,
@@ -1521,8 +1521,8 @@ static void o2net_start_connect(struct work_struct *work)
1521 spin_unlock(&nn->nn_lock); 1521 spin_unlock(&nn->nn_lock);
1522 1522
1523 remoteaddr.sin_family = AF_INET; 1523 remoteaddr.sin_family = AF_INET;
1524 remoteaddr.sin_addr.s_addr = (__force u32)node->nd_ipv4_address; 1524 remoteaddr.sin_addr.s_addr = node->nd_ipv4_address;
1525 remoteaddr.sin_port = (__force u16)node->nd_ipv4_port; 1525 remoteaddr.sin_port = node->nd_ipv4_port;
1526 1526
1527 ret = sc->sc_sock->ops->connect(sc->sc_sock, 1527 ret = sc->sc_sock->ops->connect(sc->sc_sock,
1528 (struct sockaddr *)&remoteaddr, 1528 (struct sockaddr *)&remoteaddr,
@@ -1810,8 +1810,8 @@ static int o2net_open_listening_sock(__be32 addr, __be16 port)
1810 int ret; 1810 int ret;
1811 struct sockaddr_in sin = { 1811 struct sockaddr_in sin = {
1812 .sin_family = PF_INET, 1812 .sin_family = PF_INET,
1813 .sin_addr = { .s_addr = (__force u32)addr }, 1813 .sin_addr = { .s_addr = addr },
1814 .sin_port = (__force u16)port, 1814 .sin_port = port,
1815 }; 1815 };
1816 1816
1817 ret = sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock); 1817 ret = sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 67e6866a2a4f..c441ef1f2bad 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -403,7 +403,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
403 struct buffer_head **new_de_bh) 403 struct buffer_head **new_de_bh)
404{ 404{
405 int status = 0; 405 int status = 0;
406 int credits, num_free_extents; 406 int credits, num_free_extents, drop_alloc_sem = 0;
407 loff_t dir_i_size; 407 loff_t dir_i_size;
408 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) parent_fe_bh->b_data; 408 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
409 struct ocfs2_alloc_context *data_ac = NULL; 409 struct ocfs2_alloc_context *data_ac = NULL;
@@ -452,6 +452,9 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
452 credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS; 452 credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS;
453 } 453 }
454 454
455 down_write(&OCFS2_I(dir)->ip_alloc_sem);
456 drop_alloc_sem = 1;
457
455 handle = ocfs2_start_trans(osb, credits); 458 handle = ocfs2_start_trans(osb, credits);
456 if (IS_ERR(handle)) { 459 if (IS_ERR(handle)) {
457 status = PTR_ERR(handle); 460 status = PTR_ERR(handle);
@@ -497,6 +500,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
497 *new_de_bh = new_bh; 500 *new_de_bh = new_bh;
498 get_bh(*new_de_bh); 501 get_bh(*new_de_bh);
499bail: 502bail:
503 if (drop_alloc_sem)
504 up_write(&OCFS2_I(dir)->ip_alloc_sem);
500 if (handle) 505 if (handle)
501 ocfs2_commit_trans(osb, handle); 506 ocfs2_commit_trans(osb, handle);
502 507
diff --git a/fs/ocfs2/dlm/dlmast.c b/fs/ocfs2/dlm/dlmast.c
index 241cad342a48..2fd8bded38f3 100644
--- a/fs/ocfs2/dlm/dlmast.c
+++ b/fs/ocfs2/dlm/dlmast.c
@@ -312,8 +312,8 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
312 past->type != DLM_BAST) { 312 past->type != DLM_BAST) {
313 mlog(ML_ERROR, "Unknown ast type! %d, cookie=%u:%llu" 313 mlog(ML_ERROR, "Unknown ast type! %d, cookie=%u:%llu"
314 "name=%.*s\n", past->type, 314 "name=%.*s\n", past->type,
315 dlm_get_lock_cookie_node(be64_to_cpu(cookie)), 315 dlm_get_lock_cookie_node(cookie),
316 dlm_get_lock_cookie_seq(be64_to_cpu(cookie)), 316 dlm_get_lock_cookie_seq(cookie),
317 locklen, name); 317 locklen, name);
318 ret = DLM_IVLOCKID; 318 ret = DLM_IVLOCKID;
319 goto leave; 319 goto leave;
@@ -324,8 +324,8 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
324 mlog(0, "got %sast for unknown lockres! " 324 mlog(0, "got %sast for unknown lockres! "
325 "cookie=%u:%llu, name=%.*s, namelen=%u\n", 325 "cookie=%u:%llu, name=%.*s, namelen=%u\n",
326 past->type == DLM_AST ? "" : "b", 326 past->type == DLM_AST ? "" : "b",
327 dlm_get_lock_cookie_node(be64_to_cpu(cookie)), 327 dlm_get_lock_cookie_node(cookie),
328 dlm_get_lock_cookie_seq(be64_to_cpu(cookie)), 328 dlm_get_lock_cookie_seq(cookie),
329 locklen, name, locklen); 329 locklen, name, locklen);
330 ret = DLM_IVLOCKID; 330 ret = DLM_IVLOCKID;
331 goto leave; 331 goto leave;
@@ -370,8 +370,8 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
370 370
371 mlog(0, "got %sast for unknown lock! cookie=%u:%llu, " 371 mlog(0, "got %sast for unknown lock! cookie=%u:%llu, "
372 "name=%.*s, namelen=%u\n", past->type == DLM_AST ? "" : "b", 372 "name=%.*s, namelen=%u\n", past->type == DLM_AST ? "" : "b",
373 dlm_get_lock_cookie_node(be64_to_cpu(cookie)), 373 dlm_get_lock_cookie_node(cookie),
374 dlm_get_lock_cookie_seq(be64_to_cpu(cookie)), 374 dlm_get_lock_cookie_seq(cookie),
375 locklen, name, locklen); 375 locklen, name, locklen);
376 376
377 ret = DLM_NORMAL; 377 ret = DLM_NORMAL;
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index c1807a42c49f..671c4ed58ee2 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -1769,7 +1769,7 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
1769 /* lock is always created locally first, and 1769 /* lock is always created locally first, and
1770 * destroyed locally last. it must be on the list */ 1770 * destroyed locally last. it must be on the list */
1771 if (!lock) { 1771 if (!lock) {
1772 u64 c = ml->cookie; 1772 __be64 c = ml->cookie;
1773 mlog(ML_ERROR, "could not find local lock " 1773 mlog(ML_ERROR, "could not find local lock "
1774 "with cookie %u:%llu!\n", 1774 "with cookie %u:%llu!\n",
1775 dlm_get_lock_cookie_node(be64_to_cpu(c)), 1775 dlm_get_lock_cookie_node(be64_to_cpu(c)),
@@ -1878,7 +1878,7 @@ skip_lvb:
1878 spin_lock(&res->spinlock); 1878 spin_lock(&res->spinlock);
1879 list_for_each_entry(lock, queue, list) { 1879 list_for_each_entry(lock, queue, list) {
1880 if (lock->ml.cookie == ml->cookie) { 1880 if (lock->ml.cookie == ml->cookie) {
1881 u64 c = lock->ml.cookie; 1881 __be64 c = lock->ml.cookie;
1882 mlog(ML_ERROR, "%s:%.*s: %u:%llu: lock already " 1882 mlog(ML_ERROR, "%s:%.*s: %u:%llu: lock already "
1883 "exists on this lockres!\n", dlm->name, 1883 "exists on this lockres!\n", dlm->name,
1884 res->lockname.len, res->lockname.name, 1884 res->lockname.len, res->lockname.name,
diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c
index 2b264c6ba039..cebd089f8955 100644
--- a/fs/ocfs2/dlm/dlmthread.c
+++ b/fs/ocfs2/dlm/dlmthread.c
@@ -76,7 +76,7 @@ repeat:
76 goto repeat; 76 goto repeat;
77 } 77 }
78 remove_wait_queue(&res->wq, &wait); 78 remove_wait_queue(&res->wq, &wait);
79 current->state = TASK_RUNNING; 79 __set_current_state(TASK_RUNNING);
80} 80}
81 81
82int __dlm_lockres_has_locks(struct dlm_lock_resource *res) 82int __dlm_lockres_has_locks(struct dlm_lock_resource *res)
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 27e43b0c0eae..024777abc8e3 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -104,6 +104,35 @@ static int ocfs2_dentry_convert_worker(struct ocfs2_lock_res *lockres,
104static void ocfs2_dentry_post_unlock(struct ocfs2_super *osb, 104static void ocfs2_dentry_post_unlock(struct ocfs2_super *osb,
105 struct ocfs2_lock_res *lockres); 105 struct ocfs2_lock_res *lockres);
106 106
107
108#define mlog_meta_lvb(__level, __lockres) ocfs2_dump_meta_lvb_info(__level, __PRETTY_FUNCTION__, __LINE__, __lockres)
109
110/* This aids in debugging situations where a bad LVB might be involved. */
111static void ocfs2_dump_meta_lvb_info(u64 level,
112 const char *function,
113 unsigned int line,
114 struct ocfs2_lock_res *lockres)
115{
116 struct ocfs2_meta_lvb *lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb;
117
118 mlog(level, "LVB information for %s (called from %s:%u):\n",
119 lockres->l_name, function, line);
120 mlog(level, "version: %u, clusters: %u, generation: 0x%x\n",
121 lvb->lvb_version, be32_to_cpu(lvb->lvb_iclusters),
122 be32_to_cpu(lvb->lvb_igeneration));
123 mlog(level, "size: %llu, uid %u, gid %u, mode 0x%x\n",
124 (unsigned long long)be64_to_cpu(lvb->lvb_isize),
125 be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid),
126 be16_to_cpu(lvb->lvb_imode));
127 mlog(level, "nlink %u, atime_packed 0x%llx, ctime_packed 0x%llx, "
128 "mtime_packed 0x%llx iattr 0x%x\n", be16_to_cpu(lvb->lvb_inlink),
129 (long long)be64_to_cpu(lvb->lvb_iatime_packed),
130 (long long)be64_to_cpu(lvb->lvb_ictime_packed),
131 (long long)be64_to_cpu(lvb->lvb_imtime_packed),
132 be32_to_cpu(lvb->lvb_iattr));
133}
134
135
107/* 136/*
108 * OCFS2 Lock Resource Operations 137 * OCFS2 Lock Resource Operations
109 * 138 *
@@ -3078,28 +3107,3 @@ static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb,
3078 3107
3079 mlog_exit_void(); 3108 mlog_exit_void();
3080} 3109}
3081
3082/* This aids in debugging situations where a bad LVB might be involved. */
3083void ocfs2_dump_meta_lvb_info(u64 level,
3084 const char *function,
3085 unsigned int line,
3086 struct ocfs2_lock_res *lockres)
3087{
3088 struct ocfs2_meta_lvb *lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb;
3089
3090 mlog(level, "LVB information for %s (called from %s:%u):\n",
3091 lockres->l_name, function, line);
3092 mlog(level, "version: %u, clusters: %u, generation: 0x%x\n",
3093 lvb->lvb_version, be32_to_cpu(lvb->lvb_iclusters),
3094 be32_to_cpu(lvb->lvb_igeneration));
3095 mlog(level, "size: %llu, uid %u, gid %u, mode 0x%x\n",
3096 (unsigned long long)be64_to_cpu(lvb->lvb_isize),
3097 be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid),
3098 be16_to_cpu(lvb->lvb_imode));
3099 mlog(level, "nlink %u, atime_packed 0x%llx, ctime_packed 0x%llx, "
3100 "mtime_packed 0x%llx iattr 0x%x\n", be16_to_cpu(lvb->lvb_inlink),
3101 (long long)be64_to_cpu(lvb->lvb_iatime_packed),
3102 (long long)be64_to_cpu(lvb->lvb_ictime_packed),
3103 (long long)be64_to_cpu(lvb->lvb_imtime_packed),
3104 be32_to_cpu(lvb->lvb_iattr));
3105}
diff --git a/fs/ocfs2/dlmglue.h b/fs/ocfs2/dlmglue.h
index 59cb566e7983..492bad32a8c0 100644
--- a/fs/ocfs2/dlmglue.h
+++ b/fs/ocfs2/dlmglue.h
@@ -119,11 +119,4 @@ void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
119struct ocfs2_dlm_debug *ocfs2_new_dlm_debug(void); 119struct ocfs2_dlm_debug *ocfs2_new_dlm_debug(void);
120void ocfs2_put_dlm_debug(struct ocfs2_dlm_debug *dlm_debug); 120void ocfs2_put_dlm_debug(struct ocfs2_dlm_debug *dlm_debug);
121 121
122/* aids in debugging and tracking lvbs */
123void ocfs2_dump_meta_lvb_info(u64 level,
124 const char *function,
125 unsigned int line,
126 struct ocfs2_lock_res *lockres);
127#define mlog_meta_lvb(__level, __lockres) ocfs2_dump_meta_lvb_info(__level, __PRETTY_FUNCTION__, __LINE__, __lockres)
128
129#endif /* DLMGLUE_H */ 122#endif /* DLMGLUE_H */
diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
index 56e1fefc1205..bc48177bd183 100644
--- a/fs/ocfs2/export.c
+++ b/fs/ocfs2/export.c
@@ -140,7 +140,7 @@ bail:
140 return parent; 140 return parent;
141} 141}
142 142
143static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len, 143static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
144 int connectable) 144 int connectable)
145{ 145{
146 struct inode *inode = dentry->d_inode; 146 struct inode *inode = dentry->d_inode;
@@ -148,6 +148,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len,
148 int type = 1; 148 int type = 1;
149 u64 blkno; 149 u64 blkno;
150 u32 generation; 150 u32 generation;
151 __le32 *fh = (__force __le32 *) fh_in;
151 152
152 mlog_entry("(0x%p, '%.*s', 0x%p, %d, %d)\n", dentry, 153 mlog_entry("(0x%p, '%.*s', 0x%p, %d, %d)\n", dentry,
153 dentry->d_name.len, dentry->d_name.name, 154 dentry->d_name.len, dentry->d_name.name,
@@ -199,7 +200,7 @@ bail:
199 return type; 200 return type;
200} 201}
201 202
202static struct dentry *ocfs2_decode_fh(struct super_block *sb, __be32 *fh, 203static struct dentry *ocfs2_decode_fh(struct super_block *sb, u32 *fh_in,
203 int fh_len, int fileid_type, 204 int fh_len, int fileid_type,
204 int (*acceptable)(void *context, 205 int (*acceptable)(void *context,
205 struct dentry *de), 206 struct dentry *de),
@@ -207,6 +208,7 @@ static struct dentry *ocfs2_decode_fh(struct super_block *sb, __be32 *fh,
207{ 208{
208 struct ocfs2_inode_handle handle, parent; 209 struct ocfs2_inode_handle handle, parent;
209 struct dentry *ret = NULL; 210 struct dentry *ret = NULL;
211 __le32 *fh = (__force __le32 *) fh_in;
210 212
211 mlog_entry("(0x%p, 0x%p, %d, %d, 0x%p, 0x%p)\n", 213 mlog_entry("(0x%p, 0x%p, %d, %d, 0x%p, 0x%p)\n",
212 sb, fh, fh_len, fileid_type, acceptable, context); 214 sb, fh, fh_len, fileid_type, acceptable, context);
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 520a2a6d7670..9395b4fa547d 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -207,10 +207,10 @@ out:
207 return ret; 207 return ret;
208} 208}
209 209
210int ocfs2_set_inode_size(handle_t *handle, 210static int ocfs2_set_inode_size(handle_t *handle,
211 struct inode *inode, 211 struct inode *inode,
212 struct buffer_head *fe_bh, 212 struct buffer_head *fe_bh,
213 u64 new_i_size) 213 u64 new_i_size)
214{ 214{
215 int status; 215 int status;
216 216
@@ -713,7 +713,8 @@ restarted_transaction:
713 } 713 }
714 714
715 mlog(0, "fe: i_clusters = %u, i_size=%llu\n", 715 mlog(0, "fe: i_clusters = %u, i_size=%llu\n",
716 fe->i_clusters, (unsigned long long)fe->i_size); 716 le32_to_cpu(fe->i_clusters),
717 (unsigned long long)le64_to_cpu(fe->i_size));
717 mlog(0, "inode: ip_clusters=%u, i_size=%lld\n", 718 mlog(0, "inode: ip_clusters=%u, i_size=%lld\n",
718 OCFS2_I(inode)->ip_clusters, i_size_read(inode)); 719 OCFS2_I(inode)->ip_clusters, i_size_read(inode));
719 720
@@ -1853,6 +1854,9 @@ const struct file_operations ocfs2_fops = {
1853 .aio_read = ocfs2_file_aio_read, 1854 .aio_read = ocfs2_file_aio_read,
1854 .aio_write = ocfs2_file_aio_write, 1855 .aio_write = ocfs2_file_aio_write,
1855 .ioctl = ocfs2_ioctl, 1856 .ioctl = ocfs2_ioctl,
1857#ifdef CONFIG_COMPAT
1858 .compat_ioctl = ocfs2_compat_ioctl,
1859#endif
1856 .splice_read = ocfs2_file_splice_read, 1860 .splice_read = ocfs2_file_splice_read,
1857 .splice_write = ocfs2_file_splice_write, 1861 .splice_write = ocfs2_file_splice_write,
1858}; 1862};
@@ -1862,4 +1866,7 @@ const struct file_operations ocfs2_dops = {
1862 .readdir = ocfs2_readdir, 1866 .readdir = ocfs2_readdir,
1863 .fsync = ocfs2_sync_file, 1867 .fsync = ocfs2_sync_file,
1864 .ioctl = ocfs2_ioctl, 1868 .ioctl = ocfs2_ioctl,
1869#ifdef CONFIG_COMPAT
1870 .compat_ioctl = ocfs2_compat_ioctl,
1871#endif
1865}; 1872};
diff --git a/fs/ocfs2/file.h b/fs/ocfs2/file.h
index 2c4460fced52..a4dd1fa1822b 100644
--- a/fs/ocfs2/file.h
+++ b/fs/ocfs2/file.h
@@ -56,11 +56,6 @@ int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry,
56int ocfs2_permission(struct inode *inode, int mask, 56int ocfs2_permission(struct inode *inode, int mask,
57 struct nameidata *nd); 57 struct nameidata *nd);
58 58
59int ocfs2_set_inode_size(handle_t *handle,
60 struct inode *inode,
61 struct buffer_head *fe_bh,
62 u64 new_i_size);
63
64int ocfs2_should_update_atime(struct inode *inode, 59int ocfs2_should_update_atime(struct inode *inode,
65 struct vfsmount *vfsmnt); 60 struct vfsmount *vfsmnt);
66int ocfs2_update_inode_atime(struct inode *inode, 61int ocfs2_update_inode_atime(struct inode *inode,
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 21a605079c62..bc844bfe607c 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -89,6 +89,25 @@ void ocfs2_set_inode_flags(struct inode *inode)
89 inode->i_flags |= S_DIRSYNC; 89 inode->i_flags |= S_DIRSYNC;
90} 90}
91 91
92/* Propagate flags from i_flags to OCFS2_I(inode)->ip_attr */
93void ocfs2_get_inode_flags(struct ocfs2_inode_info *oi)
94{
95 unsigned int flags = oi->vfs_inode.i_flags;
96
97 oi->ip_attr &= ~(OCFS2_SYNC_FL|OCFS2_APPEND_FL|
98 OCFS2_IMMUTABLE_FL|OCFS2_NOATIME_FL|OCFS2_DIRSYNC_FL);
99 if (flags & S_SYNC)
100 oi->ip_attr |= OCFS2_SYNC_FL;
101 if (flags & S_APPEND)
102 oi->ip_attr |= OCFS2_APPEND_FL;
103 if (flags & S_IMMUTABLE)
104 oi->ip_attr |= OCFS2_IMMUTABLE_FL;
105 if (flags & S_NOATIME)
106 oi->ip_attr |= OCFS2_NOATIME_FL;
107 if (flags & S_DIRSYNC)
108 oi->ip_attr |= OCFS2_DIRSYNC_FL;
109}
110
92struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags) 111struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags)
93{ 112{
94 struct inode *inode = NULL; 113 struct inode *inode = NULL;
@@ -196,7 +215,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
196 int status = -EINVAL; 215 int status = -EINVAL;
197 216
198 mlog_entry("(0x%p, size:%llu)\n", inode, 217 mlog_entry("(0x%p, size:%llu)\n", inode,
199 (unsigned long long)fe->i_size); 218 (unsigned long long)le64_to_cpu(fe->i_size));
200 219
201 sb = inode->i_sb; 220 sb = inode->i_sb;
202 osb = OCFS2_SB(sb); 221 osb = OCFS2_SB(sb);
@@ -248,7 +267,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
248 mlog(ML_ERROR, 267 mlog(ML_ERROR,
249 "ip_blkno %llu != i_blkno %llu!\n", 268 "ip_blkno %llu != i_blkno %llu!\n",
250 (unsigned long long)OCFS2_I(inode)->ip_blkno, 269 (unsigned long long)OCFS2_I(inode)->ip_blkno,
251 (unsigned long long)fe->i_blkno); 270 (unsigned long long)le64_to_cpu(fe->i_blkno));
252 271
253 inode->i_nlink = le16_to_cpu(fe->i_links_count); 272 inode->i_nlink = le16_to_cpu(fe->i_links_count);
254 273
@@ -301,7 +320,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
301 * the generation argument to 320 * the generation argument to
302 * ocfs2_inode_lock_res_init() will have to change. 321 * ocfs2_inode_lock_res_init() will have to change.
303 */ 322 */
304 BUG_ON(fe->i_flags & cpu_to_le32(OCFS2_SYSTEM_FL)); 323 BUG_ON(le32_to_cpu(fe->i_flags) & OCFS2_SYSTEM_FL);
305 324
306 ocfs2_inode_lock_res_init(&OCFS2_I(inode)->ip_meta_lockres, 325 ocfs2_inode_lock_res_init(&OCFS2_I(inode)->ip_meta_lockres,
307 OCFS2_LOCK_TYPE_META, 0, inode); 326 OCFS2_LOCK_TYPE_META, 0, inode);
@@ -437,7 +456,8 @@ static int ocfs2_read_locked_inode(struct inode *inode,
437 fe = (struct ocfs2_dinode *) bh->b_data; 456 fe = (struct ocfs2_dinode *) bh->b_data;
438 if (!OCFS2_IS_VALID_DINODE(fe)) { 457 if (!OCFS2_IS_VALID_DINODE(fe)) {
439 mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n", 458 mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n",
440 (unsigned long long)fe->i_blkno, 7, fe->i_signature); 459 (unsigned long long)le64_to_cpu(fe->i_blkno), 7,
460 fe->i_signature);
441 goto bail; 461 goto bail;
442 } 462 }
443 463
@@ -812,8 +832,8 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
812 "Inode %llu (on-disk %llu) not orphaned! " 832 "Inode %llu (on-disk %llu) not orphaned! "
813 "Disk flags 0x%x, inode flags 0x%x\n", 833 "Disk flags 0x%x, inode flags 0x%x\n",
814 (unsigned long long)oi->ip_blkno, 834 (unsigned long long)oi->ip_blkno,
815 (unsigned long long)di->i_blkno, di->i_flags, 835 (unsigned long long)le64_to_cpu(di->i_blkno),
816 oi->ip_flags); 836 le32_to_cpu(di->i_flags), oi->ip_flags);
817 goto bail; 837 goto bail;
818 } 838 }
819 839
@@ -1106,8 +1126,10 @@ struct buffer_head *ocfs2_bread(struct inode *inode,
1106 return NULL; 1126 return NULL;
1107 } 1127 }
1108 1128
1129 down_read(&OCFS2_I(inode)->ip_alloc_sem);
1109 tmperr = ocfs2_extent_map_get_blocks(inode, block, &p_blkno, NULL, 1130 tmperr = ocfs2_extent_map_get_blocks(inode, block, &p_blkno, NULL,
1110 NULL); 1131 NULL);
1132 up_read(&OCFS2_I(inode)->ip_alloc_sem);
1111 if (tmperr < 0) { 1133 if (tmperr < 0) {
1112 mlog_errno(tmperr); 1134 mlog_errno(tmperr);
1113 goto fail; 1135 goto fail;
@@ -1197,6 +1219,7 @@ int ocfs2_mark_inode_dirty(handle_t *handle,
1197 1219
1198 spin_lock(&OCFS2_I(inode)->ip_lock); 1220 spin_lock(&OCFS2_I(inode)->ip_lock);
1199 fe->i_clusters = cpu_to_le32(OCFS2_I(inode)->ip_clusters); 1221 fe->i_clusters = cpu_to_le32(OCFS2_I(inode)->ip_clusters);
1222 ocfs2_get_inode_flags(OCFS2_I(inode));
1200 fe->i_attr = cpu_to_le32(OCFS2_I(inode)->ip_attr); 1223 fe->i_attr = cpu_to_le32(OCFS2_I(inode)->ip_attr);
1201 spin_unlock(&OCFS2_I(inode)->ip_lock); 1224 spin_unlock(&OCFS2_I(inode)->ip_lock);
1202 1225
diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h
index 03ae075869ee..a41d0817121b 100644
--- a/fs/ocfs2/inode.h
+++ b/fs/ocfs2/inode.h
@@ -141,6 +141,7 @@ int ocfs2_aio_read(struct file *file, struct kiocb *req, struct iocb *iocb);
141int ocfs2_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb); 141int ocfs2_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb);
142 142
143void ocfs2_set_inode_flags(struct inode *inode); 143void ocfs2_set_inode_flags(struct inode *inode);
144void ocfs2_get_inode_flags(struct ocfs2_inode_info *oi);
144 145
145static inline blkcnt_t ocfs2_inode_sector_count(struct inode *inode) 146static inline blkcnt_t ocfs2_inode_sector_count(struct inode *inode)
146{ 147{
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index 4768be5f3086..f3ad21ad9aed 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -31,6 +31,7 @@ static int ocfs2_get_inode_attr(struct inode *inode, unsigned *flags)
31 mlog_errno(status); 31 mlog_errno(status);
32 return status; 32 return status;
33 } 33 }
34 ocfs2_get_inode_flags(OCFS2_I(inode));
34 *flags = OCFS2_I(inode)->ip_attr; 35 *flags = OCFS2_I(inode)->ip_attr;
35 ocfs2_meta_unlock(inode, 0); 36 ocfs2_meta_unlock(inode, 0);
36 37
@@ -134,3 +135,26 @@ int ocfs2_ioctl(struct inode * inode, struct file * filp,
134 } 135 }
135} 136}
136 137
138#ifdef CONFIG_COMPAT
139long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
140{
141 struct inode *inode = file->f_path.dentry->d_inode;
142 int ret;
143
144 switch (cmd) {
145 case OCFS2_IOC32_GETFLAGS:
146 cmd = OCFS2_IOC_GETFLAGS;
147 break;
148 case OCFS2_IOC32_SETFLAGS:
149 cmd = OCFS2_IOC_SETFLAGS;
150 break;
151 default:
152 return -ENOIOCTLCMD;
153 }
154
155 lock_kernel();
156 ret = ocfs2_ioctl(inode, file, cmd, arg);
157 unlock_kernel();
158 return ret;
159}
160#endif
diff --git a/fs/ocfs2/ioctl.h b/fs/ocfs2/ioctl.h
index 4a7c82931dba..4d6c4f430d0d 100644
--- a/fs/ocfs2/ioctl.h
+++ b/fs/ocfs2/ioctl.h
@@ -12,5 +12,6 @@
12 12
13int ocfs2_ioctl(struct inode * inode, struct file * filp, 13int ocfs2_ioctl(struct inode * inode, struct file * filp,
14 unsigned int cmd, unsigned long arg); 14 unsigned int cmd, unsigned long arg);
15long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg);
15 16
16#endif /* OCFS2_IOCTL_H */ 17#endif /* OCFS2_IOCTL_H */
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index 5a8a90d1c787..dc1188081720 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -435,7 +435,8 @@ static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,
435 * handle the errors in a specific manner, so no need 435 * handle the errors in a specific manner, so no need
436 * to call ocfs2_error() here. */ 436 * to call ocfs2_error() here. */
437 mlog(ML_ERROR, "Journal dinode %llu has invalid " 437 mlog(ML_ERROR, "Journal dinode %llu has invalid "
438 "signature: %.*s", (unsigned long long)fe->i_blkno, 7, 438 "signature: %.*s",
439 (unsigned long long)le64_to_cpu(fe->i_blkno), 7,
439 fe->i_signature); 440 fe->i_signature);
440 status = -EIO; 441 status = -EIO;
441 goto out; 442 goto out;
@@ -742,7 +743,7 @@ void ocfs2_complete_recovery(struct work_struct *work)
742 la_dinode = item->lri_la_dinode; 743 la_dinode = item->lri_la_dinode;
743 if (la_dinode) { 744 if (la_dinode) {
744 mlog(0, "Clean up local alloc %llu\n", 745 mlog(0, "Clean up local alloc %llu\n",
745 (unsigned long long)la_dinode->i_blkno); 746 (unsigned long long)le64_to_cpu(la_dinode->i_blkno));
746 747
747 ret = ocfs2_complete_local_alloc_recovery(osb, 748 ret = ocfs2_complete_local_alloc_recovery(osb,
748 la_dinode); 749 la_dinode);
@@ -755,7 +756,7 @@ void ocfs2_complete_recovery(struct work_struct *work)
755 tl_dinode = item->lri_tl_dinode; 756 tl_dinode = item->lri_tl_dinode;
756 if (tl_dinode) { 757 if (tl_dinode) {
757 mlog(0, "Clean up truncate log %llu\n", 758 mlog(0, "Clean up truncate log %llu\n",
758 (unsigned long long)tl_dinode->i_blkno); 759 (unsigned long long)le64_to_cpu(tl_dinode->i_blkno));
759 760
760 ret = ocfs2_complete_truncate_log_recovery(osb, 761 ret = ocfs2_complete_truncate_log_recovery(osb,
761 tl_dinode); 762 tl_dinode);
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 2bcf353fd7c5..36289e6295ce 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -578,8 +578,9 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
578 if (ocfs2_populate_inode(inode, fe, 1) < 0) { 578 if (ocfs2_populate_inode(inode, fe, 1) < 0) {
579 mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, " 579 mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, "
580 "i_blkno=%llu, i_ino=%lu\n", 580 "i_blkno=%llu, i_ino=%lu\n",
581 (unsigned long long) (*new_fe_bh)->b_blocknr, 581 (unsigned long long)(*new_fe_bh)->b_blocknr,
582 (unsigned long long)fe->i_blkno, inode->i_ino); 582 (unsigned long long)le64_to_cpu(fe->i_blkno),
583 inode->i_ino);
583 BUG(); 584 BUG();
584 } 585 }
585 586
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 82cc92dcf8a6..a860633e833f 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -363,9 +363,9 @@ static inline int ocfs2_mount_local(struct ocfs2_super *osb)
363 typeof(__di) ____di = (__di); \ 363 typeof(__di) ____di = (__di); \
364 ocfs2_error((__sb), \ 364 ocfs2_error((__sb), \
365 "Dinode # %llu has bad signature %.*s", \ 365 "Dinode # %llu has bad signature %.*s", \
366 (unsigned long long)(____di)->i_blkno, 7, \ 366 (unsigned long long)le64_to_cpu((____di)->i_blkno), 7, \
367 (____di)->i_signature); \ 367 (____di)->i_signature); \
368} while (0); 368} while (0)
369 369
370#define OCFS2_IS_VALID_EXTENT_BLOCK(ptr) \ 370#define OCFS2_IS_VALID_EXTENT_BLOCK(ptr) \
371 (!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE)) 371 (!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE))
@@ -374,9 +374,9 @@ static inline int ocfs2_mount_local(struct ocfs2_super *osb)
374 typeof(__eb) ____eb = (__eb); \ 374 typeof(__eb) ____eb = (__eb); \
375 ocfs2_error((__sb), \ 375 ocfs2_error((__sb), \
376 "Extent Block # %llu has bad signature %.*s", \ 376 "Extent Block # %llu has bad signature %.*s", \
377 (unsigned long long)(____eb)->h_blkno, 7, \ 377 (unsigned long long)le64_to_cpu((____eb)->h_blkno), 7, \
378 (____eb)->h_signature); \ 378 (____eb)->h_signature); \
379} while (0); 379} while (0)
380 380
381#define OCFS2_IS_VALID_GROUP_DESC(ptr) \ 381#define OCFS2_IS_VALID_GROUP_DESC(ptr) \
382 (!strcmp((ptr)->bg_signature, OCFS2_GROUP_DESC_SIGNATURE)) 382 (!strcmp((ptr)->bg_signature, OCFS2_GROUP_DESC_SIGNATURE))
@@ -385,9 +385,9 @@ static inline int ocfs2_mount_local(struct ocfs2_super *osb)
385 typeof(__gd) ____gd = (__gd); \ 385 typeof(__gd) ____gd = (__gd); \
386 ocfs2_error((__sb), \ 386 ocfs2_error((__sb), \
387 "Group Descriptor # %llu has bad signature %.*s", \ 387 "Group Descriptor # %llu has bad signature %.*s", \
388 (unsigned long long)(____gd)->bg_blkno, 7, \ 388 (unsigned long long)le64_to_cpu((____gd)->bg_blkno), 7, \
389 (____gd)->bg_signature); \ 389 (____gd)->bg_signature); \
390} while (0); 390} while (0)
391 391
392static inline unsigned long ino_from_blkno(struct super_block *sb, 392static inline unsigned long ino_from_blkno(struct super_block *sb,
393 u64 blkno) 393 u64 blkno)
diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index 71306479c68f..f0d9eb08547a 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -166,6 +166,8 @@
166 */ 166 */
167#define OCFS2_IOC_GETFLAGS _IOR('f', 1, long) 167#define OCFS2_IOC_GETFLAGS _IOR('f', 1, long)
168#define OCFS2_IOC_SETFLAGS _IOW('f', 2, long) 168#define OCFS2_IOC_SETFLAGS _IOW('f', 2, long)
169#define OCFS2_IOC32_GETFLAGS _IOR('f', 1, int)
170#define OCFS2_IOC32_SETFLAGS _IOW('f', 2, int)
169 171
170/* 172/*
171 * Journal Flags (ocfs2_dinode.id1.journal1.i_flags) 173 * Journal Flags (ocfs2_dinode.id1.journal1.i_flags)
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index 0da655ae5d6f..e3437626d183 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -849,9 +849,9 @@ static int ocfs2_relink_block_group(handle_t *handle,
849 } 849 }
850 850
851 mlog(0, "Suballoc %llu, chain %u, move group %llu to top, prev = %llu\n", 851 mlog(0, "Suballoc %llu, chain %u, move group %llu to top, prev = %llu\n",
852 (unsigned long long)fe->i_blkno, chain, 852 (unsigned long long)le64_to_cpu(fe->i_blkno), chain,
853 (unsigned long long)bg->bg_blkno, 853 (unsigned long long)le64_to_cpu(bg->bg_blkno),
854 (unsigned long long)prev_bg->bg_blkno); 854 (unsigned long long)le64_to_cpu(prev_bg->bg_blkno));
855 855
856 fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].c_blkno); 856 fe_ptr = le64_to_cpu(fe->id2.i_chain.cl_recs[chain].c_blkno);
857 bg_ptr = le64_to_cpu(bg->bg_next_group); 857 bg_ptr = le64_to_cpu(bg->bg_next_group);
@@ -1162,7 +1162,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1162 } 1162 }
1163 1163
1164 mlog(0, "alloc succeeds: we give %u bits from block group %llu\n", 1164 mlog(0, "alloc succeeds: we give %u bits from block group %llu\n",
1165 tmp_bits, (unsigned long long)bg->bg_blkno); 1165 tmp_bits, (unsigned long long)le64_to_cpu(bg->bg_blkno));
1166 1166
1167 *num_bits = tmp_bits; 1167 *num_bits = tmp_bits;
1168 1168
@@ -1227,7 +1227,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1227 } 1227 }
1228 1228
1229 mlog(0, "Allocated %u bits from suballocator %llu\n", *num_bits, 1229 mlog(0, "Allocated %u bits from suballocator %llu\n", *num_bits,
1230 (unsigned long long)fe->i_blkno); 1230 (unsigned long long)le64_to_cpu(fe->i_blkno));
1231 1231
1232 *bg_blkno = le64_to_cpu(bg->bg_blkno); 1232 *bg_blkno = le64_to_cpu(bg->bg_blkno);
1233 *bits_left = le16_to_cpu(bg->bg_free_bits_count); 1233 *bits_left = le16_to_cpu(bg->bg_free_bits_count);
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 5c9e8243691f..f5493540d94f 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1538,7 +1538,7 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di,
1538 } else if (bh->b_blocknr != le64_to_cpu(di->i_blkno)) { 1538 } else if (bh->b_blocknr != le64_to_cpu(di->i_blkno)) {
1539 mlog(ML_ERROR, "bad block number on superblock: " 1539 mlog(ML_ERROR, "bad block number on superblock: "
1540 "found %llu, should be %llu\n", 1540 "found %llu, should be %llu\n",
1541 (unsigned long long)di->i_blkno, 1541 (unsigned long long)le64_to_cpu(di->i_blkno),
1542 (unsigned long long)bh->b_blocknr); 1542 (unsigned long long)bh->b_blocknr);
1543 } else if (le32_to_cpu(di->id2.i_super.s_clustersize_bits) < 12 || 1543 } else if (le32_to_cpu(di->id2.i_super.s_clustersize_bits) < 12 ||
1544 le32_to_cpu(di->id2.i_super.s_clustersize_bits) > 20) { 1544 le32_to_cpu(di->id2.i_super.s_clustersize_bits) > 20) {