* of finding lock in the cache.
*/
if (state == CLS_HELD && lock->cll_state < CLS_HELD) {
- int rc;
-
- obj = slice->cls_obj;
- inode = ccc_object_inode(obj);
- attr = ccc_env_thread_attr(env);
-
- /* vmtruncate()->ll_truncate() first sets the i_size and then
- * the kms under both a DLM lock and the
- * ll_inode_size_lock(). If we don't get the
- * ll_inode_size_lock() here we can match the DLM lock and
- * reset i_size from the kms before the truncating path has
- * updated the kms. generic_file_write can then trust the
- * stale i_size when doing appending writes and effectively
- * cancel the result of the truncate. Getting the
- * ll_inode_size_lock() after the enqueue maintains the DLM
- * -> ll_inode_size_lock() acquiring order. */
+ int rc;
+
+ obj = slice->cls_obj;
+ inode = ccc_object_inode(obj);
+ attr = ccc_env_thread_attr(env);
+
+ /* vmtruncate() sets the i_size
+ * under both a DLM lock and the
+ * ll_inode_size_lock(). If we don't get the
+ * ll_inode_size_lock() here we can match the DLM lock and
+ * reset i_size. generic_file_write can then trust the
+ * stale i_size when doing appending writes and effectively
+ * cancel the result of the truncate. Getting the
+ * ll_inode_size_lock() after the enqueue maintains the DLM
+ * -> ll_inode_size_lock() acquiring order. */
ccc_object_size_lock(obj);
rc = cl_object_attr_get(env, obj, attr);
if (rc == 0) {
struct inode_operations ll_file_inode_operations = {
.setattr = ll_setattr,
- .truncate = ll_truncate,
.getattr = ll_getattr,
.permission = ll_inode_permission,
.setxattr = ll_setxattr,
/* three places where client capa is deleted:
* 1. capa_thread_main(), main place to delete expired capa.
* 2. ll_clear_inode_capas() in ll_clear_inode().
- * 3. ll_truncate_free_capa() delete truncate capa explicitly in ll_truncate().
+ * 3. ll_truncate_free_capa() delete truncate capa explicitly in ll_setattr_ost().
*/
static int capa_thread_main(void *unused)
{
void ll_removepage(struct page *page);
int ll_readpage(struct file *file, struct page *page);
void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras);
-void ll_truncate(struct inode *inode);
int ll_file_punch(struct inode *, loff_t, int);
ssize_t ll_file_lockless_io(struct file *, char *, size_t, loff_t *, int);
void ll_clear_file_contended(struct inode*);
int rc = 0, rc1 = 0;
ENTRY;
- CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu valid %x\n", inode->i_ino,
- attr->ia_valid);
+ CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu (%p) to %llu, valid %x\n",
+ inode->i_ino,
+ inode,i_size_read(inode),
+ attr->ia_valid);
if (ia_valid & ATTR_SIZE) {
/* Check new size against VFS/VM file size limit and rlimit */
#include "llite_internal.h"
#include <linux/lustre_compat25.h>
-/* this isn't where truncate starts. roughly:
- * sys_truncate->ll_setattr_raw->vmtruncate->ll_truncate. setattr_raw grabs
- * DLM lock on [size, EOF], i_mutex, ->lli_size_sem, and WRITE_I_ALLOC_SEM to
- * avoid races.
- *
- * must be called under ->lli_size_sem */
-void ll_truncate(struct inode *inode)
-{
- ENTRY;
-
- CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p) to %llu\n", inode->i_ino,
- inode->i_generation, inode, i_size_read(inode));
-
- EXIT;
- return;
-} /* ll_truncate */
-
/**
* Finalizes cl-data before exiting typical address_space operation. Dual to
* ll_cl_init().
{
int result;
/*
- * Only ll_inode_size_lock is taken at this level. lov_stripe_lock()
- * is grabbed by ll_truncate() only over call to obd_adjust_kms().
+ * Only ll_inode_size_lock is taken at this level.
*/
ll_inode_size_lock(inode);
result = vmtruncate(inode, size);
req->rq_oi.oi_oa->o_blocks;
}
- /* Do we need to update lvb_size here? It needn't because
- * it have been done in ll_truncate(). -jay */
lov_stripe_unlock(lsm);
}