Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
locks.c File Reference
#include <linux/ceph/ceph_debug.h>
#include <linux/file.h>
#include <linux/namei.h>
#include "super.h"
#include "mds_client.h"
#include <linux/ceph/pagelist.h>

Go to the source code of this file.

Functions

int ceph_lock (struct file *file, int cmd, struct file_lock *fl)
 
int ceph_flock (struct file *file, int cmd, struct file_lock *fl)
 
void ceph_count_locks (struct inode *inode, int *fcntl_count, int *flock_count)
 
int ceph_encode_locks (struct inode *inode, struct ceph_pagelist *pagelist, int num_fcntl_locks, int num_flock_locks)
 
int lock_to_ceph_filelock (struct file_lock *lock, struct ceph_filelock *cephlock)
 

Function Documentation

void ceph_count_locks ( struct inode inode,
int fcntl_count,
int flock_count 
)

Must be called with BKL already held. Fills in the passed counter variables, so you can prepare pagelist metadata before calling ceph_encode_locks.

Definition at line 176 of file locks.c.

int ceph_encode_locks ( struct inode inode,
struct ceph_pagelist pagelist,
int  num_fcntl_locks,
int  num_flock_locks 
)

Encode the flock and fcntl locks for the given inode into the pagelist. Format is: #fcntl locks, sequential fcntl locks, flock locks, sequential flock locks. Must be called with lock_flocks() already held. If we encounter more of a specific lock type than expected, we return the value 1.

Definition at line 201 of file locks.c.

int ceph_flock ( struct file file,
int  cmd,
struct file_lock fl 
)

Definition at line 130 of file locks.c.

int ceph_lock ( struct file file,
int  cmd,
struct file_lock fl 
)

Attempt to set an fcntl lock. For now, this just goes away to the server. Later it may be more awesome.

Definition at line 83 of file locks.c.

int lock_to_ceph_filelock ( struct file_lock lock,
struct ceph_filelock cephlock 
)

Definition at line 258 of file locks.c.