From 66b835f2cb5360932137ec9ae7c9087e40d681de Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 21 Oct 2007 16:42:13 -0700 Subject: [PATCH] --- yaml --- r: 71991 b: refs/heads/master c: 480b116c98344ca246f50aade6eb7aca98151a2f h: refs/heads/master i: 71989: 4313fff6377fb0c9f8389da2d5046f307301dd62 71987: 18b48703fec641ee0402bb13b8fe1f250ea80caf 71983: f3af0378ed59146320700e676476bdb45625373a v: v3 --- [refs] | 2 +- trunk/mm/shmem.c | 35 +++++++++++++---------------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/[refs] b/[refs] index b407298f52ac..2d728953bd01 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 905251a02eeccc59f8e1d743679b8edadc5f738b +refs/heads/master: 480b116c98344ca246f50aade6eb7aca98151a2f diff --git a/trunk/mm/shmem.c b/trunk/mm/shmem.c index 289dbb0a6fd6..9dd219e6e059 100644 --- a/trunk/mm/shmem.c +++ b/trunk/mm/shmem.c @@ -2020,33 +2020,25 @@ static int shmem_match(struct inode *ino, void *vfh) return ino->i_ino == inum && fh[0] == ino->i_generation; } -static struct dentry *shmem_get_dentry(struct super_block *sb, void *vfh) +static struct dentry *shmem_fh_to_dentry(struct super_block *sb, + struct fid *fid, int fh_len, int fh_type) { - struct dentry *de = NULL; struct inode *inode; - __u32 *fh = vfh; - __u64 inum = fh[2]; - inum = (inum << 32) | fh[1]; + struct dentry *dentry = NULL; + u64 inum = fid->raw[2]; + inum = (inum << 32) | fid->raw[1]; + + if (fh_len < 3) + return NULL; - inode = ilookup5(sb, (unsigned long)(inum+fh[0]), shmem_match, vfh); + inode = ilookup5(sb, (unsigned long)(inum + fid->raw[0]), + shmem_match, fid->raw); if (inode) { - de = d_find_alias(inode); + dentry = d_find_alias(inode); iput(inode); } - return de? de: ERR_PTR(-ESTALE); -} - -static struct dentry *shmem_decode_fh(struct super_block *sb, __u32 *fh, - int len, int type, - int (*acceptable)(void *context, struct dentry *de), - void *context) -{ - if (len < 3) - return ERR_PTR(-ESTALE); - - return sb->s_export_op->find_exported_dentry(sb, fh, NULL, acceptable, - context); + return dentry; } static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len, @@ -2081,9 +2073,8 @@ static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len, static struct export_operations shmem_export_ops = { .get_parent = shmem_get_parent, - .get_dentry = shmem_get_dentry, .encode_fh = shmem_encode_fh, - .decode_fh = shmem_decode_fh, + .fh_to_dentry = shmem_fh_to_dentry, }; static int shmem_parse_options(char *options, int *mode, uid_t *uid,