nilfs2: implement base subsystem debugging output
Subsystems (2)
PATCH 3/24 nilfs2: implement base subsystem debugging output
From: Vyacheslav Dubeyko <[email protected]>
Subject: [PATCH 03/24] nilfs2: implement base subsystem debugging output
This patch adds debugging output by means of nilfs2_debug() method into modules that are grouped by base subsystem debugging output option (CONFIG_NILFS2_DEBUG_BASE_OPERATIONS).
Signed-off-by Vyacheslav Dubeyko <[email protected]>
CC Ryusuke Konishi <[email protected]>
--- fs/nilfs2/dir.c | 24 +++++++++ fs/nilfs2/file.c | 6 +++ fs/nilfs2/inode.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++- fs/nilfs2/ioctl.c | 93 +++++++++++++++++++++++++++++++++++ fs/nilfs2/namei.c | 51 ++++++++++++++++++- fs/nilfs2/nilfs.h | 1 + fs/nilfs2/super.c | 87 +++++++++++++++++++++++++++++++++ fs/nilfs2/the_nilfs.c | 42 ++++++++++++++++ 8 files changed, 431 insertions(+), 3 deletions(-)
fs/nilfs2/dir.c +24 -0
@@ -268,6 +268,8 @@ static int nilfs_readdir(struct file *filp, void *dirent, filldir_t filldir)unsigned char *types =NULL ;int ret; +nilfs2_debug (DBG_DIR ,"i_ino %lu\n" , inode->i_ino); +if (pos > inode->i_size -NILFS_DIR_REC_LEN (1 )) goto success;
@@ -345,6 +347,8 @@ nilfs_find_entry(struct inode *dir, const struct qstr *qstr,struct nilfs_inode_info *ei =NILFS_I (dir);struct nilfs_dir_entry *de; +nilfs2_debug (DBG_DIR ,"i_ino %lu\n" , dir->i_ino); +if (npages ==0 ) goto out;
@@ -400,6 +404,8 @@ struct nilfs_dir_entry *nilfs_dotdot(struct inode *dir, struct page **p)struct page *page =nilfs_get_page (dir,0 );struct nilfs_dir_entry *de =NULL ; +nilfs2_debug (DBG_DIR ,"i_ino %lu\n" , dir->i_ino); +if (!IS_ERR (page)) { de =nilfs_next_entry ( (struct nilfs_dir_entry *)page_address (page));
@@ -414,6 +420,8 @@ ino_t nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr)struct nilfs_dir_entry *de;struct page *page; +nilfs2_debug (DBG_DIR ,"i_ino %lu\n" , dir->i_ino); + de =nilfs_find_entry (dir, qstr, &page);if (de) { res =le64_to_cpu (de->inode);
@@ -432,6 +440,10 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de,struct address_space *mapping = page->mapping;int err; +nilfs2_debug (DBG_DIR , +"dir->i_ino %lu, inode->i_ino %lu\n" , + dir->i_ino, inode->i_ino); +lock_page (page); err =nilfs_prepare_chunk (page, from, to);BUG_ON (err);
@@ -461,6 +473,10 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode)unsigned from, to;int err; +nilfs2_debug (DBG_DIR , +"dir->i_ino %lu, inode->i_ino %lu\n" , + dir->i_ino, inode->i_ino); +/* * We take care of directory expansion in the same loop. * This code plays outside i_size, so it locks the page
@@ -557,6 +573,8 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page)struct nilfs_dir_entry *de = (struct nilfs_dir_entry *)(kaddr + from);int err; +nilfs2_debug (DBG_DIR ,"i_ino %lu\n" , inode->i_ino); +while ((char *)de < (char *)dir) {if (de->rec_len ==0 ) { nilfs_error(inode->i_sb, __func__,
@@ -594,6 +612,10 @@ int nilfs_make_empty(struct inode *inode, struct inode *parent)int err;void *kaddr; +nilfs2_debug (DBG_DIR , +"parent->i_ino %lu, inode->i_ino %lu\n" , + parent->i_ino, inode->i_ino); +if (!page)return -ENOMEM ;
@@ -632,6 +654,8 @@ int nilfs_empty_dir(struct inode *inode)struct page *page =NULL ;unsigned long i, npages =dir_pages (inode); +nilfs2_debug (DBG_DIR ,"i_ino %lu\n" , inode->i_ino); +for (i =0 ; i < npages; i++) {char *kaddr;struct nilfs_dir_entry *de;
fs/nilfs2/file.c +6 -0
@@ -41,6 +41,10 @@ int nilfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)struct inode *inode = file->f_mapping->host;int err; +nilfs2_debug (DBG_FILE , +"i_ino %lu, start %llu, end %llu, datasync %d\n" , + inode->i_ino, start, end, datasync); + err =filemap_write_and_wait_range (inode->i_mapping, start, end);if (err)return err;
@@ -71,6 +75,8 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)struct nilfs_transaction_info ti;int ret =0 ; +nilfs2_debug (DBG_FILE ,"i_ino %lu\n" , inode->i_ino); +if (unlikely (nilfs_near_disk_full (inode->i_sb->s_fs_info)))return VM_FAULT_SIGBUS ;/* -ENOSPC */
fs/nilfs2/inode.c +128 -2
327 lines not on this page · raw message
fs/nilfs2/ioctl.c +93 -0
237 lines not on this page · raw message
fs/nilfs2/namei.c +50 -1
133 lines not on this page · raw message
fs/nilfs2/nilfs.h +1 -0
@@ -29,6 +29,7 @@#include <linux/spinlock.h> #include <linux/blkdev.h> #include <linux/nilfs2_fs.h> +#include "debug.h" #include "the_nilfs.h" #include "bmap.h"
fs/nilfs2/super.c +87 -0
249 lines not on this page · raw message
fs/nilfs2/the_nilfs.c +42 -0
114 lines not on this page · raw message
Signature · 8 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html