diff options
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r-- | fs/ocfs2/namei.c | 84 |
1 files changed, 44 insertions, 40 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index f6b77ff1d2bf..0673862c8bdd 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -161,8 +161,8 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
161 | goto bail; | 161 | goto bail; |
162 | } | 162 | } |
163 | 163 | ||
164 | mlog(0, "find name %.*s in directory %"MLFu64"\n", dentry->d_name.len, | 164 | mlog(0, "find name %.*s in directory %llu\n", dentry->d_name.len, |
165 | dentry->d_name.name, OCFS2_I(dir)->ip_blkno); | 165 | dentry->d_name.name, (unsigned long long)OCFS2_I(dir)->ip_blkno); |
166 | 166 | ||
167 | status = ocfs2_meta_lock(dir, NULL, NULL, 0); | 167 | status = ocfs2_meta_lock(dir, NULL, NULL, 0); |
168 | if (status < 0) { | 168 | if (status < 0) { |
@@ -180,7 +180,8 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
180 | 180 | ||
181 | inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno); | 181 | inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno); |
182 | if (IS_ERR(inode)) { | 182 | if (IS_ERR(inode)) { |
183 | mlog(ML_ERROR, "Unable to create inode %"MLFu64"\n", blkno); | 183 | mlog(ML_ERROR, "Unable to create inode %llu\n", |
184 | (unsigned long long)blkno); | ||
184 | ret = ERR_PTR(-EACCES); | 185 | ret = ERR_PTR(-EACCES); |
185 | goto bail_unlock; | 186 | goto bail_unlock; |
186 | } | 187 | } |
@@ -310,8 +311,8 @@ static int ocfs2_mknod(struct inode *dir, | |||
310 | osb = OCFS2_SB(dir->i_sb); | 311 | osb = OCFS2_SB(dir->i_sb); |
311 | 312 | ||
312 | if (S_ISDIR(mode) && (dir->i_nlink >= OCFS2_LINK_MAX)) { | 313 | if (S_ISDIR(mode) && (dir->i_nlink >= OCFS2_LINK_MAX)) { |
313 | mlog(ML_ERROR, "inode %"MLFu64" has i_nlink of %u\n", | 314 | mlog(ML_ERROR, "inode %llu has i_nlink of %u\n", |
314 | OCFS2_I(dir)->ip_blkno, dir->i_nlink); | 315 | (unsigned long long)OCFS2_I(dir)->ip_blkno, dir->i_nlink); |
315 | status = -EMLINK; | 316 | status = -EMLINK; |
316 | goto leave; | 317 | goto leave; |
317 | } | 318 | } |
@@ -562,9 +563,9 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb, | |||
562 | 563 | ||
563 | if (ocfs2_populate_inode(inode, fe, 1) < 0) { | 564 | if (ocfs2_populate_inode(inode, fe, 1) < 0) { |
564 | mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, " | 565 | mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, " |
565 | "i_blkno=%"MLFu64", i_ino=%lu\n", | 566 | "i_blkno=%llu, i_ino=%lu\n", |
566 | (unsigned long long) (*new_fe_bh)->b_blocknr, | 567 | (unsigned long long) (*new_fe_bh)->b_blocknr, |
567 | fe->i_blkno, inode->i_ino); | 568 | (unsigned long long)fe->i_blkno, inode->i_ino); |
568 | BUG(); | 569 | BUG(); |
569 | } | 570 | } |
570 | 571 | ||
@@ -765,7 +766,7 @@ static int ocfs2_unlink(struct inode *dir, | |||
765 | 766 | ||
766 | BUG_ON(dentry->d_parent->d_inode != dir); | 767 | BUG_ON(dentry->d_parent->d_inode != dir); |
767 | 768 | ||
768 | mlog(0, "ino = %"MLFu64"\n", OCFS2_I(inode)->ip_blkno); | 769 | mlog(0, "ino = %llu\n", (unsigned long long)OCFS2_I(inode)->ip_blkno); |
769 | 770 | ||
770 | if (inode == osb->root_inode) { | 771 | if (inode == osb->root_inode) { |
771 | mlog(0, "Cannot delete the root directory\n"); | 772 | mlog(0, "Cannot delete the root directory\n"); |
@@ -799,9 +800,9 @@ static int ocfs2_unlink(struct inode *dir, | |||
799 | if (OCFS2_I(inode)->ip_blkno != blkno) { | 800 | if (OCFS2_I(inode)->ip_blkno != blkno) { |
800 | status = -ENOENT; | 801 | status = -ENOENT; |
801 | 802 | ||
802 | mlog(0, "ip_blkno (%"MLFu64") != dirent blkno (%"MLFu64") " | 803 | mlog(0, "ip_blkno %llu != dirent blkno %llu ip_flags = %x\n", |
803 | "ip_flags = %x\n", OCFS2_I(inode)->ip_blkno, blkno, | 804 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
804 | OCFS2_I(inode)->ip_flags); | 805 | (unsigned long long)blkno, OCFS2_I(inode)->ip_flags); |
805 | goto leave; | 806 | goto leave; |
806 | } | 807 | } |
807 | 808 | ||
@@ -946,8 +947,9 @@ static int ocfs2_double_lock(struct ocfs2_super *osb, | |||
946 | struct buffer_head **tmpbh; | 947 | struct buffer_head **tmpbh; |
947 | struct inode *tmpinode; | 948 | struct inode *tmpinode; |
948 | 949 | ||
949 | mlog_entry("(inode1 = %"MLFu64", inode2 = %"MLFu64")\n", | 950 | mlog_entry("(inode1 = %llu, inode2 = %llu)\n", |
950 | oi1->ip_blkno, oi2->ip_blkno); | 951 | (unsigned long long)oi1->ip_blkno, |
952 | (unsigned long long)oi2->ip_blkno); | ||
951 | 953 | ||
952 | BUG_ON(!handle); | 954 | BUG_ON(!handle); |
953 | 955 | ||
@@ -1187,9 +1189,9 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1187 | if (OCFS2_I(new_inode)->ip_blkno != newfe_blkno) { | 1189 | if (OCFS2_I(new_inode)->ip_blkno != newfe_blkno) { |
1188 | status = -EACCES; | 1190 | status = -EACCES; |
1189 | 1191 | ||
1190 | mlog(0, "Inode blkno (%"MLFu64") and dir (%"MLFu64") " | 1192 | mlog(0, "Inode %llu and dir %llu disagree. flags = %x\n", |
1191 | "disagree. ip_flags = %x\n", | 1193 | (unsigned long long)OCFS2_I(new_inode)->ip_blkno, |
1192 | OCFS2_I(new_inode)->ip_blkno, newfe_blkno, | 1194 | (unsigned long long)newfe_blkno, |
1193 | OCFS2_I(new_inode)->ip_flags); | 1195 | OCFS2_I(new_inode)->ip_flags); |
1194 | goto bail; | 1196 | goto bail; |
1195 | } | 1197 | } |
@@ -1215,9 +1217,9 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1215 | 1217 | ||
1216 | newfe = (struct ocfs2_dinode *) newfe_bh->b_data; | 1218 | newfe = (struct ocfs2_dinode *) newfe_bh->b_data; |
1217 | 1219 | ||
1218 | mlog(0, "aha rename over existing... new_de=%p " | 1220 | mlog(0, "aha rename over existing... new_de=%p new_blkno=%llu " |
1219 | "new_blkno=%"MLFu64" newfebh=%p bhblocknr=%llu\n", | 1221 | "newfebh=%p bhblocknr=%llu\n", new_de, |
1220 | new_de, newfe_blkno, newfe_bh, newfe_bh ? | 1222 | (unsigned long long)newfe_blkno, newfe_bh, newfe_bh ? |
1221 | (unsigned long long)newfe_bh->b_blocknr : 0ULL); | 1223 | (unsigned long long)newfe_bh->b_blocknr : 0ULL); |
1222 | 1224 | ||
1223 | if (S_ISDIR(new_inode->i_mode) || (new_inode->i_nlink == 1)) { | 1225 | if (S_ISDIR(new_inode->i_mode) || (new_inode->i_nlink == 1)) { |
@@ -1354,8 +1356,8 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1354 | if (new_dir_nlink != new_dir->i_nlink) { | 1356 | if (new_dir_nlink != new_dir->i_nlink) { |
1355 | if (!new_dir_bh) { | 1357 | if (!new_dir_bh) { |
1356 | mlog(ML_ERROR, "need to change nlink for new " | 1358 | mlog(ML_ERROR, "need to change nlink for new " |
1357 | "dir %"MLFu64" from %d to %d but bh is " | 1359 | "dir %llu from %d to %d but bh is NULL\n", |
1358 | "NULL\n", OCFS2_I(new_dir)->ip_blkno, | 1360 | (unsigned long long)OCFS2_I(new_dir)->ip_blkno, |
1359 | (int)new_dir_nlink, new_dir->i_nlink); | 1361 | (int)new_dir_nlink, new_dir->i_nlink); |
1360 | } else { | 1362 | } else { |
1361 | struct ocfs2_dinode *fe; | 1363 | struct ocfs2_dinode *fe; |
@@ -1372,10 +1374,9 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1372 | if (old_dir_nlink != old_dir->i_nlink) { | 1374 | if (old_dir_nlink != old_dir->i_nlink) { |
1373 | if (!old_dir_bh) { | 1375 | if (!old_dir_bh) { |
1374 | mlog(ML_ERROR, "need to change nlink for old dir " | 1376 | mlog(ML_ERROR, "need to change nlink for old dir " |
1375 | "%"MLFu64" from %d to %d but bh is NULL!\n", | 1377 | "%llu from %d to %d but bh is NULL!\n", |
1376 | OCFS2_I(old_dir)->ip_blkno, | 1378 | (unsigned long long)OCFS2_I(old_dir)->ip_blkno, |
1377 | (int)old_dir_nlink, | 1379 | (int)old_dir_nlink, old_dir->i_nlink); |
1378 | old_dir->i_nlink); | ||
1379 | } else { | 1380 | } else { |
1380 | struct ocfs2_dinode *fe; | 1381 | struct ocfs2_dinode *fe; |
1381 | status = ocfs2_journal_access(handle, old_dir, | 1382 | status = ocfs2_journal_access(handle, old_dir, |
@@ -1443,8 +1444,9 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, | |||
1443 | * write i_size + 1 bytes. */ | 1444 | * write i_size + 1 bytes. */ |
1444 | blocks = (bytes_left + sb->s_blocksize - 1) >> sb->s_blocksize_bits; | 1445 | blocks = (bytes_left + sb->s_blocksize - 1) >> sb->s_blocksize_bits; |
1445 | 1446 | ||
1446 | mlog_entry("i_blocks = %lu, i_size = %llu, blocks = %d\n", | 1447 | mlog_entry("i_blocks = %llu, i_size = %llu, blocks = %d\n", |
1447 | inode->i_blocks, i_size_read(inode), blocks); | 1448 | (unsigned long long)inode->i_blocks, |
1449 | i_size_read(inode), blocks); | ||
1448 | 1450 | ||
1449 | /* Sanity check -- make sure we're going to fit. */ | 1451 | /* Sanity check -- make sure we're going to fit. */ |
1450 | if (bytes_left > | 1452 | if (bytes_left > |
@@ -1634,9 +1636,9 @@ static int ocfs2_symlink(struct inode *dir, | |||
1634 | NULL); | 1636 | NULL); |
1635 | if (status < 0) { | 1637 | if (status < 0) { |
1636 | if (status != -ENOSPC && status != -EINTR) { | 1638 | if (status != -ENOSPC && status != -EINTR) { |
1637 | mlog(ML_ERROR, "Failed to extend file to " | 1639 | mlog(ML_ERROR, |
1638 | "%"MLFu64"\n", | 1640 | "Failed to extend file to %llu\n", |
1639 | newsize); | 1641 | (unsigned long long)newsize); |
1640 | mlog_errno(status); | 1642 | mlog_errno(status); |
1641 | status = -ENOSPC; | 1643 | status = -ENOSPC; |
1642 | } | 1644 | } |
@@ -1716,10 +1718,11 @@ int ocfs2_check_dir_entry(struct inode * dir, | |||
1716 | error_msg = "directory entry across blocks"; | 1718 | error_msg = "directory entry across blocks"; |
1717 | 1719 | ||
1718 | if (error_msg != NULL) | 1720 | if (error_msg != NULL) |
1719 | mlog(ML_ERROR, "bad entry in directory #%"MLFu64": %s - " | 1721 | mlog(ML_ERROR, "bad entry in directory #%llu: %s - " |
1720 | "offset=%lu, inode=%"MLFu64", rec_len=%d, name_len=%d\n", | 1722 | "offset=%lu, inode=%llu, rec_len=%d, name_len=%d\n", |
1721 | OCFS2_I(dir)->ip_blkno, error_msg, offset, | 1723 | (unsigned long long)OCFS2_I(dir)->ip_blkno, error_msg, |
1722 | le64_to_cpu(de->inode), rlen, de->name_len); | 1724 | offset, (unsigned long long)le64_to_cpu(de->inode), rlen, |
1725 | de->name_len); | ||
1723 | return error_msg == NULL ? 1 : 0; | 1726 | return error_msg == NULL ? 1 : 0; |
1724 | } | 1727 | } |
1725 | 1728 | ||
@@ -2021,8 +2024,8 @@ static int ocfs2_blkno_stringify(u64 blkno, char *name) | |||
2021 | 2024 | ||
2022 | mlog_entry_void(); | 2025 | mlog_entry_void(); |
2023 | 2026 | ||
2024 | namelen = snprintf(name, OCFS2_ORPHAN_NAMELEN + 1, "%016"MLFx64, | 2027 | namelen = snprintf(name, OCFS2_ORPHAN_NAMELEN + 1, "%016llx", |
2025 | blkno); | 2028 | (long long)blkno); |
2026 | if (namelen <= 0) { | 2029 | if (namelen <= 0) { |
2027 | if (namelen) | 2030 | if (namelen) |
2028 | status = namelen; | 2031 | status = namelen; |
@@ -2167,8 +2170,8 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, | |||
2167 | OCFS2_I(inode)->ip_orphaned_slot = osb->slot_num; | 2170 | OCFS2_I(inode)->ip_orphaned_slot = osb->slot_num; |
2168 | spin_unlock(&OCFS2_I(inode)->ip_lock); | 2171 | spin_unlock(&OCFS2_I(inode)->ip_lock); |
2169 | 2172 | ||
2170 | mlog(0, "Inode %"MLFu64" orphaned in slot %d\n", | 2173 | mlog(0, "Inode %llu orphaned in slot %d\n", |
2171 | OCFS2_I(inode)->ip_blkno, osb->slot_num); | 2174 | (unsigned long long)OCFS2_I(inode)->ip_blkno, osb->slot_num); |
2172 | 2175 | ||
2173 | leave: | 2176 | leave: |
2174 | if (orphan_dir_inode) | 2177 | if (orphan_dir_inode) |
@@ -2202,8 +2205,9 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, | |||
2202 | goto leave; | 2205 | goto leave; |
2203 | } | 2206 | } |
2204 | 2207 | ||
2205 | mlog(0, "removing '%s' from orphan dir %"MLFu64" (namelen=%d)\n", | 2208 | mlog(0, "removing '%s' from orphan dir %llu (namelen=%d)\n", |
2206 | name, OCFS2_I(orphan_dir_inode)->ip_blkno, OCFS2_ORPHAN_NAMELEN); | 2209 | name, (unsigned long long)OCFS2_I(orphan_dir_inode)->ip_blkno, |
2210 | OCFS2_ORPHAN_NAMELEN); | ||
2207 | 2211 | ||
2208 | /* find it's spot in the orphan directory */ | 2212 | /* find it's spot in the orphan directory */ |
2209 | target_de_bh = ocfs2_find_entry(name, OCFS2_ORPHAN_NAMELEN, | 2213 | target_de_bh = ocfs2_find_entry(name, OCFS2_ORPHAN_NAMELEN, |