|
Lines 43-50
struct subfs_mount {
Link Here
|
| 43 |
struct super_block *sb; |
43 |
struct super_block *sb; |
| 44 |
struct semaphore sem; |
44 |
struct semaphore sem; |
| 45 |
int procuid; |
45 |
int procuid; |
|
|
46 |
dev_t dev; |
| 46 |
}; |
47 |
}; |
| 47 |
|
48 |
|
|
|
49 |
|
| 50 |
static int subfs_getattr(struct vfsmount *mnt, struct dentry *dentry, |
| 51 |
struct kstat *stat) |
| 52 |
{ |
| 53 |
struct subfs_mount *sfs_mnt = mnt->mnt_sb->s_fs_info; |
| 54 |
generic_fillattr(dentry->d_inode, stat); |
| 55 |
stat->dev = sfs_mnt->dev; |
| 56 |
return 0; |
| 57 |
} |
| 58 |
|
| 48 |
/* Same as set_fs_pwd from namespace.c. There's a problem with the |
59 |
/* Same as set_fs_pwd from namespace.c. There's a problem with the |
| 49 |
* symbol. When it is fixed, discard this. |
60 |
* symbol. When it is fixed, discard this. |
| 50 |
* Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values. |
61 |
* Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values. |
|
Lines 161-166
static struct vfsmount *get_child_mount
Link Here
|
| 161 |
/* We're sitting in a detached namespace - |
172 |
/* We're sitting in a detached namespace - |
| 162 |
* don't mount the filesystem. */ |
173 |
* don't mount the filesystem. */ |
| 163 |
if (mnt->mnt_mountpoint == mnt->mnt_root) { |
174 |
if (mnt->mnt_mountpoint == mnt->mnt_root) { |
|
|
175 |
sfs_mnt->dev = sfs_mnt->sb->s_dev; |
| 164 |
printk (KERN_ERR "subfs: refusing to mount media in " |
176 |
printk (KERN_ERR "subfs: refusing to mount media in " |
| 165 |
"deleted directory\n"); |
177 |
"deleted directory\n"); |
| 166 |
return ERR_PTR(-ENOENT); |
178 |
return ERR_PTR(-ENOENT); |
|
Lines 179-184
static struct vfsmount *get_child_mount
Link Here
|
| 179 |
printk (KERN_ERR "subfs: unsuccessful attempt to " |
191 |
printk (KERN_ERR "subfs: unsuccessful attempt to " |
| 180 |
"mount media (%d)\n", result); |
192 |
"mount media (%d)\n", result); |
| 181 |
/* Workaround for call_usermodehelper return value bug. */ |
193 |
/* Workaround for call_usermodehelper return value bug. */ |
|
|
194 |
|
| 195 |
sfs_mnt->dev = sfs_mnt->sb->s_dev; |
| 182 |
if (result < 0) |
196 |
if (result < 0) |
| 183 |
return ERR_PTR(result); |
197 |
return ERR_PTR(result); |
| 184 |
return ERR_PTR(-ENOMEDIUM); |
198 |
return ERR_PTR(-ENOMEDIUM); |
|
Lines 191-198
static struct vfsmount *get_child_mount
Link Here
|
| 191 |
*/ |
205 |
*/ |
| 192 |
if (!child) { |
206 |
if (!child) { |
| 193 |
subfs_send_signal(); |
207 |
subfs_send_signal(); |
|
|
208 |
sfs_mnt->dev = sfs_mnt->sb->s_dev; |
| 194 |
return ERR_PTR(-ERESTARTSYS); |
209 |
return ERR_PTR(-ERESTARTSYS); |
| 195 |
} |
210 |
} |
|
|
211 |
|
| 212 |
sfs_mnt->dev = child->mnt_sb->s_dev; |
| 196 |
} |
213 |
} |
| 197 |
|
214 |
|
| 198 |
return child; |
215 |
return child; |
|
Lines 289-294
static struct super_operations subfs_s_o
Link Here
|
| 289 |
|
306 |
|
| 290 |
static struct inode_operations subfs_dir_inode_operations = { |
307 |
static struct inode_operations subfs_dir_inode_operations = { |
| 291 |
.lookup = subfs_lookup, |
308 |
.lookup = subfs_lookup, |
|
|
309 |
.getattr = subfs_getattr, |
| 292 |
}; |
310 |
}; |
| 293 |
|
311 |
|
| 294 |
|
312 |
|
|
Lines 444-449
static struct super_block *subfs_get_sup
Link Here
|
| 444 |
return ERR_PTR(ret); |
462 |
return ERR_PTR(ret); |
| 445 |
newmount->sb = get_sb_nodev(fst, flags, data, subfs_fill_super); |
463 |
newmount->sb = get_sb_nodev(fst, flags, data, subfs_fill_super); |
| 446 |
newmount->sb->s_fs_info = newmount; |
464 |
newmount->sb->s_fs_info = newmount; |
|
|
465 |
newmount->dev = newmount->sb->s_dev; |
| 447 |
return newmount->sb; |
466 |
return newmount->sb; |
| 448 |
} |
467 |
} |
| 449 |
|
468 |
|