|
Lines 43-48
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 |
struct kstat stat; |
| 46 |
}; |
47 |
}; |
| 47 |
|
48 |
|
| 48 |
/* Same as set_fs_pwd from namespace.c. There's a problem with the |
49 |
/* Same as set_fs_pwd from namespace.c. There's a problem with the |
|
Lines 163-168
static struct vfsmount *get_child_mount
Link Here
|
| 163 |
if (mnt->mnt_mountpoint == mnt->mnt_root) { |
164 |
if (mnt->mnt_mountpoint == mnt->mnt_root) { |
| 164 |
printk (KERN_ERR "subfs: refusing to mount media in " |
165 |
printk (KERN_ERR "subfs: refusing to mount media in " |
| 165 |
"deleted directory\n"); |
166 |
"deleted directory\n"); |
|
|
167 |
generic_fillattr(sfs_mnt->sb->s_root->d_inode, &sfs_mnt->stat); |
| 168 |
|
| 166 |
return ERR_PTR(-ENOENT); |
169 |
return ERR_PTR(-ENOENT); |
| 167 |
} |
170 |
} |
| 168 |
|
171 |
|
|
Lines 179-184
static struct vfsmount *get_child_mount
Link Here
|
| 179 |
printk (KERN_ERR "subfs: unsuccessful attempt to " |
182 |
printk (KERN_ERR "subfs: unsuccessful attempt to " |
| 180 |
"mount media (%d)\n", result); |
183 |
"mount media (%d)\n", result); |
| 181 |
/* Workaround for call_usermodehelper return value bug. */ |
184 |
/* Workaround for call_usermodehelper return value bug. */ |
|
|
185 |
generic_fillattr(sfs_mnt->sb->s_root->d_inode, |
| 186 |
&sfs_mnt->stat); |
| 187 |
|
| 182 |
if (result < 0) |
188 |
if (result < 0) |
| 183 |
return ERR_PTR(result); |
189 |
return ERR_PTR(result); |
| 184 |
return ERR_PTR(-ENOMEDIUM); |
190 |
return ERR_PTR(-ENOMEDIUM); |
|
Lines 190-198
static struct vfsmount *get_child_mount
Link Here
|
| 190 |
* it was umounted already. Tell the process to retry. |
196 |
* it was umounted already. Tell the process to retry. |
| 191 |
*/ |
197 |
*/ |
| 192 |
if (!child) { |
198 |
if (!child) { |
|
|
199 |
generic_fillattr(sfs_mnt->sb->s_root->d_inode, |
| 200 |
&sfs_mnt->stat); |
| 193 |
subfs_send_signal(); |
201 |
subfs_send_signal(); |
| 194 |
return ERR_PTR(-ERESTARTSYS); |
202 |
return ERR_PTR(-ERESTARTSYS); |
| 195 |
} |
203 |
} |
|
|
204 |
result = vfs_getattr(child, child->mnt_root, &sfs_mnt->stat); |
| 205 |
if (result) { |
| 206 |
mntput(child); |
| 207 |
return ERR_PTR(result); |
| 208 |
} |
| 196 |
} |
209 |
} |
| 197 |
|
210 |
|
| 198 |
return child; |
211 |
return child; |
|
Lines 281-286
static int subfs_statfs(struct super_blo
Link Here
|
| 281 |
#endif |
294 |
#endif |
| 282 |
} |
295 |
} |
| 283 |
|
296 |
|
|
|
297 |
static int subfs_getattr(struct vfsmount *mnt, struct dentry *dentry, |
| 298 |
struct kstat *stat) |
| 299 |
{ |
| 300 |
struct subfs_mount *sfs_mnt = mnt->mnt_sb->s_fs_info; |
| 301 |
*stat = sfs_mnt->stat; |
| 302 |
return 0; |
| 303 |
} |
| 304 |
|
| 305 |
|
| 284 |
static struct super_operations subfs_s_ops = { |
306 |
static struct super_operations subfs_s_ops = { |
| 285 |
.statfs = subfs_statfs, |
307 |
.statfs = subfs_statfs, |
| 286 |
.drop_inode = generic_delete_inode, |
308 |
.drop_inode = generic_delete_inode, |
|
Lines 289-294
static struct super_operations subfs_s_o
Link Here
|
| 289 |
|
311 |
|
| 290 |
static struct inode_operations subfs_dir_inode_operations = { |
312 |
static struct inode_operations subfs_dir_inode_operations = { |
| 291 |
.lookup = subfs_lookup, |
313 |
.lookup = subfs_lookup, |
|
|
314 |
.getattr = subfs_getattr, |
| 292 |
}; |
315 |
}; |
| 293 |
|
316 |
|
| 294 |
|
317 |
|
|
Lines 310-315
static struct inode *subfs_make_inode(st
Link Here
|
| 310 |
ret->i_blocks = 0; |
333 |
ret->i_blocks = 0; |
| 311 |
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; |
334 |
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; |
| 312 |
ret->i_fop = &subfs_file_ops; |
335 |
ret->i_fop = &subfs_file_ops; |
|
|
336 |
ret->i_nlink = 2; |
| 313 |
} |
337 |
} |
| 314 |
return ret; |
338 |
return ret; |
| 315 |
} |
339 |
} |
|
Lines 444-449
static struct super_block *subfs_get_sup
Link Here
|
| 444 |
return ERR_PTR(ret); |
468 |
return ERR_PTR(ret); |
| 445 |
newmount->sb = get_sb_nodev(fst, flags, data, subfs_fill_super); |
469 |
newmount->sb = get_sb_nodev(fst, flags, data, subfs_fill_super); |
| 446 |
newmount->sb->s_fs_info = newmount; |
470 |
newmount->sb->s_fs_info = newmount; |
|
|
471 |
generic_fillattr(newmount->sb->s_root->d_inode, &newmount->stat); |
| 447 |
return newmount->sb; |
472 |
return newmount->sb; |
| 448 |
} |
473 |
} |
| 449 |
|
474 |
|