@@ -209,11 +209,40 @@ static ssize_t stable_pages_required_show(struct device *dev,
209
209
}
210
210
static DEVICE_ATTR_RO (stable_pages_required );
211
211
212
+ static ssize_t strict_limit_store (struct device * dev ,
213
+ struct device_attribute * attr , const char * buf , size_t count )
214
+ {
215
+ struct backing_dev_info * bdi = dev_get_drvdata (dev );
216
+ unsigned int strict_limit ;
217
+ ssize_t ret ;
218
+
219
+ ret = kstrtouint (buf , 10 , & strict_limit );
220
+ if (ret < 0 )
221
+ return ret ;
222
+
223
+ ret = bdi_set_strict_limit (bdi , strict_limit );
224
+ if (!ret )
225
+ ret = count ;
226
+
227
+ return ret ;
228
+ }
229
+
230
+ static ssize_t strict_limit_show (struct device * dev ,
231
+ struct device_attribute * attr , char * buf )
232
+ {
233
+ struct backing_dev_info * bdi = dev_get_drvdata (dev );
234
+
235
+ return sysfs_emit (buf , "%d\n" ,
236
+ !!(bdi -> capabilities & BDI_CAP_STRICTLIMIT ));
237
+ }
238
+ static DEVICE_ATTR_RW (strict_limit );
239
+
212
240
static struct attribute * bdi_dev_attrs [] = {
213
241
& dev_attr_read_ahead_kb .attr ,
214
242
& dev_attr_min_ratio .attr ,
215
243
& dev_attr_max_ratio .attr ,
216
244
& dev_attr_stable_pages_required .attr ,
245
+ & dev_attr_strict_limit .attr ,
217
246
NULL ,
218
247
};
219
248
ATTRIBUTE_GROUPS (bdi_dev );
0 commit comments