aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/ioctl.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-03-08 21:05:08 -0500
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-03-08 21:54:26 -0500
commite3154e9748f0f337e9f6ff9dc7d7bf24d426bd1a (patch)
treeac2a3f3dca6189b8a608571c49da66386fd1bdec /fs/nilfs2/ioctl.c
parentf7545144c2e3d280139260df934043e0a6ccce6f (diff)
nilfs2: get rid of nilfs_sb_info structure
This directly uses sb->s_fs_info to keep a nilfs filesystem object and fully removes the intermediate nilfs_sb_info structure. With this change, the hierarchy of on-memory structures of nilfs will be simplified as follows: Before: super_block -> nilfs_sb_info -> the_nilfs -> cptree --+-> nilfs_root (current file system) +-> nilfs_root (snapshot A) +-> nilfs_root (snapshot B) : -> nilfs_sc_info (log writer structure) After: super_block -> the_nilfs -> cptree --+-> nilfs_root (current file system) +-> nilfs_root (snapshot A) +-> nilfs_root (snapshot B) : -> nilfs_sc_info (log writer structure) The reason why we didn't design so from the beginning is because the initial shape also differed from the above. The early hierachy was composed of "per-mount-point" super_block -> nilfs_sb_info pairs and a shared nilfs object. On the kernel 2.6.37, it was changed to the current shape in order to unify super block instances into one per device, and this cleanup became applicable as the result. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/ioctl.c')
-rw-r--r--fs/nilfs2/ioctl.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 5471eed5eccb..95c04c2f2b3e 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -166,8 +166,7 @@ static int nilfs_ioctl_getversion(struct inode *inode, void __user *argp)
166static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, 166static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
167 unsigned int cmd, void __user *argp) 167 unsigned int cmd, void __user *argp)
168{ 168{
169 struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; 169 struct the_nilfs *nilfs = inode->i_sb->s_fs_info;
170 struct inode *cpfile = nilfs->ns_cpfile;
171 struct nilfs_transaction_info ti; 170 struct nilfs_transaction_info ti;
172 struct nilfs_cpmode cpmode; 171 struct nilfs_cpmode cpmode;
173 int ret; 172 int ret;
@@ -187,7 +186,7 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
187 186
188 nilfs_transaction_begin(inode->i_sb, &ti, 0); 187 nilfs_transaction_begin(inode->i_sb, &ti, 0);
189 ret = nilfs_cpfile_change_cpmode( 188 ret = nilfs_cpfile_change_cpmode(
190 cpfile, cpmode.cm_cno, cpmode.cm_mode); 189 nilfs->ns_cpfile, cpmode.cm_cno, cpmode.cm_mode);
191 if (unlikely(ret < 0)) 190 if (unlikely(ret < 0))
192 nilfs_transaction_abort(inode->i_sb); 191 nilfs_transaction_abort(inode->i_sb);
193 else 192 else
@@ -203,7 +202,7 @@ static int
203nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp, 202nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp,
204 unsigned int cmd, void __user *argp) 203 unsigned int cmd, void __user *argp)
205{ 204{
206 struct inode *cpfile = NILFS_SB(inode->i_sb)->s_nilfs->ns_cpfile; 205 struct the_nilfs *nilfs = inode->i_sb->s_fs_info;
207 struct nilfs_transaction_info ti; 206 struct nilfs_transaction_info ti;
208 __u64 cno; 207 __u64 cno;
209 int ret; 208 int ret;
@@ -220,7 +219,7 @@ nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp,
220 goto out; 219 goto out;
221 220
222 nilfs_transaction_begin(inode->i_sb, &ti, 0); 221 nilfs_transaction_begin(inode->i_sb, &ti, 0);
223 ret = nilfs_cpfile_delete_checkpoint(cpfile, cno); 222 ret = nilfs_cpfile_delete_checkpoint(nilfs->ns_cpfile, cno);
224 if (unlikely(ret < 0)) 223 if (unlikely(ret < 0))
225 nilfs_transaction_abort(inode->i_sb); 224 nilfs_transaction_abort(inode->i_sb);
226 else 225 else
@@ -246,7 +245,7 @@ nilfs_ioctl_do_get_cpinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
246static int nilfs_ioctl_get_cpstat(struct inode *inode, struct file *filp, 245static int nilfs_ioctl_get_cpstat(struct inode *inode, struct file *filp,
247 unsigned int cmd, void __user *argp) 246 unsigned int cmd, void __user *argp)
248{ 247{
249 struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; 248 struct the_nilfs *nilfs = inode->i_sb->s_fs_info;
250 struct nilfs_cpstat cpstat; 249 struct nilfs_cpstat cpstat;
251 int ret; 250 int ret;
252 251
@@ -277,7 +276,7 @@ nilfs_ioctl_do_get_suinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
277static int nilfs_ioctl_get_sustat(struct inode *inode, struct file *filp, 276static int nilfs_ioctl_get_sustat(struct inode *inode, struct file *filp,
278 unsigned int cmd, void __user *argp) 277 unsigned int cmd, void __user *argp)
279{ 278{
280 struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; 279 struct the_nilfs *nilfs = inode->i_sb->s_fs_info;
281 struct nilfs_sustat sustat; 280 struct nilfs_sustat sustat;
282 int ret; 281 int ret;
283 282
@@ -333,7 +332,7 @@ nilfs_ioctl_do_get_bdescs(struct the_nilfs *nilfs, __u64 *posp, int flags,
333static int nilfs_ioctl_get_bdescs(struct inode *inode, struct file *filp, 332static int nilfs_ioctl_get_bdescs(struct inode *inode, struct file *filp,
334 unsigned int cmd, void __user *argp) 333 unsigned int cmd, void __user *argp)
335{ 334{
336 struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; 335 struct the_nilfs *nilfs = inode->i_sb->s_fs_info;
337 struct nilfs_argv argv; 336 struct nilfs_argv argv;
338 int ret; 337 int ret;
339 338
@@ -402,7 +401,7 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb,
402 struct nilfs_argv *argv, void *buf) 401 struct nilfs_argv *argv, void *buf)
403{ 402{
404 size_t nmembs = argv->v_nmembs; 403 size_t nmembs = argv->v_nmembs;
405 struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; 404 struct the_nilfs *nilfs = sb->s_fs_info;
406 struct inode *inode; 405 struct inode *inode;
407 struct nilfs_vdesc *vdesc; 406 struct nilfs_vdesc *vdesc;
408 struct buffer_head *bh, *n; 407 struct buffer_head *bh, *n;
@@ -616,7 +615,7 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,
616 ret = PTR_ERR(kbufs[4]); 615 ret = PTR_ERR(kbufs[4]);
617 goto out; 616 goto out;
618 } 617 }
619 nilfs = NILFS_SB(inode->i_sb)->s_nilfs; 618 nilfs = inode->i_sb->s_fs_info;
620 619
621 for (n = 0; n < 4; n++) { 620 for (n = 0; n < 4; n++) {
622 ret = -EINVAL; 621 ret = -EINVAL;
@@ -689,7 +688,7 @@ static int nilfs_ioctl_sync(struct inode *inode, struct file *filp,
689 return ret; 688 return ret;
690 689
691 if (argp != NULL) { 690 if (argp != NULL) {
692 nilfs = NILFS_SB(inode->i_sb)->s_nilfs; 691 nilfs = inode->i_sb->s_fs_info;
693 down_read(&nilfs->ns_segctor_sem); 692 down_read(&nilfs->ns_segctor_sem);
694 cno = nilfs->ns_cno - 1; 693 cno = nilfs->ns_cno - 1;
695 up_read(&nilfs->ns_segctor_sem); 694 up_read(&nilfs->ns_segctor_sem);
@@ -707,7 +706,7 @@ static int nilfs_ioctl_get_info(struct inode *inode, struct file *filp,
707 void *, size_t, size_t)) 706 void *, size_t, size_t))
708 707
709{ 708{
710 struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; 709 struct the_nilfs *nilfs = inode->i_sb->s_fs_info;
711 struct nilfs_argv argv; 710 struct nilfs_argv argv;
712 int ret; 711 int ret;
713 712