Skip to content

Commit

Permalink
exofs: Prints on mount and unmout
Browse files Browse the repository at this point in the history
It is important to print in the logs when a filesystem was
mounted and eventually unmounted.

Print the osd-device's osd_name and pid the FS was
mounted/unmounted on.

TODO: How to also print the namespace path the filesystem was
      mounted on?

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Dec 10, 2009
1 parent 9cfdc7a commit 19fe294
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fs/exofs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ static void exofs_write_super(struct super_block *sb)
sb->s_dirt = 0;
}

static void _exofs_print_device(const char *msg, const char *dev_path,
struct osd_dev *od, u64 pid)
{
const struct osd_dev_info *odi = osduld_device_info(od);

printk(KERN_NOTICE "exofs: %s %s osd_name-%s pid-0x%llx\n",
msg, dev_path ?: "", odi->osdname, _LLU(pid));
}

/*
* This function is called when the vfs is freeing the superblock. We just
* need to free our own part.
Expand All @@ -279,6 +288,7 @@ static void exofs_put_super(struct super_block *sb)
msecs_to_jiffies(100));
}

_exofs_print_device("Unmounting", NULL, sbi->s_dev, sbi->s_pid);
osduld_put_device(sbi->s_dev);
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
Expand Down Expand Up @@ -395,6 +405,7 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
goto free_sbi;
}

_exofs_print_device("Mounting", opts->dev_name, sbi->s_dev, sbi->s_pid);
ret = 0;
out:
if (or)
Expand Down

0 comments on commit 19fe294

Please sign in to comment.