Commit c02c0886 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] knfsd: Add server-side support for the nfsv4 mounted_on_fileid attribute.

From: NeilBrown <neilb@cse.unsw.edu.au>
parent 94b1c3eb
......@@ -1588,7 +1588,18 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
WRITE32(stat.mtime.tv_sec);
WRITE32(stat.mtime.tv_nsec);
}
if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) {
struct dentry *mnt_pnt, *mnt_root;
if ((buflen -= 8) < 0)
goto out_resource;
mnt_root = exp->ex_mnt->mnt_root;
if (mnt_root->d_inode == dentry->d_inode) {
mnt_pnt = exp->ex_mnt->mnt_mountpoint;
WRITE64((u64) mnt_pnt->d_inode->i_ino);
} else
WRITE64((u64) stat.ino);
}
*attrlenp = htonl((char *)p - (char *)attrlenp - 4);
*countp = p - buffer;
status = nfs_ok;
......
......@@ -274,6 +274,7 @@ enum lock_type4 {
#define FATTR4_WORD1_TIME_METADATA (1 << 20)
#define FATTR4_WORD1_TIME_MODIFY (1 << 21)
#define FATTR4_WORD1_TIME_MODIFY_SET (1 << 22)
#define FATTR4_WORD1_MOUNTED_ON_FILEID (1 << 23)
#define NFSPROC4_NULL 0
#define NFSPROC4_COMPOUND 1
......
......@@ -278,7 +278,7 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
| FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \
| FATTR4_WORD1_SPACE_USED | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_ACCESS_SET \
| FATTR4_WORD1_TIME_CREATE | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \
| FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET)
| FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID)
/* These will return ERR_INVAL if specified in GETATTR or READDIR. */
#define NFSD_WRITEONLY_ATTRS_WORD1 \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment