* 2 -- contains child file handle and parent file handle;
* 255 -- error.
*/
-#ifndef HAVE_ENCODE_FH_PARENT
-static int ll_encode_fh(struct dentry *de, u32 *fh, int *plen,
- int connectable)
-{
- struct inode *inode = de->d_inode;
- struct inode *parent = de->d_parent->d_inode;
-#else
static int ll_encode_fh(struct inode *inode, u32 *fh, int *plen,
struct inode *parent)
{
-#endif
int fileid_len = sizeof(struct lustre_file_handle) / 4;
struct lustre_file_handle *lfh = (void *)fh;
#endif /* HAVE_FILLDIR_USE_CTX */
/*
* It is hack to access lde_fid for comparison with lgd_fid.
- * So the input 'name' must be part of the 'lu_dirent'.
+ * So the input 'name' must be part of the 'lu_dirent', and
+ * so must appear to be a non-const pointer to an empty array.
*/
- struct lu_dirent *lde = container_of0(name, struct lu_dirent, lde_name);
+ char (*n)[0] = (void *)name;
+ struct lu_dirent *lde = container_of0(n, struct lu_dirent, lde_name);
struct lu_fid fid;
fid_le_to_cpu(&fid, &lde->lde_fid);