The patch titled Subject: nilfs2: embed a back pointer to super block instance in nilfs object has been added to the -mm tree. Its filename is nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxxxxxx> Subject: nilfs2: embed a back pointer to super block instance in nilfs object Insert a back pointer to super block instance in nilfs object so that functions of nilfs2 easily refer to the super block instance. This simplifies replacement of printk() in the successive change. Link: http://lkml.kernel.org/r/1464875891-5443-4-git-send-email-konishi.ryusuke@xxxxxxxxxxxxx Signed-off-by: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/nilfs2/super.c | 2 +- fs/nilfs2/the_nilfs.c | 7 ++++--- fs/nilfs2/the_nilfs.h | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff -puN fs/nilfs2/super.c~nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object fs/nilfs2/super.c --- a/fs/nilfs2/super.c~nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object +++ a/fs/nilfs2/super.c @@ -1076,7 +1076,7 @@ nilfs_fill_super(struct super_block *sb, __u64 cno; int err; - nilfs = alloc_nilfs(sb->s_bdev); + nilfs = alloc_nilfs(sb); if (!nilfs) return -ENOMEM; diff -puN fs/nilfs2/the_nilfs.c~nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object fs/nilfs2/the_nilfs.c --- a/fs/nilfs2/the_nilfs.c~nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object +++ a/fs/nilfs2/the_nilfs.c @@ -56,12 +56,12 @@ void nilfs_set_last_segment(struct the_n /** * alloc_nilfs - allocate a nilfs object - * @bdev: block device to which the_nilfs is related + * @sb: super block instance * * Return Value: On success, pointer to the_nilfs is returned. * On error, NULL is returned. */ -struct the_nilfs *alloc_nilfs(struct block_device *bdev) +struct the_nilfs *alloc_nilfs(struct super_block *sb) { struct the_nilfs *nilfs; @@ -69,7 +69,8 @@ struct the_nilfs *alloc_nilfs(struct blo if (!nilfs) return NULL; - nilfs->ns_bdev = bdev; + nilfs->ns_sb = sb; + nilfs->ns_bdev = sb->s_bdev; atomic_set(&nilfs->ns_ndirtyblks, 0); init_rwsem(&nilfs->ns_sem); mutex_init(&nilfs->ns_snapshot_mount_mutex); diff -puN fs/nilfs2/the_nilfs.h~nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object fs/nilfs2/the_nilfs.h --- a/fs/nilfs2/the_nilfs.h~nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object +++ a/fs/nilfs2/the_nilfs.h @@ -43,6 +43,7 @@ enum { * struct the_nilfs - struct to supervise multiple nilfs mount points * @ns_flags: flags * @ns_flushed_device: flag indicating if all volatile data was flushed + * @ns_sb: back pointer to super block instance * @ns_bdev: block device * @ns_sem: semaphore for shared states * @ns_snapshot_mount_mutex: mutex to protect snapshot mounts @@ -102,6 +103,7 @@ struct the_nilfs { unsigned long ns_flags; int ns_flushed_device; + struct super_block *ns_sb; struct block_device *ns_bdev; struct rw_semaphore ns_sem; struct mutex ns_snapshot_mount_mutex; @@ -281,7 +283,7 @@ static inline int nilfs_sb_will_flip(str } void nilfs_set_last_segment(struct the_nilfs *, sector_t, u64, __u64); -struct the_nilfs *alloc_nilfs(struct block_device *bdev); +struct the_nilfs *alloc_nilfs(struct super_block *sb); void destroy_nilfs(struct the_nilfs *nilfs); int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb, char *data); int load_nilfs(struct the_nilfs *nilfs, struct super_block *sb); _ Patches currently in -mm which might be from konishi.ryusuke@xxxxxxxxxxxxx are nilfs2-hide-function-name-argument-from-nilfs_error.patch nilfs2-add-nilfs_msg-message-interface.patch nilfs2-embed-a-back-pointer-to-super-block-instance-in-nilfs-object.patch nilfs2-reduce-bare-use-of-printk-with-nilfs_msg.patch nilfs2-replace-nilfs_warning-with-nilfs_msg.patch nilfs2-emit-error-message-when-i-o-error-is-detected.patch nilfs2-do-not-use-yield.patch nilfs2-refactor-parser-of-snapshot-mount-option.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html