super.c (278038ac53c6c4f53d1d34f978beb9aba1410b2c) | super.c (572d8b3945a31bee7c40d21556803e4807fd9141) |
---|---|
1/* 2 * super.c - NILFS module and super block management. 3 * 4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 931 unchanged lines hidden (view full) --- 940 941static int nilfs_attach_snapshot(struct super_block *s, __u64 cno, 942 struct dentry **root_dentry) 943{ 944 struct the_nilfs *nilfs = s->s_fs_info; 945 struct nilfs_root *root; 946 int ret; 947 | 1/* 2 * super.c - NILFS module and super block management. 3 * 4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 931 unchanged lines hidden (view full) --- 940 941static int nilfs_attach_snapshot(struct super_block *s, __u64 cno, 942 struct dentry **root_dentry) 943{ 944 struct the_nilfs *nilfs = s->s_fs_info; 945 struct nilfs_root *root; 946 int ret; 947 |
948 mutex_lock(&nilfs->ns_snapshot_mount_mutex); 949 |
|
948 down_read(&nilfs->ns_segctor_sem); 949 ret = nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, cno); 950 up_read(&nilfs->ns_segctor_sem); 951 if (ret < 0) { 952 ret = (ret == -ENOENT) ? -EINVAL : ret; 953 goto out; 954 } else if (!ret) { 955 printk(KERN_ERR "NILFS: The specified checkpoint is " --- 8 unchanged lines hidden (view full) --- 964 printk(KERN_ERR "NILFS: error loading snapshot " 965 "(checkpoint number=%llu).\n", 966 (unsigned long long)cno); 967 goto out; 968 } 969 ret = nilfs_get_root_dentry(s, root, root_dentry); 970 nilfs_put_root(root); 971 out: | 950 down_read(&nilfs->ns_segctor_sem); 951 ret = nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, cno); 952 up_read(&nilfs->ns_segctor_sem); 953 if (ret < 0) { 954 ret = (ret == -ENOENT) ? -EINVAL : ret; 955 goto out; 956 } else if (!ret) { 957 printk(KERN_ERR "NILFS: The specified checkpoint is " --- 8 unchanged lines hidden (view full) --- 966 printk(KERN_ERR "NILFS: error loading snapshot " 967 "(checkpoint number=%llu).\n", 968 (unsigned long long)cno); 969 goto out; 970 } 971 ret = nilfs_get_root_dentry(s, root, root_dentry); 972 nilfs_put_root(root); 973 out: |
974 mutex_unlock(&nilfs->ns_snapshot_mount_mutex); |
|
972 return ret; 973} 974 975static int nilfs_tree_was_touched(struct dentry *root_dentry) 976{ 977 return root_dentry->d_count > 1; 978} 979 --- 478 unchanged lines hidden --- | 975 return ret; 976} 977 978static int nilfs_tree_was_touched(struct dentry *root_dentry) 979{ 980 return root_dentry->d_count > 1; 981} 982 --- 478 unchanged lines hidden --- |