Merge tag 'locks-v4.4-1' of git://git.samba.org/jlayton/linux
[firefly-linux-kernel-4.4.55.git] / drivers / staging / lustre / lustre / llite / file.c
index ad02f2b9e590879cd22a3f95956a8acbb4d85f30..02f27593013e3650e16bd22b511084755b2dc519 100644 (file)
@@ -64,7 +64,7 @@ static struct ll_file_data *ll_file_data_get(void)
 {
        struct ll_file_data *fd;
 
-       OBD_SLAB_ALLOC_PTR_GFP(fd, ll_file_data_slab, GFP_NOFS);
+       fd = kmem_cache_alloc(ll_file_data_slab, GFP_NOFS | __GFP_ZERO);
        if (fd == NULL)
                return NULL;
        fd->fd_write_failed = false;
@@ -74,7 +74,7 @@ static struct ll_file_data *ll_file_data_get(void)
 static void ll_file_data_put(struct ll_file_data *fd)
 {
        if (fd != NULL)
-               OBD_SLAB_FREE_PTR(fd, ll_file_data_slab);
+               kmem_cache_free(ll_file_data_slab, fd);
 }
 
 void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
@@ -1260,7 +1260,7 @@ static int ll_lov_recreate(struct inode *inode, struct ost_id *oi, u32 ost_idx)
        int rc = 0;
        struct lov_stripe_md *lsm = NULL, *lsm2;
 
-       OBDO_ALLOC(oa);
+       oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO);
        if (oa == NULL)
                return -ENOMEM;
 
@@ -1295,7 +1295,7 @@ static int ll_lov_recreate(struct inode *inode, struct ost_id *oi, u32 ost_idx)
        goto out;
 out:
        ccc_inode_lsm_put(inode, lsm);
-       OBDO_FREE(oa);
+       kmem_cache_free(obdo_cachep, oa);
        return rc;
 }
 
@@ -2750,13 +2750,9 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
        rc = md_enqueue(sbi->ll_md_exp, &einfo, NULL,
                        op_data, &lockh, &flock, 0, NULL /* req */, flags);
 
-       if ((file_lock->fl_flags & FL_FLOCK) &&
-           (rc == 0 || file_lock->fl_type == F_UNLCK))
-               rc2  = flock_lock_file_wait(file, file_lock);
-       if ((file_lock->fl_flags & FL_POSIX) &&
-           (rc == 0 || file_lock->fl_type == F_UNLCK) &&
+       if ((rc == 0 || file_lock->fl_type == F_UNLCK) &&
            !(flags & LDLM_FL_TEST_LOCK))
-               rc2  = posix_lock_file_wait(file, file_lock);
+               rc2  = locks_lock_file_wait(file, file_lock);
 
        if (rc2 && file_lock->fl_type != F_UNLCK) {
                einfo.ei_mode = LCK_NL;