- dio_insert and dio_delete never update link counts, not even
for "." and "..".
* Revise ldiskfs_add_dot_dotdot() to be able to add "." and
".." separately, without changing link counts. (Maybe we
don't need a special function here; the generic
ldiskfs_add_entry() works for "." and ".."?)
* Revise ldiskfs_create_inode() to initial i_fop, i_op, etc.,
for directory inodes. This is currently done by
ldiskfs_add_dot_dotdot(). (We may also set i_nlink to zero
here, as the API between LDiskFS and Lustre is being
changed anyway.)
- do_ref_add and do_ref_del always work as expected for
directories.
* A flag should be set for new directory in-memory objects,
indicating it's not yet initialized with "." and "..".
* do_ref_add clears the flag if it is set and the link count
is going from one to two.
* The DIR_NLINK stuff in do_ref_add and do_ref_del works only
when the flag is absent.
* This scheme assumes that the creation of a directory object
and its initialization (i.e., link count, ".", and "..")
happen in one transaction, which I think is quite
reasonable.