{
struct inode *inode = filp->f_dentry->d_inode;
__u64 pos = filp->f_pos;
+ struct ll_sb_info *sbi = ll_i2sbi(inode);
struct page *page;
struct ll_dir_chain chain;
int rc;
int done;
- int shift;
+ int shift,need_32bit;
__u16 type;
ENTRY;
- CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p) pos %lu/%llu\n",
+ need_32bit = ll_need_32bit_api(sbi);
+
+ CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p) pos %lu/%llu 32bit_api %d\n",
inode->i_ino, inode->i_generation, inode,
- (unsigned long)pos, i_size_read(inode));
+ (unsigned long)pos, i_size_read(inode), need_32bit);
if (pos == DIR_END_OFF)
/*
fid = ent->lde_fid;
name = ent->lde_name;
fid_le_to_cpu(&fid, &fid);
- if (cfs_curproc_is_32bit())
+ if (need_32bit)
ino = ll_fid_build_ino32((struct ll_fid *)&fid);
else
ino = ll_fid_build_ino((struct ll_fid *)&fid);
#define LL_SBI_LRU_RESIZE 0x80 /* support lru resize */
#define LL_SBI_LLITE_CHECKSUM 0x100 /* checksum each page in memory */
#define LL_SBI_LAZYSTATFS 0x200 /* lazystatfs mount option */
+#define LL_SBI_32BIT_API 0x400 /* generate 32 bit inodes. */
/* default value for ll_sb_info->contention_time */
#define SBI_DEFAULT_CONTENTION_SECONDS 60
/* default value for ll_direct_io_default */
#define SBI_DEFAULT_DIRECT_IO_DEFAULT 0
+static inline int ll_need_32bit_api(struct ll_sb_info *sbi)
+{
+#if BITS_PER_LONG == 32
+ return 1;
+#else
+ return unlikely(cfs_curproc_is_32bit() || (sbi->ll_flags & LL_SBI_32BIT_API));
+#endif
+}
+
/* percpu data structure for lustre lru page list */
struct ll_pglist_data {
spinlock_t llpd_lock; /* lock to protect llpg_list */
*flags &= ~tmp;
goto next;
}
+ tmp = ll_set_opt("32bitapi", s1, LL_SBI_32BIT_API);
+ if (tmp) {
+ *flags |= tmp;
+ goto next;
+ }
LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n",
s1);
RETURN(-EINVAL);