You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: (39 commits) Treat writes as new when holes span across page boundaries fs,ocfs2: Move o2net_get_func_run_time under CONFIG_OCFS2_FS_STATS. ocfs2/dlm: Move kmalloc() outside the spinlock ocfs2: Make the left masklogs compat. ocfs2: Remove masklog ML_AIO. ocfs2: Remove masklog ML_UPTODATE. ocfs2: Remove masklog ML_BH_IO. ocfs2: Remove masklog ML_JOURNAL. ocfs2: Remove masklog ML_EXPORT. ocfs2: Remove masklog ML_DCACHE. ocfs2: Remove masklog ML_NAMEI. ocfs2: Remove mlog(0) from fs/ocfs2/dir.c ocfs2: remove NAMEI from symlink.c ocfs2: Remove masklog ML_QUOTA. ocfs2: Remove mlog(0) from quota_local.c. ocfs2: Remove masklog ML_RESERVATIONS. ocfs2: Remove masklog ML_XATTR. ocfs2: Remove masklog ML_SUPER. ocfs2: Remove mlog(0) from fs/ocfs2/heartbeat.c ocfs2: Remove mlog(0) from fs/ocfs2/slot_map.c ... Fix up trivial conflict in fs/ocfs2/super.c
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#define MLOG_MASK_PREFIX ML_INODE
|
||||
#include <cluster/masklog.h>
|
||||
|
||||
#include "ocfs2.h"
|
||||
|
||||
+92
-122
File diff suppressed because it is too large
Load Diff
+39
-43
@@ -29,7 +29,6 @@
|
||||
#include <linux/mpage.h>
|
||||
#include <linux/quotaops.h>
|
||||
|
||||
#define MLOG_MASK_PREFIX ML_FILE_IO
|
||||
#include <cluster/masklog.h>
|
||||
|
||||
#include "ocfs2.h"
|
||||
@@ -45,6 +44,7 @@
|
||||
#include "super.h"
|
||||
#include "symlink.h"
|
||||
#include "refcounttree.h"
|
||||
#include "ocfs2_trace.h"
|
||||
|
||||
#include "buffer_head_io.h"
|
||||
|
||||
@@ -59,8 +59,9 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
|
||||
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
|
||||
void *kaddr;
|
||||
|
||||
mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
|
||||
(unsigned long long)iblock, bh_result, create);
|
||||
trace_ocfs2_symlink_get_block(
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
(unsigned long long)iblock, bh_result, create);
|
||||
|
||||
BUG_ON(ocfs2_inode_is_fast_symlink(inode));
|
||||
|
||||
@@ -123,7 +124,6 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
|
||||
bail:
|
||||
brelse(bh);
|
||||
|
||||
mlog_exit(err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -136,8 +136,8 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock,
|
||||
u64 p_blkno, count, past_eof;
|
||||
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
|
||||
|
||||
mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
|
||||
(unsigned long long)iblock, bh_result, create);
|
||||
trace_ocfs2_get_block((unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
(unsigned long long)iblock, bh_result, create);
|
||||
|
||||
if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE)
|
||||
mlog(ML_NOTICE, "get_block on system inode 0x%p (%lu)\n",
|
||||
@@ -199,8 +199,9 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock,
|
||||
}
|
||||
|
||||
past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode));
|
||||
mlog(0, "Inode %lu, past_eof = %llu\n", inode->i_ino,
|
||||
(unsigned long long)past_eof);
|
||||
|
||||
trace_ocfs2_get_block_end((unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
(unsigned long long)past_eof);
|
||||
if (create && (iblock >= past_eof))
|
||||
set_buffer_new(bh_result);
|
||||
|
||||
@@ -208,7 +209,6 @@ bail:
|
||||
if (err < 0)
|
||||
err = -EIO;
|
||||
|
||||
mlog_exit(err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -278,7 +278,8 @@ static int ocfs2_readpage(struct file *file, struct page *page)
|
||||
loff_t start = (loff_t)page->index << PAGE_CACHE_SHIFT;
|
||||
int ret, unlock = 1;
|
||||
|
||||
mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0));
|
||||
trace_ocfs2_readpage((unsigned long long)oi->ip_blkno,
|
||||
(page ? page->index : 0));
|
||||
|
||||
ret = ocfs2_inode_lock_with_page(inode, NULL, 0, page);
|
||||
if (ret != 0) {
|
||||
@@ -323,7 +324,6 @@ out_inode_unlock:
|
||||
out:
|
||||
if (unlock)
|
||||
unlock_page(page);
|
||||
mlog_exit(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -396,15 +396,11 @@ out_unlock:
|
||||
*/
|
||||
static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)
|
||||
{
|
||||
int ret;
|
||||
trace_ocfs2_writepage(
|
||||
(unsigned long long)OCFS2_I(page->mapping->host)->ip_blkno,
|
||||
page->index);
|
||||
|
||||
mlog_entry("(0x%p)\n", page);
|
||||
|
||||
ret = block_write_full_page(page, ocfs2_get_block, wbc);
|
||||
|
||||
mlog_exit(ret);
|
||||
|
||||
return ret;
|
||||
return block_write_full_page(page, ocfs2_get_block, wbc);
|
||||
}
|
||||
|
||||
/* Taken from ext3. We don't necessarily need the full blown
|
||||
@@ -450,7 +446,8 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
|
||||
int err = 0;
|
||||
struct inode *inode = mapping->host;
|
||||
|
||||
mlog_entry("(block = %llu)\n", (unsigned long long)block);
|
||||
trace_ocfs2_bmap((unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
(unsigned long long)block);
|
||||
|
||||
/* We don't need to lock journal system files, since they aren't
|
||||
* accessed concurrently from multiple nodes.
|
||||
@@ -484,8 +481,6 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
|
||||
bail:
|
||||
status = err ? 0 : p_blkno;
|
||||
|
||||
mlog_exit((int)status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -616,9 +611,6 @@ static ssize_t ocfs2_direct_IO(int rw,
|
||||
{
|
||||
struct file *file = iocb->ki_filp;
|
||||
struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host;
|
||||
int ret;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
/*
|
||||
* Fallback to buffered I/O if we see an inode without
|
||||
@@ -631,13 +623,10 @@ static ssize_t ocfs2_direct_IO(int rw,
|
||||
if (i_size_read(inode) <= offset)
|
||||
return 0;
|
||||
|
||||
ret = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev,
|
||||
iov, offset, nr_segs,
|
||||
ocfs2_direct_IO_get_blocks,
|
||||
ocfs2_dio_end_io, NULL, 0);
|
||||
|
||||
mlog_exit(ret);
|
||||
return ret;
|
||||
return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev,
|
||||
iov, offset, nr_segs,
|
||||
ocfs2_direct_IO_get_blocks,
|
||||
ocfs2_dio_end_io, NULL, 0);
|
||||
}
|
||||
|
||||
static void ocfs2_figure_cluster_boundaries(struct ocfs2_super *osb,
|
||||
@@ -1026,6 +1015,12 @@ static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno,
|
||||
ocfs2_figure_cluster_boundaries(OCFS2_SB(inode->i_sb), cpos,
|
||||
&cluster_start, &cluster_end);
|
||||
|
||||
/* treat the write as new if the a hole/lseek spanned across
|
||||
* the page boundary.
|
||||
*/
|
||||
new = new | ((i_size_read(inode) <= page_offset(page)) &&
|
||||
(page_offset(page) <= user_pos));
|
||||
|
||||
if (page == wc->w_target_page) {
|
||||
map_from = user_pos & (PAGE_CACHE_SIZE - 1);
|
||||
map_to = map_from + user_len;
|
||||
@@ -1534,9 +1529,9 @@ static int ocfs2_try_to_write_inline_data(struct address_space *mapping,
|
||||
struct ocfs2_inode_info *oi = OCFS2_I(inode);
|
||||
struct ocfs2_dinode *di = NULL;
|
||||
|
||||
mlog(0, "Inode %llu, write of %u bytes at off %llu. features: 0x%x\n",
|
||||
(unsigned long long)oi->ip_blkno, len, (unsigned long long)pos,
|
||||
oi->ip_dyn_features);
|
||||
trace_ocfs2_try_to_write_inline_data((unsigned long long)oi->ip_blkno,
|
||||
len, (unsigned long long)pos,
|
||||
oi->ip_dyn_features);
|
||||
|
||||
/*
|
||||
* Handle inodes which already have inline data 1st.
|
||||
@@ -1739,6 +1734,13 @@ try_again:
|
||||
|
||||
di = (struct ocfs2_dinode *)wc->w_di_bh->b_data;
|
||||
|
||||
trace_ocfs2_write_begin_nolock(
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
(long long)i_size_read(inode),
|
||||
le32_to_cpu(di->i_clusters),
|
||||
pos, len, flags, mmap_page,
|
||||
clusters_to_alloc, extents_to_split);
|
||||
|
||||
/*
|
||||
* We set w_target_from, w_target_to here so that
|
||||
* ocfs2_write_end() knows which range in the target page to
|
||||
@@ -1751,12 +1753,6 @@ try_again:
|
||||
* ocfs2_lock_allocators(). It greatly over-estimates
|
||||
* the work to be done.
|
||||
*/
|
||||
mlog(0, "extend inode %llu, i_size = %lld, di->i_clusters = %u,"
|
||||
" clusters_to_add = %u, extents_to_split = %u\n",
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
(long long)i_size_read(inode), le32_to_cpu(di->i_clusters),
|
||||
clusters_to_alloc, extents_to_split);
|
||||
|
||||
ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode),
|
||||
wc->w_di_bh);
|
||||
ret = ocfs2_lock_allocators(inode, &et,
|
||||
@@ -1938,8 +1934,8 @@ static void ocfs2_write_end_inline(struct inode *inode, loff_t pos,
|
||||
memcpy(di->id2.i_data.id_data + pos, kaddr + pos, *copied);
|
||||
kunmap_atomic(kaddr, KM_USER0);
|
||||
|
||||
mlog(0, "Data written to inode at offset %llu. "
|
||||
"id_count = %u, copied = %u, i_dyn_features = 0x%x\n",
|
||||
trace_ocfs2_write_end_inline(
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
(unsigned long long)pos, *copied,
|
||||
le16_to_cpu(di->id2.i_data.id_count),
|
||||
le16_to_cpu(di->i_dyn_features));
|
||||
|
||||
+18
-31
@@ -35,8 +35,8 @@
|
||||
#include "inode.h"
|
||||
#include "journal.h"
|
||||
#include "uptodate.h"
|
||||
|
||||
#include "buffer_head_io.h"
|
||||
#include "ocfs2_trace.h"
|
||||
|
||||
/*
|
||||
* Bits on bh->b_state used by ocfs2.
|
||||
@@ -55,8 +55,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
mlog_entry("(bh->b_blocknr = %llu, ci=%p)\n",
|
||||
(unsigned long long)bh->b_blocknr, ci);
|
||||
trace_ocfs2_write_block((unsigned long long)bh->b_blocknr, ci);
|
||||
|
||||
BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO);
|
||||
BUG_ON(buffer_jbd(bh));
|
||||
@@ -66,6 +65,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
|
||||
* can get modified during recovery even if read-only. */
|
||||
if (ocfs2_is_hard_readonly(osb)) {
|
||||
ret = -EROFS;
|
||||
mlog_errno(ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -91,11 +91,11 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
|
||||
* uptodate. */
|
||||
ret = -EIO;
|
||||
put_bh(bh);
|
||||
mlog_errno(ret);
|
||||
}
|
||||
|
||||
ocfs2_metadata_cache_io_unlock(ci);
|
||||
out:
|
||||
mlog_exit(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -106,10 +106,10 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
|
||||
unsigned int i;
|
||||
struct buffer_head *bh;
|
||||
|
||||
if (!nr) {
|
||||
mlog(ML_BH_IO, "No buffers will be read!\n");
|
||||
trace_ocfs2_read_blocks_sync((unsigned long long)block, nr);
|
||||
|
||||
if (!nr)
|
||||
goto bail;
|
||||
}
|
||||
|
||||
for (i = 0 ; i < nr ; i++) {
|
||||
if (bhs[i] == NULL) {
|
||||
@@ -123,10 +123,8 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
|
||||
bh = bhs[i];
|
||||
|
||||
if (buffer_jbd(bh)) {
|
||||
mlog(ML_BH_IO,
|
||||
"trying to sync read a jbd "
|
||||
"managed bh (blocknr = %llu), skipping\n",
|
||||
(unsigned long long)bh->b_blocknr);
|
||||
trace_ocfs2_read_blocks_sync_jbd(
|
||||
(unsigned long long)bh->b_blocknr);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -186,8 +184,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
|
||||
struct buffer_head *bh;
|
||||
struct super_block *sb = ocfs2_metadata_cache_get_super(ci);
|
||||
|
||||
mlog_entry("(ci=%p, block=(%llu), nr=(%d), flags=%d)\n",
|
||||
ci, (unsigned long long)block, nr, flags);
|
||||
trace_ocfs2_read_blocks_begin(ci, (unsigned long long)block, nr, flags);
|
||||
|
||||
BUG_ON(!ci);
|
||||
BUG_ON((flags & OCFS2_BH_READAHEAD) &&
|
||||
@@ -207,7 +204,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
|
||||
}
|
||||
|
||||
if (nr == 0) {
|
||||
mlog(ML_BH_IO, "No buffers will be read!\n");
|
||||
status = 0;
|
||||
goto bail;
|
||||
}
|
||||
@@ -251,8 +247,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
|
||||
*/
|
||||
|
||||
if (!ignore_cache && !ocfs2_buffer_uptodate(ci, bh)) {
|
||||
mlog(ML_UPTODATE,
|
||||
"bh (%llu), owner %llu not uptodate\n",
|
||||
trace_ocfs2_read_blocks_from_disk(
|
||||
(unsigned long long)bh->b_blocknr,
|
||||
(unsigned long long)ocfs2_metadata_cache_owner(ci));
|
||||
/* We're using ignore_cache here to say
|
||||
@@ -260,11 +255,10 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
|
||||
ignore_cache = 1;
|
||||
}
|
||||
|
||||
trace_ocfs2_read_blocks_bh((unsigned long long)bh->b_blocknr,
|
||||
ignore_cache, buffer_jbd(bh), buffer_dirty(bh));
|
||||
|
||||
if (buffer_jbd(bh)) {
|
||||
if (ignore_cache)
|
||||
mlog(ML_BH_IO, "trying to sync read a jbd "
|
||||
"managed bh (blocknr = %llu)\n",
|
||||
(unsigned long long)bh->b_blocknr);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -272,9 +266,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
|
||||
if (buffer_dirty(bh)) {
|
||||
/* This should probably be a BUG, or
|
||||
* at least return an error. */
|
||||
mlog(ML_BH_IO, "asking me to sync read a dirty "
|
||||
"buffer! (blocknr = %llu)\n",
|
||||
(unsigned long long)bh->b_blocknr);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -367,14 +358,11 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
|
||||
}
|
||||
ocfs2_metadata_cache_io_unlock(ci);
|
||||
|
||||
mlog(ML_BH_IO, "block=(%llu), nr=(%d), cached=%s, flags=0x%x\n",
|
||||
(unsigned long long)block, nr,
|
||||
((flags & OCFS2_BH_IGNORE_CACHE) || ignore_cache) ? "no" : "yes",
|
||||
flags);
|
||||
trace_ocfs2_read_blocks_end((unsigned long long)block, nr,
|
||||
flags, ignore_cache);
|
||||
|
||||
bail:
|
||||
|
||||
mlog_exit(status);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -408,13 +396,12 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
|
||||
int ret = 0;
|
||||
struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
BUG_ON(buffer_jbd(bh));
|
||||
ocfs2_check_super_or_backup(osb->sb, bh->b_blocknr);
|
||||
|
||||
if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) {
|
||||
ret = -EROFS;
|
||||
mlog_errno(ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -434,9 +421,9 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
|
||||
if (!buffer_uptodate(bh)) {
|
||||
ret = -EIO;
|
||||
put_bh(bh);
|
||||
mlog_errno(ret);
|
||||
}
|
||||
|
||||
out:
|
||||
mlog_exit(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1654,8 +1654,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
|
||||
struct o2hb_disk_slot *slot;
|
||||
struct o2hb_disk_heartbeat_block *hb_block;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
ret = o2hb_read_slots(reg, reg->hr_blocks);
|
||||
if (ret) {
|
||||
mlog_errno(ret);
|
||||
@@ -1677,7 +1675,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
|
||||
}
|
||||
|
||||
out:
|
||||
mlog_exit(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
struct mlog_bits mlog_and_bits = MLOG_BITS_RHS(MLOG_INITIAL_AND_MASK);
|
||||
EXPORT_SYMBOL_GPL(mlog_and_bits);
|
||||
struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(MLOG_INITIAL_NOT_MASK);
|
||||
struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(0);
|
||||
EXPORT_SYMBOL_GPL(mlog_not_bits);
|
||||
|
||||
static ssize_t mlog_mask_show(u64 mask, char *buf)
|
||||
@@ -80,8 +80,6 @@ struct mlog_attribute {
|
||||
}
|
||||
|
||||
static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
|
||||
define_mask(ENTRY),
|
||||
define_mask(EXIT),
|
||||
define_mask(TCP),
|
||||
define_mask(MSG),
|
||||
define_mask(SOCKET),
|
||||
@@ -93,27 +91,11 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
|
||||
define_mask(DLM_THREAD),
|
||||
define_mask(DLM_MASTER),
|
||||
define_mask(DLM_RECOVERY),
|
||||
define_mask(AIO),
|
||||
define_mask(JOURNAL),
|
||||
define_mask(DISK_ALLOC),
|
||||
define_mask(SUPER),
|
||||
define_mask(FILE_IO),
|
||||
define_mask(EXTENT_MAP),
|
||||
define_mask(DLM_GLUE),
|
||||
define_mask(BH_IO),
|
||||
define_mask(UPTODATE),
|
||||
define_mask(NAMEI),
|
||||
define_mask(INODE),
|
||||
define_mask(VOTE),
|
||||
define_mask(DCACHE),
|
||||
define_mask(CONN),
|
||||
define_mask(QUORUM),
|
||||
define_mask(EXPORT),
|
||||
define_mask(XATTR),
|
||||
define_mask(QUOTA),
|
||||
define_mask(REFCOUNT),
|
||||
define_mask(BASTS),
|
||||
define_mask(RESERVATIONS),
|
||||
define_mask(CLUSTER),
|
||||
define_mask(ERROR),
|
||||
define_mask(NOTICE),
|
||||
|
||||
+17
-88
@@ -82,41 +82,23 @@
|
||||
|
||||
/* bits that are frequently given and infrequently matched in the low word */
|
||||
/* NOTE: If you add a flag, you need to also update masklog.c! */
|
||||
#define ML_ENTRY 0x0000000000000001ULL /* func call entry */
|
||||
#define ML_EXIT 0x0000000000000002ULL /* func call exit */
|
||||
#define ML_TCP 0x0000000000000004ULL /* net cluster/tcp.c */
|
||||
#define ML_MSG 0x0000000000000008ULL /* net network messages */
|
||||
#define ML_SOCKET 0x0000000000000010ULL /* net socket lifetime */
|
||||
#define ML_HEARTBEAT 0x0000000000000020ULL /* hb all heartbeat tracking */
|
||||
#define ML_HB_BIO 0x0000000000000040ULL /* hb io tracing */
|
||||
#define ML_DLMFS 0x0000000000000080ULL /* dlm user dlmfs */
|
||||
#define ML_DLM 0x0000000000000100ULL /* dlm general debugging */
|
||||
#define ML_DLM_DOMAIN 0x0000000000000200ULL /* dlm domain debugging */
|
||||
#define ML_DLM_THREAD 0x0000000000000400ULL /* dlm domain thread */
|
||||
#define ML_DLM_MASTER 0x0000000000000800ULL /* dlm master functions */
|
||||
#define ML_DLM_RECOVERY 0x0000000000001000ULL /* dlm master functions */
|
||||
#define ML_AIO 0x0000000000002000ULL /* ocfs2 aio read and write */
|
||||
#define ML_JOURNAL 0x0000000000004000ULL /* ocfs2 journalling functions */
|
||||
#define ML_DISK_ALLOC 0x0000000000008000ULL /* ocfs2 disk allocation */
|
||||
#define ML_SUPER 0x0000000000010000ULL /* ocfs2 mount / umount */
|
||||
#define ML_FILE_IO 0x0000000000020000ULL /* ocfs2 file I/O */
|
||||
#define ML_EXTENT_MAP 0x0000000000040000ULL /* ocfs2 extent map caching */
|
||||
#define ML_DLM_GLUE 0x0000000000080000ULL /* ocfs2 dlm glue layer */
|
||||
#define ML_BH_IO 0x0000000000100000ULL /* ocfs2 buffer I/O */
|
||||
#define ML_UPTODATE 0x0000000000200000ULL /* ocfs2 caching sequence #'s */
|
||||
#define ML_NAMEI 0x0000000000400000ULL /* ocfs2 directory / namespace */
|
||||
#define ML_INODE 0x0000000000800000ULL /* ocfs2 inode manipulation */
|
||||
#define ML_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */
|
||||
#define ML_DCACHE 0x0000000002000000ULL /* ocfs2 dcache operations */
|
||||
#define ML_CONN 0x0000000004000000ULL /* net connection management */
|
||||
#define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */
|
||||
#define ML_EXPORT 0x0000000010000000ULL /* ocfs2 export operations */
|
||||
#define ML_XATTR 0x0000000020000000ULL /* ocfs2 extended attributes */
|
||||
#define ML_QUOTA 0x0000000040000000ULL /* ocfs2 quota operations */
|
||||
#define ML_REFCOUNT 0x0000000080000000ULL /* refcount tree operations */
|
||||
#define ML_BASTS 0x0000000100000000ULL /* dlmglue asts and basts */
|
||||
#define ML_RESERVATIONS 0x0000000200000000ULL /* ocfs2 alloc reservations */
|
||||
#define ML_CLUSTER 0x0000000400000000ULL /* cluster stack */
|
||||
#define ML_TCP 0x0000000000000001ULL /* net cluster/tcp.c */
|
||||
#define ML_MSG 0x0000000000000002ULL /* net network messages */
|
||||
#define ML_SOCKET 0x0000000000000004ULL /* net socket lifetime */
|
||||
#define ML_HEARTBEAT 0x0000000000000008ULL /* hb all heartbeat tracking */
|
||||
#define ML_HB_BIO 0x0000000000000010ULL /* hb io tracing */
|
||||
#define ML_DLMFS 0x0000000000000020ULL /* dlm user dlmfs */
|
||||
#define ML_DLM 0x0000000000000040ULL /* dlm general debugging */
|
||||
#define ML_DLM_DOMAIN 0x0000000000000080ULL /* dlm domain debugging */
|
||||
#define ML_DLM_THREAD 0x0000000000000100ULL /* dlm domain thread */
|
||||
#define ML_DLM_MASTER 0x0000000000000200ULL /* dlm master functions */
|
||||
#define ML_DLM_RECOVERY 0x0000000000000400ULL /* dlm master functions */
|
||||
#define ML_DLM_GLUE 0x0000000000000800ULL /* ocfs2 dlm glue layer */
|
||||
#define ML_VOTE 0x0000000000001000ULL /* ocfs2 node messaging */
|
||||
#define ML_CONN 0x0000000000002000ULL /* net connection management */
|
||||
#define ML_QUORUM 0x0000000000004000ULL /* net connection quorum */
|
||||
#define ML_BASTS 0x0000000000008000ULL /* dlmglue asts and basts */
|
||||
#define ML_CLUSTER 0x0000000000010000ULL /* cluster stack */
|
||||
|
||||
/* bits that are infrequently given and frequently matched in the high word */
|
||||
#define ML_ERROR 0x1000000000000000ULL /* sent to KERN_ERR */
|
||||
@@ -124,7 +106,6 @@
|
||||
#define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */
|
||||
|
||||
#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE)
|
||||
#define MLOG_INITIAL_NOT_MASK (ML_ENTRY|ML_EXIT)
|
||||
#ifndef MLOG_MASK_PREFIX
|
||||
#define MLOG_MASK_PREFIX 0
|
||||
#endif
|
||||
@@ -222,58 +203,6 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
|
||||
mlog(ML_ERROR, "status = %lld\n", (long long)_st); \
|
||||
} while (0)
|
||||
|
||||
#if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
|
||||
#define mlog_entry(fmt, args...) do { \
|
||||
mlog(ML_ENTRY, "ENTRY:" fmt , ##args); \
|
||||
} while (0)
|
||||
|
||||
#define mlog_entry_void() do { \
|
||||
mlog(ML_ENTRY, "ENTRY:\n"); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* We disable this for sparse.
|
||||
*/
|
||||
#if !defined(__CHECKER__)
|
||||
#define mlog_exit(st) do { \
|
||||
if (__builtin_types_compatible_p(typeof(st), unsigned long)) \
|
||||
mlog(ML_EXIT, "EXIT: %lu\n", (unsigned long) (st)); \
|
||||
else if (__builtin_types_compatible_p(typeof(st), signed long)) \
|
||||
mlog(ML_EXIT, "EXIT: %ld\n", (signed long) (st)); \
|
||||
else if (__builtin_types_compatible_p(typeof(st), unsigned int) \
|
||||
|| __builtin_types_compatible_p(typeof(st), unsigned short) \
|
||||
|| __builtin_types_compatible_p(typeof(st), unsigned char)) \
|
||||
mlog(ML_EXIT, "EXIT: %u\n", (unsigned int) (st)); \
|
||||
else if (__builtin_types_compatible_p(typeof(st), signed int) \
|
||||
|| __builtin_types_compatible_p(typeof(st), signed short) \
|
||||
|| __builtin_types_compatible_p(typeof(st), signed char)) \
|
||||
mlog(ML_EXIT, "EXIT: %d\n", (signed int) (st)); \
|
||||
else if (__builtin_types_compatible_p(typeof(st), long long)) \
|
||||
mlog(ML_EXIT, "EXIT: %lld\n", (long long) (st)); \
|
||||
else \
|
||||
mlog(ML_EXIT, "EXIT: %llu\n", (unsigned long long) (st)); \
|
||||
} while (0)
|
||||
#else
|
||||
#define mlog_exit(st) do { \
|
||||
mlog(ML_EXIT, "EXIT: %lld\n", (long long) (st)); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define mlog_exit_ptr(ptr) do { \
|
||||
mlog(ML_EXIT, "EXIT: %p\n", ptr); \
|
||||
} while (0)
|
||||
|
||||
#define mlog_exit_void() do { \
|
||||
mlog(ML_EXIT, "EXIT\n"); \
|
||||
} while (0)
|
||||
#else
|
||||
#define mlog_entry(...) do { } while (0)
|
||||
#define mlog_entry_void(...) do { } while (0)
|
||||
#define mlog_exit(...) do { } while (0)
|
||||
#define mlog_exit_ptr(...) do { } while (0)
|
||||
#define mlog_exit_void(...) do { } while (0)
|
||||
#endif /* defined(CONFIG_OCFS2_DEBUG_MASKLOG) */
|
||||
|
||||
#define mlog_bug_on_msg(cond, fmt, args...) do { \
|
||||
if (cond) { \
|
||||
mlog(ML_ERROR, "bug expression: " #cond "\n"); \
|
||||
|
||||
@@ -210,10 +210,6 @@ static inline void o2net_set_func_stop_time(struct o2net_sock_container *sc)
|
||||
sc->sc_tv_func_stop = ktime_get();
|
||||
}
|
||||
|
||||
static ktime_t o2net_get_func_run_time(struct o2net_sock_container *sc)
|
||||
{
|
||||
return ktime_sub(sc->sc_tv_func_stop, sc->sc_tv_func_start);
|
||||
}
|
||||
#else /* CONFIG_DEBUG_FS */
|
||||
# define o2net_init_nst(a, b, c, d, e)
|
||||
# define o2net_set_nst_sock_time(a)
|
||||
@@ -227,10 +223,14 @@ static ktime_t o2net_get_func_run_time(struct o2net_sock_container *sc)
|
||||
# define o2net_set_advance_stop_time(a)
|
||||
# define o2net_set_func_start_time(a)
|
||||
# define o2net_set_func_stop_time(a)
|
||||
# define o2net_get_func_run_time(a) (ktime_t)0
|
||||
#endif /* CONFIG_DEBUG_FS */
|
||||
|
||||
#ifdef CONFIG_OCFS2_FS_STATS
|
||||
static ktime_t o2net_get_func_run_time(struct o2net_sock_container *sc)
|
||||
{
|
||||
return ktime_sub(sc->sc_tv_func_stop, sc->sc_tv_func_start);
|
||||
}
|
||||
|
||||
static void o2net_update_send_stats(struct o2net_send_tracking *nst,
|
||||
struct o2net_sock_container *sc)
|
||||
{
|
||||
|
||||
+22
-23
@@ -28,7 +28,6 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/namei.h>
|
||||
|
||||
#define MLOG_MASK_PREFIX ML_DCACHE
|
||||
#include <cluster/masklog.h>
|
||||
|
||||
#include "ocfs2.h"
|
||||
@@ -39,6 +38,7 @@
|
||||
#include "file.h"
|
||||
#include "inode.h"
|
||||
#include "super.h"
|
||||
#include "ocfs2_trace.h"
|
||||
|
||||
void ocfs2_dentry_attach_gen(struct dentry *dentry)
|
||||
{
|
||||
@@ -62,8 +62,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
|
||||
inode = dentry->d_inode;
|
||||
osb = OCFS2_SB(dentry->d_sb);
|
||||
|
||||
mlog_entry("(0x%p, '%.*s')\n", dentry,
|
||||
dentry->d_name.len, dentry->d_name.name);
|
||||
trace_ocfs2_dentry_revalidate(dentry, dentry->d_name.len,
|
||||
dentry->d_name.name);
|
||||
|
||||
/* For a negative dentry -
|
||||
* check the generation number of the parent and compare with the
|
||||
@@ -73,9 +73,10 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
|
||||
unsigned long gen = (unsigned long) dentry->d_fsdata;
|
||||
unsigned long pgen =
|
||||
OCFS2_I(dentry->d_parent->d_inode)->ip_dir_lock_gen;
|
||||
mlog(0, "negative dentry: %.*s parent gen: %lu "
|
||||
"dentry gen: %lu\n",
|
||||
dentry->d_name.len, dentry->d_name.name, pgen, gen);
|
||||
|
||||
trace_ocfs2_dentry_revalidate_negative(dentry->d_name.len,
|
||||
dentry->d_name.name,
|
||||
pgen, gen);
|
||||
if (gen != pgen)
|
||||
goto bail;
|
||||
goto valid;
|
||||
@@ -90,8 +91,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
|
||||
/* did we or someone else delete this inode? */
|
||||
if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) {
|
||||
spin_unlock(&OCFS2_I(inode)->ip_lock);
|
||||
mlog(0, "inode (%llu) deleted, returning false\n",
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
trace_ocfs2_dentry_revalidate_delete(
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
goto bail;
|
||||
}
|
||||
spin_unlock(&OCFS2_I(inode)->ip_lock);
|
||||
@@ -101,10 +102,9 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
|
||||
* inode nlink hits zero, it never goes back.
|
||||
*/
|
||||
if (inode->i_nlink == 0) {
|
||||
mlog(0, "Inode %llu orphaned, returning false "
|
||||
"dir = %d\n",
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
S_ISDIR(inode->i_mode));
|
||||
trace_ocfs2_dentry_revalidate_orphaned(
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno,
|
||||
S_ISDIR(inode->i_mode));
|
||||
goto bail;
|
||||
}
|
||||
|
||||
@@ -113,9 +113,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
|
||||
* redo it.
|
||||
*/
|
||||
if (!dentry->d_fsdata) {
|
||||
mlog(0, "Inode %llu doesn't have dentry lock, "
|
||||
"returning false\n",
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
trace_ocfs2_dentry_revalidate_nofsdata(
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
@@ -123,8 +122,7 @@ valid:
|
||||
ret = 1;
|
||||
|
||||
bail:
|
||||
mlog_exit(ret);
|
||||
|
||||
trace_ocfs2_dentry_revalidate_ret(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -181,8 +179,8 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode,
|
||||
|
||||
spin_lock(&dentry->d_lock);
|
||||
if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
|
||||
mlog(0, "dentry found: %.*s\n",
|
||||
dentry->d_name.len, dentry->d_name.name);
|
||||
trace_ocfs2_find_local_alias(dentry->d_name.len,
|
||||
dentry->d_name.name);
|
||||
|
||||
dget_dlock(dentry);
|
||||
spin_unlock(&dentry->d_lock);
|
||||
@@ -240,9 +238,8 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry,
|
||||
struct dentry *alias;
|
||||
struct ocfs2_dentry_lock *dl = dentry->d_fsdata;
|
||||
|
||||
mlog(0, "Attach \"%.*s\", parent %llu, fsdata: %p\n",
|
||||
dentry->d_name.len, dentry->d_name.name,
|
||||
(unsigned long long)parent_blkno, dl);
|
||||
trace_ocfs2_dentry_attach_lock(dentry->d_name.len, dentry->d_name.name,
|
||||
(unsigned long long)parent_blkno, dl);
|
||||
|
||||
/*
|
||||
* Negative dentry. We ignore these for now.
|
||||
@@ -292,7 +289,9 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry,
|
||||
(unsigned long long)parent_blkno,
|
||||
(unsigned long long)dl->dl_parent_blkno);
|
||||
|
||||
mlog(0, "Found: %s\n", dl->dl_lockres.l_name);
|
||||
trace_ocfs2_dentry_attach_lock_found(dl->dl_lockres.l_name,
|
||||
(unsigned long long)parent_blkno,
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
|
||||
goto out_attach;
|
||||
}
|
||||
|
||||
+52
-69
@@ -43,7 +43,6 @@
|
||||
#include <linux/quotaops.h>
|
||||
#include <linux/sort.h>
|
||||
|
||||
#define MLOG_MASK_PREFIX ML_NAMEI
|
||||
#include <cluster/masklog.h>
|
||||
|
||||
#include "ocfs2.h"
|
||||
@@ -61,6 +60,7 @@
|
||||
#include "super.h"
|
||||
#include "sysfile.h"
|
||||
#include "uptodate.h"
|
||||
#include "ocfs2_trace.h"
|
||||
|
||||
#include "buffer_head_io.h"
|
||||
|
||||
@@ -322,21 +322,23 @@ static int ocfs2_check_dir_entry(struct inode * dir,
|
||||
const char *error_msg = NULL;
|
||||
const int rlen = le16_to_cpu(de->rec_len);
|
||||
|
||||
if (rlen < OCFS2_DIR_REC_LEN(1))
|
||||
if (unlikely(rlen < OCFS2_DIR_REC_LEN(1)))
|
||||
error_msg = "rec_len is smaller than minimal";
|
||||
else if (rlen % 4 != 0)
|
||||
else if (unlikely(rlen % 4 != 0))
|
||||
error_msg = "rec_len % 4 != 0";
|
||||
else if (rlen < OCFS2_DIR_REC_LEN(de->name_len))
|
||||
else if (unlikely(rlen < OCFS2_DIR_REC_LEN(de->name_len)))
|
||||
error_msg = "rec_len is too small for name_len";
|
||||
else if (((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize)
|
||||
else if (unlikely(
|
||||
((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize))
|
||||
error_msg = "directory entry across blocks";
|
||||
|
||||
if (error_msg != NULL)
|
||||
if (unlikely(error_msg != NULL))
|
||||
mlog(ML_ERROR, "bad entry in directory #%llu: %s - "
|
||||
"offset=%lu, inode=%llu, rec_len=%d, name_len=%d\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno, error_msg,
|
||||
offset, (unsigned long long)le64_to_cpu(de->inode), rlen,
|
||||
de->name_len);
|
||||
|
||||
return error_msg == NULL ? 1 : 0;
|
||||
}
|
||||
|
||||
@@ -367,8 +369,6 @@ static inline int ocfs2_search_dirblock(struct buffer_head *bh,
|
||||
int de_len;
|
||||
int ret = 0;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
de_buf = first_de;
|
||||
dlimit = de_buf + bytes;
|
||||
|
||||
@@ -402,7 +402,7 @@ static inline int ocfs2_search_dirblock(struct buffer_head *bh,
|
||||
}
|
||||
|
||||
bail:
|
||||
mlog_exit(ret);
|
||||
trace_ocfs2_search_dirblock(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -447,8 +447,7 @@ static int ocfs2_validate_dir_block(struct super_block *sb,
|
||||
* We don't validate dirents here, that's handled
|
||||
* in-place when the code walks them.
|
||||
*/
|
||||
mlog(0, "Validating dirblock %llu\n",
|
||||
(unsigned long long)bh->b_blocknr);
|
||||
trace_ocfs2_validate_dir_block((unsigned long long)bh->b_blocknr);
|
||||
|
||||
BUG_ON(!buffer_uptodate(bh));
|
||||
|
||||
@@ -706,8 +705,6 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,
|
||||
int num = 0;
|
||||
int nblocks, i, err;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
sb = dir->i_sb;
|
||||
|
||||
nblocks = i_size_read(dir) >> sb->s_blocksize_bits;
|
||||
@@ -788,7 +785,7 @@ cleanup_and_exit:
|
||||
for (; ra_ptr < ra_max; ra_ptr++)
|
||||
brelse(bh_use[ra_ptr]);
|
||||
|
||||
mlog_exit_ptr(ret);
|
||||
trace_ocfs2_find_entry_el(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -950,11 +947,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen,
|
||||
goto out;
|
||||
}
|
||||
|
||||
mlog(0, "Dir %llu: name: \"%.*s\", lookup of hash: %u.0x%x "
|
||||
"returns: %llu\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
namelen, name, hinfo->major_hash, hinfo->minor_hash,
|
||||
(unsigned long long)phys);
|
||||
trace_ocfs2_dx_dir_search((unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
namelen, name, hinfo->major_hash,
|
||||
hinfo->minor_hash, (unsigned long long)phys);
|
||||
|
||||
ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh);
|
||||
if (ret) {
|
||||
@@ -964,9 +959,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen,
|
||||
|
||||
dx_leaf = (struct ocfs2_dx_leaf *) dx_leaf_bh->b_data;
|
||||
|
||||
mlog(0, "leaf info: num_used: %d, count: %d\n",
|
||||
le16_to_cpu(dx_leaf->dl_list.de_num_used),
|
||||
le16_to_cpu(dx_leaf->dl_list.de_count));
|
||||
trace_ocfs2_dx_dir_search_leaf_info(
|
||||
le16_to_cpu(dx_leaf->dl_list.de_num_used),
|
||||
le16_to_cpu(dx_leaf->dl_list.de_count));
|
||||
|
||||
entry_list = &dx_leaf->dl_list;
|
||||
|
||||
@@ -1166,8 +1161,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
|
||||
int i, status = -ENOENT;
|
||||
ocfs2_journal_access_func access = ocfs2_journal_access_db;
|
||||
|
||||
mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);
|
||||
|
||||
if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
|
||||
access = ocfs2_journal_access_di;
|
||||
|
||||
@@ -1202,7 +1195,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
|
||||
de = (struct ocfs2_dir_entry *)((char *)de + le16_to_cpu(de->rec_len));
|
||||
}
|
||||
bail:
|
||||
mlog_exit(status);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1348,8 +1340,8 @@ static int ocfs2_delete_entry_dx(handle_t *handle, struct inode *dir,
|
||||
}
|
||||
}
|
||||
|
||||
mlog(0, "Dir %llu: delete entry at index: %d\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno, index);
|
||||
trace_ocfs2_delete_entry_dx((unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
index);
|
||||
|
||||
ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry,
|
||||
leaf_bh, leaf_bh->b_data, leaf_bh->b_size);
|
||||
@@ -1632,8 +1624,6 @@ int __ocfs2_add_entry(handle_t *handle,
|
||||
struct buffer_head *insert_bh = lookup->dl_leaf_bh;
|
||||
char *data_start = insert_bh->b_data;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
if (!namelen)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -1765,8 +1755,9 @@ int __ocfs2_add_entry(handle_t *handle,
|
||||
* from ever getting here. */
|
||||
retval = -ENOSPC;
|
||||
bail:
|
||||
if (retval)
|
||||
mlog_errno(retval);
|
||||
|
||||
mlog_exit(retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -2028,8 +2019,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
||||
struct inode *inode = filp->f_path.dentry->d_inode;
|
||||
int lock_level = 0;
|
||||
|
||||
mlog_entry("dirino=%llu\n",
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
|
||||
error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level);
|
||||
if (lock_level && error >= 0) {
|
||||
@@ -2051,9 +2041,10 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
||||
dirent, filldir, NULL);
|
||||
|
||||
ocfs2_inode_unlock(inode, lock_level);
|
||||
if (error)
|
||||
mlog_errno(error);
|
||||
|
||||
bail_nolock:
|
||||
mlog_exit(error);
|
||||
|
||||
return error;
|
||||
}
|
||||
@@ -2069,8 +2060,8 @@ int ocfs2_find_files_on_disk(const char *name,
|
||||
{
|
||||
int status = -ENOENT;
|
||||
|
||||
mlog(0, "name=%.*s, blkno=%p, inode=%llu\n", namelen, name, blkno,
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
trace_ocfs2_find_files_on_disk(namelen, name, blkno,
|
||||
(unsigned long long)OCFS2_I(inode)->ip_blkno);
|
||||
|
||||
status = ocfs2_find_entry(name, namelen, inode, lookup);
|
||||
if (status)
|
||||
@@ -2114,8 +2105,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
|
||||
int ret;
|
||||
struct ocfs2_dir_lookup_result lookup = { NULL, };
|
||||
|
||||
mlog_entry("dir %llu, name '%.*s'\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name);
|
||||
trace_ocfs2_check_dir_for_entry(
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name);
|
||||
|
||||
ret = -EEXIST;
|
||||
if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0)
|
||||
@@ -2125,7 +2116,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
|
||||
bail:
|
||||
ocfs2_free_dir_lookup_result(&lookup);
|
||||
|
||||
mlog_exit(ret);
|
||||
if (ret)
|
||||
mlog_errno(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2324,8 +2316,6 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb,
|
||||
struct buffer_head *new_bh = NULL;
|
||||
struct ocfs2_dir_entry *de;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
if (ocfs2_new_dir_wants_trailer(inode))
|
||||
size = ocfs2_dir_trailer_blk_off(parent->i_sb);
|
||||
|
||||
@@ -2380,7 +2370,6 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb,
|
||||
bail:
|
||||
brelse(new_bh);
|
||||
|
||||
mlog_exit(status);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -2409,9 +2398,9 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb,
|
||||
goto out;
|
||||
}
|
||||
|
||||
mlog(0, "Dir %llu, attach new index block: %llu\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
(unsigned long long)dr_blkno);
|
||||
trace_ocfs2_dx_dir_attach_index(
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
(unsigned long long)dr_blkno);
|
||||
|
||||
dx_root_bh = sb_getblk(osb->sb, dr_blkno);
|
||||
if (dx_root_bh == NULL) {
|
||||
@@ -2511,11 +2500,10 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb,
|
||||
dx_leaf->dl_list.de_count =
|
||||
cpu_to_le16(ocfs2_dx_entries_per_leaf(osb->sb));
|
||||
|
||||
mlog(0,
|
||||
"Dir %llu, format dx_leaf: %llu, entry count: %u\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
(unsigned long long)bh->b_blocknr,
|
||||
le16_to_cpu(dx_leaf->dl_list.de_count));
|
||||
trace_ocfs2_dx_dir_format_cluster(
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
(unsigned long long)bh->b_blocknr,
|
||||
le16_to_cpu(dx_leaf->dl_list.de_count));
|
||||
|
||||
ocfs2_journal_dirty(handle, bh);
|
||||
}
|
||||
@@ -2759,12 +2747,11 @@ static void ocfs2_dx_dir_index_root_block(struct inode *dir,
|
||||
|
||||
ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo);
|
||||
|
||||
mlog(0,
|
||||
"dir: %llu, major: 0x%x minor: 0x%x, index: %u, name: %.*s\n",
|
||||
(unsigned long long)dir->i_ino, hinfo.major_hash,
|
||||
hinfo.minor_hash,
|
||||
le16_to_cpu(dx_root->dr_entries.de_num_used),
|
||||
de->name_len, de->name);
|
||||
trace_ocfs2_dx_dir_index_root_block(
|
||||
(unsigned long long)dir->i_ino,
|
||||
hinfo.major_hash, hinfo.minor_hash,
|
||||
de->name_len, de->name,
|
||||
le16_to_cpu(dx_root->dr_entries.de_num_used));
|
||||
|
||||
ocfs2_dx_entry_list_insert(&dx_root->dr_entries, &hinfo,
|
||||
dirent_blk);
|
||||
@@ -3235,7 +3222,6 @@ static int ocfs2_do_extend_dir(struct super_block *sb,
|
||||
bail:
|
||||
if (did_quota && status < 0)
|
||||
dquot_free_space_nodirty(dir, ocfs2_clusters_to_bytes(sb, 1));
|
||||
mlog_exit(status);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -3270,8 +3256,6 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
|
||||
struct ocfs2_extent_tree et;
|
||||
struct buffer_head *dx_root_bh = lookup->dl_dx_root_bh;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
|
||||
/*
|
||||
* This would be a code error as an inline directory should
|
||||
@@ -3320,8 +3304,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
|
||||
down_write(&OCFS2_I(dir)->ip_alloc_sem);
|
||||
drop_alloc_sem = 1;
|
||||
dir_i_size = i_size_read(dir);
|
||||
mlog(0, "extending dir %llu (i_size = %lld)\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size);
|
||||
trace_ocfs2_extend_dir((unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
dir_i_size);
|
||||
|
||||
/* dir->i_size is always block aligned. */
|
||||
spin_lock(&OCFS2_I(dir)->ip_lock);
|
||||
@@ -3436,7 +3420,6 @@ bail:
|
||||
|
||||
brelse(new_bh);
|
||||
|
||||
mlog_exit(status);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -3583,8 +3566,9 @@ next:
|
||||
status = 0;
|
||||
bail:
|
||||
brelse(bh);
|
||||
if (status)
|
||||
mlog_errno(status);
|
||||
|
||||
mlog_exit(status);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -3815,9 +3799,9 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir,
|
||||
struct ocfs2_dx_root_block *dx_root;
|
||||
struct ocfs2_dx_leaf *tmp_dx_leaf = NULL;
|
||||
|
||||
mlog(0, "DX Dir: %llu, rebalance leaf leaf_blkno: %llu insert: %u\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
(unsigned long long)leaf_blkno, insert_hash);
|
||||
trace_ocfs2_dx_dir_rebalance((unsigned long long)OCFS2_I(dir)->ip_blkno,
|
||||
(unsigned long long)leaf_blkno,
|
||||
insert_hash);
|
||||
|
||||
ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh);
|
||||
|
||||
@@ -3897,8 +3881,7 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir,
|
||||
goto out_commit;
|
||||
}
|
||||
|
||||
mlog(0, "Split leaf (%u) at %u, insert major hash is %u\n",
|
||||
leaf_cpos, split_hash, insert_hash);
|
||||
trace_ocfs2_dx_dir_rebalance_split(leaf_cpos, split_hash, insert_hash);
|
||||
|
||||
/*
|
||||
* We have to carefully order operations here. There are items
|
||||
@@ -4355,8 +4338,8 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb,
|
||||
unsigned int blocks_wanted = 1;
|
||||
struct buffer_head *bh = NULL;
|
||||
|
||||
mlog(0, "getting ready to insert namelen %d into dir %llu\n",
|
||||
namelen, (unsigned long long)OCFS2_I(dir)->ip_blkno);
|
||||
trace_ocfs2_prepare_dir_for_insert(
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen);
|
||||
|
||||
if (!namelen) {
|
||||
ret = -EINVAL;
|
||||
|
||||
@@ -128,8 +128,8 @@ static enum dlm_status __dlmconvert_master(struct dlm_ctxt *dlm,
|
||||
|
||||
assert_spin_locked(&res->spinlock);
|
||||
|
||||
mlog_entry("type=%d, convert_type=%d, new convert_type=%d\n",
|
||||
lock->ml.type, lock->ml.convert_type, type);
|
||||
mlog(0, "type=%d, convert_type=%d, new convert_type=%d\n",
|
||||
lock->ml.type, lock->ml.convert_type, type);
|
||||
|
||||
spin_lock(&lock->spinlock);
|
||||
|
||||
@@ -353,7 +353,7 @@ static enum dlm_status dlm_send_remote_convert_request(struct dlm_ctxt *dlm,
|
||||
struct kvec vec[2];
|
||||
size_t veclen = 1;
|
||||
|
||||
mlog_entry("%.*s\n", res->lockname.len, res->lockname.name);
|
||||
mlog(0, "%.*s\n", res->lockname.len, res->lockname.name);
|
||||
|
||||
memset(&convert, 0, sizeof(struct dlm_convert_lock));
|
||||
convert.node_idx = dlm->node_num;
|
||||
|
||||
+20
-16
@@ -188,7 +188,7 @@ struct dlm_lock_resource * __dlm_lookup_lockres_full(struct dlm_ctxt *dlm,
|
||||
struct hlist_head *bucket;
|
||||
struct hlist_node *list;
|
||||
|
||||
mlog_entry("%.*s\n", len, name);
|
||||
mlog(0, "%.*s\n", len, name);
|
||||
|
||||
assert_spin_locked(&dlm->spinlock);
|
||||
|
||||
@@ -222,7 +222,7 @@ struct dlm_lock_resource * __dlm_lookup_lockres(struct dlm_ctxt *dlm,
|
||||
{
|
||||
struct dlm_lock_resource *res = NULL;
|
||||
|
||||
mlog_entry("%.*s\n", len, name);
|
||||
mlog(0, "%.*s\n", len, name);
|
||||
|
||||
assert_spin_locked(&dlm->spinlock);
|
||||
|
||||
@@ -531,7 +531,7 @@ static int dlm_exit_domain_handler(struct o2net_msg *msg, u32 len, void *data,
|
||||
unsigned int node;
|
||||
struct dlm_exit_domain *exit_msg = (struct dlm_exit_domain *) msg->buf;
|
||||
|
||||
mlog_entry("%p %u %p", msg, len, data);
|
||||
mlog(0, "%p %u %p", msg, len, data);
|
||||
|
||||
if (!dlm_grab(dlm))
|
||||
return 0;
|
||||
@@ -926,9 +926,10 @@ static int dlm_assert_joined_handler(struct o2net_msg *msg, u32 len, void *data,
|
||||
}
|
||||
|
||||
static int dlm_match_regions(struct dlm_ctxt *dlm,
|
||||
struct dlm_query_region *qr)
|
||||
struct dlm_query_region *qr,
|
||||
char *local, int locallen)
|
||||
{
|
||||
char *local = NULL, *remote = qr->qr_regions;
|
||||
char *remote = qr->qr_regions;
|
||||
char *l, *r;
|
||||
int localnr, i, j, foundit;
|
||||
int status = 0;
|
||||
@@ -957,13 +958,8 @@ static int dlm_match_regions(struct dlm_ctxt *dlm,
|
||||
r += O2HB_MAX_REGION_NAME_LEN;
|
||||
}
|
||||
|
||||
local = kmalloc(sizeof(qr->qr_regions), GFP_ATOMIC);
|
||||
if (!local) {
|
||||
status = -ENOMEM;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
localnr = o2hb_get_all_regions(local, O2NM_MAX_REGIONS);
|
||||
localnr = min(O2NM_MAX_REGIONS, locallen/O2HB_MAX_REGION_NAME_LEN);
|
||||
localnr = o2hb_get_all_regions(local, (u8)localnr);
|
||||
|
||||
/* compare local regions with remote */
|
||||
l = local;
|
||||
@@ -1012,8 +1008,6 @@ static int dlm_match_regions(struct dlm_ctxt *dlm,
|
||||
}
|
||||
|
||||
bail:
|
||||
kfree(local);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1075,6 +1069,7 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
|
||||
{
|
||||
struct dlm_query_region *qr;
|
||||
struct dlm_ctxt *dlm = NULL;
|
||||
char *local = NULL;
|
||||
int status = 0;
|
||||
int locked = 0;
|
||||
|
||||
@@ -1083,6 +1078,13 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
|
||||
mlog(0, "Node %u queries hb regions on domain %s\n", qr->qr_node,
|
||||
qr->qr_domain);
|
||||
|
||||
/* buffer used in dlm_mast_regions() */
|
||||
local = kmalloc(sizeof(qr->qr_regions), GFP_KERNEL);
|
||||
if (!local) {
|
||||
status = -ENOMEM;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
status = -EINVAL;
|
||||
|
||||
spin_lock(&dlm_domain_lock);
|
||||
@@ -1112,13 +1114,15 @@ static int dlm_query_region_handler(struct o2net_msg *msg, u32 len,
|
||||
goto bail;
|
||||
}
|
||||
|
||||
status = dlm_match_regions(dlm, qr);
|
||||
status = dlm_match_regions(dlm, qr, local, sizeof(qr->qr_regions));
|
||||
|
||||
bail:
|
||||
if (locked)
|
||||
spin_unlock(&dlm->spinlock);
|
||||
spin_unlock(&dlm_domain_lock);
|
||||
|
||||
kfree(local);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1553,7 +1557,7 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm)
|
||||
struct domain_join_ctxt *ctxt;
|
||||
enum dlm_query_join_response_code response = JOIN_DISALLOW;
|
||||
|
||||
mlog_entry("%p", dlm);
|
||||
mlog(0, "%p", dlm);
|
||||
|
||||
ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
|
||||
if (!ctxt) {
|
||||
|
||||
@@ -128,7 +128,7 @@ static enum dlm_status dlmlock_master(struct dlm_ctxt *dlm,
|
||||
int call_ast = 0, kick_thread = 0;
|
||||
enum dlm_status status = DLM_NORMAL;
|
||||
|
||||
mlog_entry("type=%d\n", lock->ml.type);
|
||||
mlog(0, "type=%d\n", lock->ml.type);
|
||||
|
||||
spin_lock(&res->spinlock);
|
||||
/* if called from dlm_create_lock_handler, need to
|
||||
@@ -227,8 +227,8 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm,
|
||||
enum dlm_status status = DLM_DENIED;
|
||||
int lockres_changed = 1;
|
||||
|
||||
mlog_entry("type=%d\n", lock->ml.type);
|
||||
mlog(0, "lockres %.*s, flags = 0x%x\n", res->lockname.len,
|
||||
mlog(0, "type=%d, lockres %.*s, flags = 0x%x\n",
|
||||
lock->ml.type, res->lockname.len,
|
||||
res->lockname.name, flags);
|
||||
|
||||
spin_lock(&res->spinlock);
|
||||
@@ -308,8 +308,6 @@ static enum dlm_status dlm_send_remote_lock_request(struct dlm_ctxt *dlm,
|
||||
int tmpret, status = 0;
|
||||
enum dlm_status ret;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
memset(&create, 0, sizeof(create));
|
||||
create.node_idx = dlm->node_num;
|
||||
create.requested_type = lock->ml.type;
|
||||
@@ -477,8 +475,6 @@ int dlm_create_lock_handler(struct o2net_msg *msg, u32 len, void *data,
|
||||
|
||||
BUG_ON(!dlm);
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
if (!dlm_grab(dlm))
|
||||
return DLM_REJECTED;
|
||||
|
||||
|
||||
@@ -426,8 +426,6 @@ static void dlm_mle_release(struct kref *kref)
|
||||
struct dlm_master_list_entry *mle;
|
||||
struct dlm_ctxt *dlm;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
mle = container_of(kref, struct dlm_master_list_entry, mle_refs);
|
||||
dlm = mle->dlm;
|
||||
|
||||
@@ -3120,8 +3118,6 @@ static int dlm_add_migration_mle(struct dlm_ctxt *dlm,
|
||||
|
||||
*oldmle = NULL;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
assert_spin_locked(&dlm->spinlock);
|
||||
assert_spin_locked(&dlm->master_lock);
|
||||
|
||||
@@ -3261,7 +3257,7 @@ void dlm_clean_master_list(struct dlm_ctxt *dlm, u8 dead_node)
|
||||
struct hlist_node *list;
|
||||
unsigned int i;
|
||||
|
||||
mlog_entry("dlm=%s, dead node=%u\n", dlm->name, dead_node);
|
||||
mlog(0, "dlm=%s, dead node=%u\n", dlm->name, dead_node);
|
||||
top:
|
||||
assert_spin_locked(&dlm->spinlock);
|
||||
|
||||
|
||||
@@ -727,7 +727,6 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node)
|
||||
if (destroy)
|
||||
dlm_destroy_recovery_area(dlm, dead_node);
|
||||
|
||||
mlog_exit(status);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1496,9 +1495,9 @@ leave:
|
||||
kfree(buf);
|
||||
if (item)
|
||||
kfree(item);
|
||||
mlog_errno(ret);
|
||||
}
|
||||
|
||||
mlog_exit(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1567,7 +1566,6 @@ leave:
|
||||
dlm_lockres_put(res);
|
||||
}
|
||||
kfree(data);
|
||||
mlog_exit(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -1986,7 +1984,6 @@ leave:
|
||||
dlm_lock_put(newlock);
|
||||
}
|
||||
|
||||
mlog_exit(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2083,8 +2080,6 @@ static void dlm_finish_local_lockres_recovery(struct dlm_ctxt *dlm,
|
||||
struct hlist_head *bucket;
|
||||
struct dlm_lock_resource *res, *next;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
assert_spin_locked(&dlm->spinlock);
|
||||
|
||||
list_for_each_entry_safe(res, next, &dlm->reco.resources, recovering) {
|
||||
@@ -2607,8 +2602,6 @@ static int dlm_send_begin_reco_message(struct dlm_ctxt *dlm, u8 dead_node)
|
||||
int nodenum;
|
||||
int status;
|
||||
|
||||
mlog_entry("%u\n", dead_node);
|
||||
|
||||
mlog(0, "%s: dead node is %u\n", dlm->name, dead_node);
|
||||
|
||||
spin_lock(&dlm->spinlock);
|
||||
|
||||
@@ -317,7 +317,7 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm,
|
||||
struct kvec vec[2];
|
||||
size_t veclen = 1;
|
||||
|
||||
mlog_entry("%.*s\n", res->lockname.len, res->lockname.name);
|
||||
mlog(0, "%.*s\n", res->lockname.len, res->lockname.name);
|
||||
|
||||
if (owner == dlm->node_num) {
|
||||
/* ended up trying to contact ourself. this means
|
||||
@@ -588,8 +588,6 @@ enum dlm_status dlmunlock(struct dlm_ctxt *dlm, struct dlm_lockstatus *lksb,
|
||||
struct dlm_lock *lock = NULL;
|
||||
int call_ast, is_master;
|
||||
|
||||
mlog_entry_void();
|
||||
|
||||
if (!lksb) {
|
||||
dlm_error(DLM_BADARGS);
|
||||
return DLM_BADARGS;
|
||||
|
||||
+55
-189
File diff suppressed because it is too large
Load Diff
+20
-27
@@ -26,7 +26,6 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define MLOG_MASK_PREFIX ML_EXPORT
|
||||
#include <cluster/masklog.h>
|
||||
|
||||
#include "ocfs2.h"
|
||||
@@ -40,6 +39,7 @@
|
||||
|
||||
#include "buffer_head_io.h"
|
||||
#include "suballoc.h"
|
||||
#include "ocfs2_trace.h"
|
||||
|
||||
struct ocfs2_inode_handle
|
||||
{
|
||||
@@ -56,10 +56,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
|
||||
int status, set;
|
||||
struct dentry *result;
|
||||
|
||||
mlog_entry("(0x%p, 0x%p)\n", sb, handle);
|
||||
trace_ocfs2_get_dentry_begin(sb, handle, (unsigned long long)blkno);
|
||||
|
||||
if (blkno == 0) {
|
||||
mlog(0, "nfs wants inode with blkno: 0\n");
|
||||
result = ERR_PTR(-ESTALE);
|
||||
goto bail;
|
||||
}
|
||||
@@ -83,6 +82,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
|
||||
}
|
||||
|
||||
status = ocfs2_test_inode_bit(osb, blkno, &set);
|
||||
trace_ocfs2_get_dentry_test_bit(status, set);
|
||||
if (status < 0) {
|
||||
if (status == -EINVAL) {
|
||||
/*
|
||||
@@ -90,18 +90,14 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
|
||||
* as an inode, we return -ESTALE to be
|
||||
* nice
|
||||
*/
|
||||
mlog(0, "test inode bit failed %d\n", status);
|
||||
status = -ESTALE;
|
||||
} else {
|
||||
} else
|
||||
mlog(ML_ERROR, "test inode bit failed %d\n", status);
|
||||
}
|
||||
goto unlock_nfs_sync;
|
||||
}
|
||||
|
||||
/* If the inode allocator bit is clear, this inode must be stale */
|
||||
if (!set) {
|
||||
mlog(0, "inode %llu suballoc bit is clear\n",
|
||||
(unsigned long long)blkno);
|
||||
status = -ESTALE;
|
||||
goto unlock_nfs_sync;
|
||||
}
|
||||
@@ -114,8 +110,8 @@ unlock_nfs_sync:
|
||||
check_err:
|
||||
if (status < 0) {
|
||||
if (status == -ESTALE) {
|
||||
mlog(0, "stale inode ino: %llu generation: %u\n",
|
||||
(unsigned long long)blkno, handle->ih_generation);
|
||||
trace_ocfs2_get_dentry_stale((unsigned long long)blkno,
|
||||
handle->ih_generation);
|
||||
}
|
||||
result = ERR_PTR(status);
|
||||
goto bail;
|
||||
@@ -130,8 +126,9 @@ check_err:
|
||||
check_gen:
|
||||
if (handle->ih_generation != inode->i_generation) {
|
||||
iput(inode);
|
||||
mlog(0, "stale inode ino: %llu generation: %u\n",
|
||||
(unsigned long long)blkno, handle->ih_generation);
|
||||
trace_ocfs2_get_dentry_generation((unsigned long long)blkno,
|
||||
handle->ih_generation,
|
||||
inode->i_generation);
|
||||
result = ERR_PTR(-ESTALE);
|
||||
goto bail;
|
||||
}
|
||||
@@ -141,7 +138,7 @@ check_gen:
|
||||
mlog_errno(PTR_ERR(result));
|
||||
|
||||
bail:
|
||||
mlog_exit_ptr(result);
|
||||
trace_ocfs2_get_dentry_end(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -152,11 +149,8 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
|
||||
struct dentry *parent;
|
||||
struct inode *dir = child->d_inode;
|
||||
|
||||
mlog_entry("(0x%p, '%.*s')\n", child,
|
||||
child->d_name.len, child->d_name.name);
|
||||
|
||||
mlog(0, "find parent of directory %llu\n",
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno);
|
||||
trace_ocfs2_get_parent(child, child->d_name.len, child->d_name.name,
|
||||
(unsigned long long)OCFS2_I(dir)->ip_blkno);
|
||||
|
||||
status = ocfs2_inode_lock(dir, NULL, 0);
|
||||
if (status < 0) {
|
||||
@@ -178,7 +172,7 @@ bail_unlock:
|
||||
ocfs2_inode_unlock(dir, 0);
|
||||
|
||||
bail:
|
||||
mlog_exit_ptr(parent);
|
||||
trace_ocfs2_get_parent_end(parent);
|
||||
|
||||
return parent;
|
||||
}
|
||||
@@ -193,9 +187,9 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
|
||||
u32 generation;
|
||||
__le32 *fh = (__force __le32 *) fh_in;
|
||||
|
||||
mlog_entry("(0x%p, '%.*s', 0x%p, %d, %d)\n", dentry,
|
||||
dentry->d_name.len, dentry->d_name.name,
|
||||
fh, len, connectable);
|
||||
trace_ocfs2_encode_fh_begin(dentry, dentry->d_name.len,
|
||||
dentry->d_name.name,
|
||||
fh, len, connectable);
|
||||
|
||||
if (connectable && (len < 6)) {
|
||||
*max_len = 6;
|
||||
@@ -210,8 +204,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
|
||||
blkno = OCFS2_I(inode)->ip_blkno;
|
||||
generation = inode->i_generation;
|
||||
|
||||
mlog(0, "Encoding fh: blkno: %llu, generation: %u\n",
|
||||
(unsigned long long)blkno, generation);
|
||||
trace_ocfs2_encode_fh_self((unsigned long long)blkno, generation);
|
||||
|
||||
len = 3;
|
||||
fh[0] = cpu_to_le32((u32)(blkno >> 32));
|
||||
@@ -236,14 +229,14 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
|
||||
len = 6;
|
||||
type = 2;
|
||||
|
||||
mlog(0, "Encoding parent: blkno: %llu, generation: %u\n",
|
||||
(unsigned long long)blkno, generation);
|
||||
trace_ocfs2_encode_fh_parent((unsigned long long)blkno,
|
||||
generation);
|
||||
}
|
||||
|
||||
*max_len = len;
|
||||
|
||||
bail:
|
||||
mlog_exit(type);
|
||||
trace_ocfs2_encode_fh_type(type);
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/fiemap.h>
|
||||
|
||||
#define MLOG_MASK_PREFIX ML_EXTENT_MAP
|
||||
#include <cluster/masklog.h>
|
||||
|
||||
#include "ocfs2.h"
|
||||
@@ -39,6 +38,7 @@
|
||||
#include "inode.h"
|
||||
#include "super.h"
|
||||
#include "symlink.h"
|
||||
#include "ocfs2_trace.h"
|
||||
|
||||
#include "buffer_head_io.h"
|
||||
|
||||
@@ -841,10 +841,9 @@ int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr,
|
||||
u64 p_block, p_count;
|
||||
int i, count, done = 0;
|
||||
|
||||
mlog_entry("(inode = %p, v_block = %llu, nr = %d, bhs = %p, "
|
||||
"flags = %x, validate = %p)\n",
|
||||
inode, (unsigned long long)v_block, nr, bhs, flags,
|
||||
validate);
|
||||
trace_ocfs2_read_virt_blocks(
|
||||
inode, (unsigned long long)v_block, nr, bhs, flags,
|
||||
validate);
|
||||
|
||||
if (((v_block + nr - 1) << inode->i_sb->s_blocksize_bits) >=
|
||||
i_size_read(inode)) {
|
||||
@@ -897,7 +896,6 @@ int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr,
|
||||
}
|
||||
|
||||
out:
|
||||
mlog_exit(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
+95
-125
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user