* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
#include <linux/module.h>
#include <linux/types.h>
-#include <linux/random.h>
#include <linux/version.h>
#include <linux/mm.h>
cfs_list_add_tail(&sbi->ll_list, &ll_super_blocks);
cfs_spin_unlock(&ll_sb_lock);
-#ifdef ENABLE_LLITE_CHECKSUM
+#ifdef ENABLE_CHECKSUM
sbi->ll_flags |= LL_SBI_CHECKSUM;
#endif
OBD_CONNECT_OSS_CAPA | OBD_CONNECT_CANCELSET|
OBD_CONNECT_FID | OBD_CONNECT_AT |
OBD_CONNECT_LOV_V3 | OBD_CONNECT_RMT_CLIENT |
- OBD_CONNECT_VBR | OBD_CONNECT_SOM;
+ OBD_CONNECT_VBR | OBD_CONNECT_FULL20;
+
+ if (sbi->ll_flags & LL_SBI_SOM_PREVIEW)
+ data->ocd_connect_flags |= OBD_CONNECT_SOM;
#ifdef HAVE_LRU_RESIZE_SUPPORT
if (sbi->ll_flags & LL_SBI_LRU_RESIZE)
GOTO(out_md, err);
}
- err = obd_statfs(obd, &osfs, cfs_time_current_64() - CFS_HZ, 0);
+ err = obd_statfs(obd, &osfs,
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), 0);
if (err)
GOTO(out_md_fid, err);
OBD_CONNECT_SRVLOCK | OBD_CONNECT_TRUNCLOCK|
OBD_CONNECT_AT | OBD_CONNECT_RMT_CLIENT |
OBD_CONNECT_OSS_CAPA | OBD_CONNECT_VBR|
- OBD_CONNECT_SOM;
+ OBD_CONNECT_FULL20;
+
+ if (sbi->ll_flags & LL_SBI_SOM_PREVIEW)
+ data->ocd_connect_flags |= OBD_CONNECT_SOM;
if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) {
/* OBD_CONNECT_CKSUM should always be set, even if checksums are
CDEBUG(D_SUPER, "rootfid "DFID"\n", PFID(&sbi->ll_root_fid));
sb->s_op = &lustre_super_operations;
+#if THREAD_SIZE >= 8192
sb->s_export_op = &lustre_export_operations;
+#endif
/* make root inode
* XXX: move this to after cbd setup? */
*flags &= ~tmp;
goto next;
}
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2,5,50,0)
tmp = ll_set_opt("acl", s1, LL_SBI_ACL);
if (tmp) {
/* Ignore deprecated mount option. The client will
* always try to mount with ACL support, whether this
* is used depends on whether server supports it. */
+ LCONSOLE_ERROR_MSG(0x152, "Ignoring deprecated "
+ "mount option 'acl'.\n");
goto next;
}
tmp = ll_set_opt("noacl", s1, LL_SBI_ACL);
if (tmp) {
+ LCONSOLE_ERROR_MSG(0x152, "Ignoring deprecated "
+ "mount option 'noacl'.\n");
goto next;
}
+#else
+#warning "{no}acl options have been deprecated since 1.8, please remove them"
+#endif
tmp = ll_set_opt("remote_client", s1, LL_SBI_RMT_CLIENT);
if (tmp) {
*flags |= tmp;
*flags &= ~tmp;
goto next;
}
+ tmp = ll_set_opt("som_preview", s1, LL_SBI_SOM_PREVIEW);
+ if (tmp) {
+ *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);
lli->lli_rmtperm_utime = 0;
cfs_sema_init(&lli->lli_rmtperm_sem, 1);
CFS_INIT_LIST_HEAD(&lli->lli_oss_capas);
+ cfs_spin_lock_init(&lli->lli_sa_lock);
+ CFS_INIT_LIST_HEAD(&lli->lli_sa_dentry);
}
int ll_fill_super(struct super_block *sb)
GOTO(out_free, err);
}
+ /* Profile set with LCFG_MOUNTOPT so we can find our mdc and osc obds */
lprof = class_get_profile(profilenm);
if (lprof == NULL) {
LCONSOLE_ERROR_MSG(0x156, "The client profile '%s' could not be"
if (ia_valid & ATTR_SIZE)
attr->ia_valid |= ATTR_SIZE;
- if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MTIME_SET)) {
- /* mtime is set to past sending setattr op to osts under PW
- * 0:EOF extent lock (like truncate under PW new_size:EOF), if
- * mtime is not set to past setattr op is not sent to osts */
- if ((ia_valid & ATTR_SIZE) ||
- LTIME_S(attr->ia_mtime) < LTIME_S(attr->ia_ctime))
- rc = ll_setattr_ost(inode, attr);
- }
+ if ((ia_valid & ATTR_SIZE) ||
+ (ia_valid | ATTR_ATIME | ATTR_ATIME_SET) ||
+ (ia_valid | ATTR_MTIME | ATTR_MTIME_SET))
+ /* on truncate and utimes send attributes to osts, setting
+ * mtime/atime to past will be performed under PW 0:EOF extent
+ * lock (new_size:EOF for truncate)
+ * it may seem excessive to send mtime/atime updates to osts
+ * when not setting times to past, but it is necessary due to
+ * possible time de-synchronization */
+ rc = ll_setattr_ost(inode, attr);
EXIT;
out:
if (op_data) {
CDEBUG(D_VFSTRACE, "VFS Op: at "LPU64" jiffies\n", get_jiffies_64());
ll_stats_ops_tally(ll_s2sbi(sb), LPROC_LL_STAFS, 1);
- /* For now we will always get up-to-date statfs values, but in the
- * future we may allow some amount of caching on the client (e.g.
- * from QOS or lprocfs updates). */
- rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - 1, 0);
+ /* Some amount of caching on the client is allowed */
+ rc = ll_statfs_internal(sb, &osfs,
+ cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),
+ 0);
if (rc)
return rc;
/* Use old size assignment to avoid
* deadlock bz14138 & bz14326 */
inode->i_size = body->size;
+
+ CDEBUG(D_VFSTRACE, "inode=%lu, updating i_size %llu\n",
+ inode->i_ino, (unsigned long long)body->size);
}
if (body->valid & OBD_MD_FLBLOCKS)
}
oinfo.oi_oa->o_id = lsm->lsm_object_id;
- oinfo.oi_oa->o_gr = lsm->lsm_object_gr;
+ oinfo.oi_oa->o_seq = lsm->lsm_object_seq;
oinfo.oi_oa->o_flags = flags;
oinfo.oi_oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS |
OBD_MD_FLGROUP;
oinfo.oi_capa = ll_mdscapa_get(inode);
-
obdo_from_inode(oinfo.oi_oa, inode,
- OBD_MD_FLFID | OBD_MD_FLGENER);
+ &ll_i2info(inode)->lli_fid, 0);
rc = obd_setattr_rqset(sbi->ll_dt_exp, &oinfo, NULL);
capa_put(oinfo.oi_capa);
OBDO_FREE(oinfo.oi_oa);
if (sbi->ll_flags & LL_SBI_USER_XATTR)
seq_puts(seq, ",user_xattr");
- if (sbi->ll_flags & LL_SBI_ACL)
- seq_puts(seq, ",acl");
-
if (sbi->ll_flags & LL_SBI_LAZYSTATFS)
seq_puts(seq, ",lazystatfs");
RETURN(0);
}
+
+int ll_sync_fs(struct super_block *sb, int wait)
+{
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ int rc = 0;
+ ENTRY;
+
+ rc = obd_sync_fs(class_exp2obd(sbi->ll_dt_exp), NULL, wait);
+ if (rc)
+ CERROR("sync_fs fails: rc = %d\n", rc);
+
+ RETURN(rc);
+}