extern const struct lu_range LUSTRE_SEQ_ZERO_RANGE;
enum {
- /* this is how may FIDs may be allocated in one sequence. */
- LUSTRE_SEQ_MAX_WIDTH = 0x00000000000002800ULL,
+ /* this is how may FIDs may be allocated in one sequence. 16384 for now */
+ LUSTRE_SEQ_MAX_WIDTH = 0x0000000000004000ULL,
- /* how many sequences may be allocate for meta-sequence (this is 10240
+ /* how many sequences may be allocate for meta-sequence (this is 128
* sequences). */
- LUSTRE_SEQ_META_WIDTH = 0x00000000000002800ULL,
+ LUSTRE_SEQ_META_WIDTH = 0x0000000000000080ULL,
- /* this is how many sequences (10240 * 10240) may be in one
+ /* this is how many sequences (128 * 128) may be in one
* super-sequence allocated to MDTs. */
LUSTRE_SEQ_SUPER_WIDTH = (LUSTRE_SEQ_META_WIDTH * LUSTRE_SEQ_META_WIDTH)
};
#define DEBUG_SUBSYSTEM S_LLITE
#include <obd_support.h>
+#include <lustre_fid.h>
#include <lustre_lite.h>
#include <lustre_dlm.h>
#include <lustre_ver.h>
* Returns inode or NULL
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+#if 0
+/* that variant provides correct mapping fid to inode,
+ * it is put here as alternative way to the current one ll_iget() below */
+int ll_test_inode(struct inode *inode, void *opaque)
+{
+ return lu_fid_eq(&ll_i2info(inode)->lli_fid, (struct lu_fid *)opaque);
+}
+
int ll_set_inode(struct inode *inode, void *opaque)
{
- ll_read_inode2(inode, opaque);
+ struct lu_fid *fid = opaque;
+ ll_i2info(inode)->lli_fid = *fid;
+ inode->i_ino = ll_fid_build_ino(ll_s2sbi(inode->i_sb), fid);
return 0;
}
struct inode *inode;
LASSERT(hash != 0);
+ inode = iget5_locked(sb, hash, ll_test_inode, ll_set_inode,
+ &md->body->fid1);
+ if (inode) {
+ if (inode->i_state & I_NEW) {
+ lli = ll_i2info(inode);
+ ll_read_inode2(inode, md);
+ unlock_new_inode(inode);
+ } else {
+ ll_update_inode(inode, md);
+ }
+ CDEBUG(D_VFSTRACE, "inode: %lu/%u(%p)\n",
+ inode->i_ino, inode->i_generation, inode);
+ }
+
+ return inode;
+}
+#else
+struct inode *ll_iget(struct super_block *sb, ino_t hash,
+ struct lustre_md *md)
+{
+ struct ll_inode_info *lli;
+ struct inode *inode;
+ LASSERT(hash != 0);
+
inode = iget_locked(sb, hash);
if (inode) {
if (inode->i_state & I_NEW) {
return inode;
}
+#endif
#else
struct inode *ll_iget(struct super_block *sb, ino_t hash,
struct lustre_md *md)