diff options
author | Eric Van Hensbergen <ericvh@kernel.org> | 2024-01-05 19:03:16 +0000 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@kernel.org> | 2024-01-26 16:46:56 +0000 |
commit | b91a26696ef38eae1442aa03104e60bb49d2ac99 (patch) | |
tree | 65f28d68f9ab2327d0be8b33c32f468b29d5a92d /fs/9p/v9fs_vfs.h | |
parent | f61c906a7dffaa21b28c52000a75f2c6554a8199 (diff) | |
download | linux-b91a26696ef38eae1442aa03104e60bb49d2ac99.tar.gz linux-b91a26696ef38eae1442aa03104e60bb49d2ac99.tar.bz2 linux-b91a26696ef38eae1442aa03104e60bb49d2ac99.zip |
fs/9p: rework qid2ino logic
This changes from a function to a macro because we can
figure out if we are 32 or 64 bit at compile time.
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
Diffstat (limited to 'fs/9p/v9fs_vfs.h')
-rw-r--r-- | fs/9p/v9fs_vfs.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h index 6873850ad93e..d3aefbec4de6 100644 --- a/fs/9p/v9fs_vfs.h +++ b/fs/9p/v9fs_vfs.h @@ -44,7 +44,12 @@ void v9fs_set_netfs_context(struct inode *inode); int v9fs_init_inode(struct v9fs_session_info *v9ses, struct inode *inode, umode_t mode, dev_t rdev); void v9fs_evict_inode(struct inode *inode); -ino_t v9fs_qid2ino(struct p9_qid *qid); +#if (BITS_PER_LONG == 32) +#define QID2INO(q) ((ino_t) (((q)->path+2) ^ (((q)->path) >> 32))) +#else +#define QID2INO(q) ((ino_t) ((q)->path+2)) +#endif + void v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, struct super_block *sb, unsigned int flags); void v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, |