@@ -116,12 +116,10 @@ struct osc_device {
struct osc_stats {
u64 os_lockless_writes; /* by bytes */
u64 os_lockless_reads; /* by bytes */
- u64 os_lockless_truncates; /* by times */
} od_stats;
/* configuration item(s) */
time64_t od_contention_time;
- int od_lockless_truncate;
};
/* \defgroup osc osc
@@ -284,7 +284,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)
data->ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_NODEVOH |
OBD_CONNECT_ATTRFID | OBD_CONNECT_GRANT |
OBD_CONNECT_VERSION | OBD_CONNECT_BRW_SIZE |
- OBD_CONNECT_SRVLOCK | OBD_CONNECT_TRUNCLOCK|
+ OBD_CONNECT_SRVLOCK |
OBD_CONNECT_CANCELSET | OBD_CONNECT_FID |
OBD_CONNECT_AT | OBD_CONNECT_LOV_V3 |
OBD_CONNECT_VBR | OBD_CONNECT_FULL20 |
@@ -510,7 +510,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)
OBD_CONNECT_REQPORTAL | OBD_CONNECT_BRW_SIZE |
OBD_CONNECT_CANCELSET | OBD_CONNECT_FID |
OBD_CONNECT_SRVLOCK |
- OBD_CONNECT_TRUNCLOCK |
OBD_CONNECT_AT | OBD_CONNECT_OSS_CAPA |
OBD_CONNECT_VBR | OBD_CONNECT_FULL20 |
OBD_CONNECT_64BITHASH | OBD_CONNECT_MAXBYTES |
@@ -561,8 +561,6 @@ static int mdc_stats_seq_show(struct seq_file *seq, void *v)
stats->os_lockless_writes);
seq_printf(seq, "lockless_read_bytes\t\t%llu\n",
stats->os_lockless_reads);
- seq_printf(seq, "lockless_truncate\t\t%llu\n",
- stats->os_lockless_truncates);
return 0;
}
@@ -539,38 +539,6 @@ static ssize_t contention_seconds_store(struct kobject *kobj,
}
LUSTRE_RW_ATTR(contention_seconds);
-static ssize_t lockless_truncate_show(struct kobject *kobj,
- struct attribute *attr,
- char *buf)
-{
- struct obd_device *obd = container_of(kobj, struct obd_device,
- obd_kset.kobj);
- struct osc_device *od = obd2osc_dev(obd);
-
- return sprintf(buf, "%u\n", od->od_lockless_truncate);
-}
-
-static ssize_t lockless_truncate_store(struct kobject *kobj,
- struct attribute *attr,
- const char *buffer,
- size_t count)
-{
- struct obd_device *obd = container_of(kobj, struct obd_device,
- obd_kset.kobj);
- struct osc_device *od = obd2osc_dev(obd);
- bool val;
- int rc;
-
- rc = kstrtobool(buffer, &val);
- if (rc)
- return rc;
-
- od->od_lockless_truncate = val;
-
- return count;
-}
-LUSTRE_RW_ATTR(lockless_truncate);
-
static ssize_t destroys_in_flight_show(struct kobject *kobj,
struct attribute *attr,
char *buf)
@@ -890,8 +858,6 @@ static int osc_stats_seq_show(struct seq_file *seq, void *v)
stats->os_lockless_writes);
seq_printf(seq, "lockless_read_bytes\t\t%llu\n",
stats->os_lockless_reads);
- seq_printf(seq, "lockless_truncate\t\t%llu\n",
- stats->os_lockless_truncates);
return 0;
}
@@ -928,7 +894,6 @@ void lproc_osc_attach_seqstat(struct obd_device *obd)
&lustre_attr_cur_dirty_grant_bytes.attr,
&lustre_attr_destroys_in_flight.attr,
&lustre_attr_grant_shrink_interval.attr,
- &lustre_attr_lockless_truncate.attr,
&lustre_attr_max_dirty_mb.attr,
&lustre_attr_max_pages_per_rpc.attr,
&lustre_attr_max_rpcs_in_flight.attr,
@@ -703,16 +703,6 @@ void osc_io_setattr_end(const struct lu_env *env,
result = cbargs->opc_rc;
io->ci_result = cbargs->opc_rc;
}
- if (result == 0) {
- if (oio->oi_lockless) {
- /* lockless truncate */
- struct osc_device *osc = lu2osc_dev(obj->co_lu.lo_dev);
-
- LASSERT(cl_io_is_trunc(io) || cl_io_is_fallocate(io));
- /* XXX: Need a lock. */
- osc->od_stats.os_lockless_truncates++;
- }
- }
if (cl_io_is_trunc(io)) {
u64 size = io->u.ci_setattr.sa_attr.lvb_size;
@@ -800,7 +800,6 @@ void osc_lock_to_lockless(const struct lu_env *env,
struct cl_io *io = oio->oi_cl.cis_io;
struct cl_object *obj = slice->cls_obj;
struct osc_object *oob = cl2osc(obj);
- const struct osc_device *osd = lu2osc_dev(obj->co_lu.lo_dev);
struct obd_connect_data *ocd;
LASSERT(ols->ols_state == OLS_NEW ||
@@ -821,10 +820,7 @@ void osc_lock_to_lockless(const struct lu_env *env,
OBD_CONNECT_SRVLOCK);
if (io->ci_lockreq == CILR_NEVER ||
/* lockless IO */
- (ols->ols_locklessable && osc_object_is_contended(oob)) ||
- /* lockless truncate */
- (cl_io_is_trunc(io) && osd->od_lockless_truncate &&
- (ocd->ocd_connect_flags & OBD_CONNECT_TRUNCLOCK))) {
+ (ols->ols_locklessable && osc_object_is_contended(oob))) {
ols->ols_locklessable = 1;
slice->cls_ops = ols->ols_lockless_ops;
}
@@ -1108,8 +1108,6 @@ void lustre_assert_wire_constants(void)
OBD_CONNECT_XATTR);
LASSERTF(OBD_CONNECT_LARGE_ACL == 0x200ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_LARGE_ACL);
- LASSERTF(OBD_CONNECT_TRUNCLOCK == 0x400ULL, "found 0x%.16llxULL\n",
- OBD_CONNECT_TRUNCLOCK);
LASSERTF(OBD_CONNECT_TRANSNO == 0x800ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_TRANSNO);
LASSERTF(OBD_CONNECT_IBITS == 0x1000ULL, "found 0x%.16llxULL\n",
@@ -719,7 +719,6 @@ struct ptlrpc_body_v2 {
#define OBD_CONNECT_ACL 0x80ULL /*access control lists */
#define OBD_CONNECT_XATTR 0x100ULL /*client use extended attr */
#define OBD_CONNECT_LARGE_ACL 0x200ULL /* more than 32 ACL entries */
-#define OBD_CONNECT_TRUNCLOCK 0x400ULL /*locks on server for punch */
#define OBD_CONNECT_TRANSNO 0x800ULL /*replay sends init transno */
#define OBD_CONNECT_IBITS 0x1000ULL /* not checked in 2.11+ */
#define OBD_CONNECT_JOIN 0x2000ULL /*files can be concatenated.