Skip to contentSkip to conversation

Why no pseudo_dir.c:get_parent()?

DISCUSSION Peter van Hardenberg 2 participants 2 messages Dec 17, 2005 – Dec 19, 2005

lore
Share & tools
lore
#0 lore raw

We need more pseudo_dir methods than you have defined, so we are extending the model slightly. In this process, we discovered this:

/* pseudo files are not serializable (currently). So, this should just return an
* error. */
reiser4_internal struct dentry *
get_parent_pseudo(struct inode *child)

{
	return ERR_PTR(RETERR(-ENOTSUPP));
}

Please comment on why this returns -ENOTSUPP instead of returning the host file/pseudo file which is the parent of the current directory. -pvh

Signature · 2 lines
Peter van Hardenberg ([email protected])
Victoria, BC, Canada
#1 lore raw
Quoted 6 lines · Peter van Hardenberg

We need more pseudo_dir methods than you have defined, so we are extending the model slightly. In this process, we discovered this:

/* pseudo files are not serializable (currently). So, this should just return an
* error. */
reiser4_internal struct dentry *
get_parent_pseudo(struct inode *child)

Quoted 6 lines
{
	return ERR_PTR(RETERR(-ENOTSUPP));
}

Please comment on why this returns -ENOTSUPP instead of returning the host file/pseudo file which is the parent of the current directory.

I believe, you _can_ implement this method (e.g., as you correctly mention, by returning host object), but this is not needed:
->get_parent() method is a part of operations vector that reiser4 uses to generate NFS file-handles for objects (see reiser4_get_dentry_parent() and reiser4_export_operations).

I didn't want pseudo files to be exported over NFS: for one thing consistency guarantees provided by NFS protocol are so weak that this would be a sure path to unpredictably delayed meta-data operations (that is, a path to hell). Hence, ->get_parent() method of dir_plugin together with .wire methods of file_plugin for pseudo files were left unimplemented.

Hope this makes it clear(er).

Quoted 1 line

-pvh

Nikita.