Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33924
b: refs/heads/master
c: fdb3667
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Sep 16, 2006
1 parent cae7a7d commit 5acfa1e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ecaff756ff540f3821e2b00b8fa19aca07c7c3e5
refs/heads/master: fdb36673a9d6accf93b11e7eff3a7e34cd284616
42 changes: 42 additions & 0 deletions trunk/fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,47 @@ static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
return 0;
}


static struct dentry *ext3_get_dentry(struct super_block *sb, void *vobjp)
{
__u32 *objp = vobjp;
unsigned long ino = objp[0];
__u32 generation = objp[1];
struct inode *inode;
struct dentry *result;

if (ino < EXT3_FIRST_INO(sb) && ino != EXT3_ROOT_INO)
return ERR_PTR(-ESTALE);
if (ino > le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count))
return ERR_PTR(-ESTALE);

/* iget isn't really right if the inode is currently unallocated!!
*
* ext3_read_inode will return a bad_inode if the inode had been
* deleted, so we should be safe.
*
* Currently we don't know the generation for parent directory, so
* a generation of 0 means "accept any"
*/
inode = iget(sb, ino);
if (inode == NULL)
return ERR_PTR(-ENOMEM);
if (is_bad_inode(inode) ||
(generation && inode->i_generation != generation)) {
iput(inode);
return ERR_PTR(-ESTALE);
}
/* now to find a dentry.
* If possible, get a well-connected one
*/
result = d_alloc_anon(inode);
if (!result) {
iput(inode);
return ERR_PTR(-ENOMEM);
}
return result;
}

#ifdef CONFIG_QUOTA
#define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group")
#define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA))
Expand Down Expand Up @@ -622,6 +663,7 @@ static struct super_operations ext3_sops = {

static struct export_operations ext3_export_ops = {
.get_parent = ext3_get_parent,
.get_dentry = ext3_get_dentry,
};

enum {
Expand Down

0 comments on commit 5acfa1e

Please sign in to comment.