diff options
Diffstat (limited to 'fs/exportfs/expfs.c')
| -rw-r--r-- | fs/exportfs/expfs.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index 8adb32a9387a..813011aad700 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c | |||
| @@ -434,29 +434,29 @@ out: | |||
| 434 | * can be used to check that it is still valid. It places them in the | 434 | * can be used to check that it is still valid. It places them in the |
| 435 | * filehandle fragment where export_decode_fh expects to find them. | 435 | * filehandle fragment where export_decode_fh expects to find them. |
| 436 | */ | 436 | */ |
| 437 | static int export_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len, | 437 | static int export_encode_fh(struct dentry *dentry, struct fid *fid, |
| 438 | int connectable) | 438 | int *max_len, int connectable) |
| 439 | { | 439 | { |
| 440 | struct inode * inode = dentry->d_inode; | 440 | struct inode * inode = dentry->d_inode; |
| 441 | int len = *max_len; | 441 | int len = *max_len; |
| 442 | int type = 1; | 442 | int type = FILEID_INO32_GEN; |
| 443 | 443 | ||
| 444 | if (len < 2 || (connectable && len < 4)) | 444 | if (len < 2 || (connectable && len < 4)) |
| 445 | return 255; | 445 | return 255; |
| 446 | 446 | ||
| 447 | len = 2; | 447 | len = 2; |
| 448 | fh[0] = inode->i_ino; | 448 | fid->i32.ino = inode->i_ino; |
| 449 | fh[1] = inode->i_generation; | 449 | fid->i32.gen = inode->i_generation; |
| 450 | if (connectable && !S_ISDIR(inode->i_mode)) { | 450 | if (connectable && !S_ISDIR(inode->i_mode)) { |
| 451 | struct inode *parent; | 451 | struct inode *parent; |
| 452 | 452 | ||
| 453 | spin_lock(&dentry->d_lock); | 453 | spin_lock(&dentry->d_lock); |
| 454 | parent = dentry->d_parent->d_inode; | 454 | parent = dentry->d_parent->d_inode; |
| 455 | fh[2] = parent->i_ino; | 455 | fid->i32.parent_ino = parent->i_ino; |
| 456 | fh[3] = parent->i_generation; | 456 | fid->i32.parent_gen = parent->i_generation; |
| 457 | spin_unlock(&dentry->d_lock); | 457 | spin_unlock(&dentry->d_lock); |
| 458 | len = 4; | 458 | len = 4; |
| 459 | type = 2; | 459 | type = FILEID_INO32_GEN_PARENT; |
| 460 | } | 460 | } |
| 461 | *max_len = len; | 461 | *max_len = len; |
| 462 | return type; | 462 | return type; |
| @@ -494,34 +494,34 @@ static struct dentry *export_decode_fh(struct super_block *sb, __u32 *fh, int fh | |||
| 494 | acceptable, context); | 494 | acceptable, context); |
| 495 | } | 495 | } |
| 496 | 496 | ||
| 497 | int exportfs_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len, | 497 | int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, |
| 498 | int connectable) | 498 | int connectable) |
| 499 | { | 499 | { |
| 500 | struct export_operations *nop = dentry->d_sb->s_export_op; | 500 | struct export_operations *nop = dentry->d_sb->s_export_op; |
| 501 | int error; | 501 | int error; |
| 502 | 502 | ||
| 503 | if (nop->encode_fh) | 503 | if (nop->encode_fh) |
| 504 | error = nop->encode_fh(dentry, fh, max_len, connectable); | 504 | error = nop->encode_fh(dentry, fid->raw, max_len, connectable); |
| 505 | else | 505 | else |
| 506 | error = export_encode_fh(dentry, fh, max_len, connectable); | 506 | error = export_encode_fh(dentry, fid, max_len, connectable); |
| 507 | 507 | ||
| 508 | return error; | 508 | return error; |
| 509 | } | 509 | } |
| 510 | EXPORT_SYMBOL_GPL(exportfs_encode_fh); | 510 | EXPORT_SYMBOL_GPL(exportfs_encode_fh); |
| 511 | 511 | ||
| 512 | struct dentry *exportfs_decode_fh(struct vfsmount *mnt, __u32 *fh, int fh_len, | 512 | struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid, |
| 513 | int fileid_type, int (*acceptable)(void *, struct dentry *), | 513 | int fh_len, int fileid_type, |
| 514 | void *context) | 514 | int (*acceptable)(void *, struct dentry *), void *context) |
| 515 | { | 515 | { |
| 516 | struct export_operations *nop = mnt->mnt_sb->s_export_op; | 516 | struct export_operations *nop = mnt->mnt_sb->s_export_op; |
| 517 | struct dentry *result; | 517 | struct dentry *result; |
| 518 | 518 | ||
| 519 | if (nop->decode_fh) { | 519 | if (nop->decode_fh) { |
| 520 | result = nop->decode_fh(mnt->mnt_sb, fh, fh_len, fileid_type, | 520 | result = nop->decode_fh(mnt->mnt_sb, fid->raw, fh_len, |
| 521 | acceptable, context); | 521 | fileid_type, acceptable, context); |
| 522 | } else { | 522 | } else { |
| 523 | result = export_decode_fh(mnt->mnt_sb, fh, fh_len, fileid_type, | 523 | result = export_decode_fh(mnt->mnt_sb, fid->raw, fh_len, |
| 524 | acceptable, context); | 524 | fileid_type, acceptable, context); |
| 525 | } | 525 | } |
| 526 | 526 | ||
| 527 | return result; | 527 | return result; |
