2 * (C) 2001 Clemson University and The University of Chicago
4 * See COPYING in top-level directory.
8 * Linux VFS file operations.
12 #include "pvfs2-kernel.h"
13 #include "pvfs2-bufmap.h"
15 #include <linux/pagemap.h>
17 #define wake_up_daemon_for_return(op) \
19 spin_lock(&op->lock); \
20 op->io_completed = 1; \
21 spin_unlock(&op->lock); \
22 wake_up_interruptible(&op->io_completion_waitq);\
26 * Copy to client-core's address space from the buffers specified
27 * by the iovec upto total_size bytes.
28 * NOTE: the iovector can either contain addresses which
29 * can futher be kernel-space or user-space addresses.
30 * or it can pointers to struct page's
32 static int precopy_buffers(struct pvfs2_bufmap *bufmap,
34 struct iov_iter *iter,
39 * copy data from application/kernel by pulling it out
45 ret = pvfs_bufmap_copy_from_iovec(bufmap,
50 gossip_err("%s: Failed to copy-in buffers. Please make sure that the pvfs2-client is running. %ld\n",
56 gossip_err("%s: Failed to copy-in buffers. Please make sure that the pvfs2-client is running. %ld\n",
63 * Copy from client-core's address space to the buffers specified
64 * by the iovec upto total_size bytes.
65 * NOTE: the iovector can either contain addresses which
66 * can futher be kernel-space or user-space addresses.
67 * or it can pointers to struct page's
69 static int postcopy_buffers(struct pvfs2_bufmap *bufmap,
71 struct iov_iter *iter,
76 * copy data to application/kernel by pushing it out to
77 * the iovec. NOTE; target buffers can be addresses or
78 * struct page pointers.
81 ret = pvfs_bufmap_copy_to_iovec(bufmap,
86 gossip_err("%s: Failed to copy-out buffers. Please make sure that the pvfs2-client is running (%ld)\n",
94 * Post and wait for the I/O upcall to finish
96 static ssize_t wait_for_direct_io(enum PVFS_io_type type, struct inode *inode,
97 loff_t *offset, struct iovec *vec, unsigned long nr_segs,
98 size_t total_size, loff_t readahead_size)
100 struct pvfs2_inode_s *pvfs2_inode = PVFS2_I(inode);
101 struct pvfs2_khandle *handle = &pvfs2_inode->refn.khandle;
102 struct pvfs2_bufmap *bufmap = NULL;
103 struct pvfs2_kernel_op_s *new_op = NULL;
104 int buffer_index = -1;
107 new_op = op_alloc(PVFS2_VFS_OP_FILE_IO);
112 /* synchronous I/O */
113 new_op->upcall.req.io.async_vfs_io = PVFS_VFS_SYNC_IO;
114 new_op->upcall.req.io.readahead_size = readahead_size;
115 new_op->upcall.req.io.io_type = type;
116 new_op->upcall.req.io.refn = pvfs2_inode->refn;
118 populate_shared_memory:
119 /* get a shared buffer index */
120 ret = pvfs_bufmap_get(&bufmap, &buffer_index);
122 gossip_debug(GOSSIP_FILE_DEBUG,
123 "%s: pvfs_bufmap_get failure (%ld)\n",
124 __func__, (long)ret);
127 gossip_debug(GOSSIP_FILE_DEBUG,
128 "%s(%pU): GET op %p -> buffer_index %d\n",
134 new_op->uses_shared_memory = 1;
135 new_op->upcall.req.io.buf_index = buffer_index;
136 new_op->upcall.req.io.count = total_size;
137 new_op->upcall.req.io.offset = *offset;
139 gossip_debug(GOSSIP_FILE_DEBUG,
140 "%s(%pU): nr_segs %lu, offset: %llu total_size: %zd\n",
147 * Stage 1: copy the buffers into client-core's address space
148 * precopy_buffers only pertains to writes.
150 if (type == PVFS_IO_WRITE) {
151 struct iov_iter iter;
152 iov_iter_init(&iter, WRITE, vec, nr_segs, total_size);
153 ret = precopy_buffers(bufmap,
161 gossip_debug(GOSSIP_FILE_DEBUG,
162 "%s(%pU): Calling post_io_request with tag (%llu)\n",
167 /* Stage 2: Service the I/O operation */
168 ret = service_operation(new_op,
169 type == PVFS_IO_WRITE ?
172 get_interruptible_flag(inode));
175 * If service_operation() returns -EAGAIN #and# the operation was
176 * purged from pvfs2_request_list or htable_ops_in_progress, then
177 * we know that the client was restarted, causing the shared memory
178 * area to be wiped clean. To restart a write operation in this
179 * case, we must re-copy the data from the user's iovec to a NEW
180 * shared memory location. To restart a read operation, we must get
181 * a new shared memory location.
183 if (ret == -EAGAIN && op_state_purged(new_op)) {
184 pvfs_bufmap_put(bufmap, buffer_index);
185 gossip_debug(GOSSIP_FILE_DEBUG,
186 "%s:going to repopulate_shared_memory.\n",
188 goto populate_shared_memory;
192 handle_io_error(); /* defined in pvfs2-kernel.h */
194 * don't write an error to syslog on signaled operation
195 * termination unless we've got debugging turned on, as
196 * this can happen regularly (i.e. ctrl-c)
199 gossip_debug(GOSSIP_FILE_DEBUG,
200 "%s: returning error %ld\n", __func__,
203 gossip_err("%s: error in %s handle %pU, returning %zd\n",
205 type == PVFS_IO_READ ?
206 "read from" : "write to",
212 * Stage 3: Post copy buffers from client-core's address space
213 * postcopy_buffers only pertains to reads.
215 if (type == PVFS_IO_READ) {
216 struct iov_iter iter;
217 iov_iter_init(&iter, READ, vec, nr_segs, new_op->downcall.resp.io.amt_complete);
218 ret = postcopy_buffers(bufmap,
221 new_op->downcall.resp.io.amt_complete);
224 * put error codes in downcall so that handle_io_error()
225 * preserves it properly
227 new_op->downcall.status = ret;
232 gossip_debug(GOSSIP_FILE_DEBUG,
233 "%s(%pU): Amount written as returned by the sys-io call:%d\n",
236 (int)new_op->downcall.resp.io.amt_complete);
238 ret = new_op->downcall.resp.io.amt_complete;
241 * tell the device file owner waiting on I/O that this read has
242 * completed and it can return now. in this exact case, on
243 * wakeup the daemon will free the op, so we *cannot* touch it
246 wake_up_daemon_for_return(new_op);
250 if (buffer_index >= 0) {
251 pvfs_bufmap_put(bufmap, buffer_index);
252 gossip_debug(GOSSIP_FILE_DEBUG,
253 "%s(%pU): PUT buffer_index %d\n",
254 __func__, handle, buffer_index);
265 * The reason we need to do this is to be able to support readv and writev
266 * that are larger than (pvfs_bufmap_size_query()) Default is
267 * PVFS2_BUFMAP_DEFAULT_DESC_SIZE MB. What that means is that we will
268 * create a new io vec descriptor for those memory addresses that
269 * go beyond the limit. Return value for this routine is negative in case
270 * of errors and 0 in case of success.
272 * Further, the new_nr_segs pointer is updated to hold the new value
273 * of number of iovecs, the new_vec pointer is updated to hold the pointer
274 * to the new split iovec, and the size array is an array of integers holding
275 * the number of iovecs that straddle pvfs_bufmap_size_query().
276 * The max_new_nr_segs value is computed by the caller and returned.
277 * (It will be (count of all iov_len/ block_size) + 1).
279 static int split_iovecs(unsigned long max_new_nr_segs, /* IN */
280 unsigned long nr_segs, /* IN */
281 const struct iovec *original_iovec, /* IN */
282 unsigned long *new_nr_segs, /* OUT */
283 struct iovec **new_vec, /* OUT */
284 unsigned long *seg_count, /* OUT */
285 unsigned long **seg_array) /* OUT */
288 unsigned long count = 0;
289 unsigned long begin_seg;
290 unsigned long tmpnew_nr_segs = 0;
291 struct iovec *new_iovec = NULL;
292 struct iovec *orig_iovec;
293 unsigned long *sizes = NULL;
294 unsigned long sizes_count = 0;
297 original_iovec == NULL ||
298 new_nr_segs == NULL ||
302 max_new_nr_segs <= 0) {
303 gossip_err("Invalid parameters to split_iovecs\n");
310 /* copy the passed in iovec descriptor to a temp structure */
311 orig_iovec = kmalloc_array(nr_segs,
313 PVFS2_BUFMAP_GFP_FLAGS);
314 if (orig_iovec == NULL) {
316 "split_iovecs: Could not allocate memory for %lu bytes!\n",
317 (unsigned long)(nr_segs * sizeof(*orig_iovec)));
320 new_iovec = kcalloc(max_new_nr_segs,
322 PVFS2_BUFMAP_GFP_FLAGS);
323 if (new_iovec == NULL) {
326 "split_iovecs: Could not allocate memory for %lu bytes!\n",
327 (unsigned long)(max_new_nr_segs * sizeof(*new_iovec)));
330 sizes = kcalloc(max_new_nr_segs,
332 PVFS2_BUFMAP_GFP_FLAGS);
337 "split_iovecs: Could not allocate memory for %lu bytes!\n",
338 (unsigned long)(max_new_nr_segs * sizeof(*sizes)));
341 /* copy the passed in iovec to a temp structure */
342 memcpy(orig_iovec, original_iovec, nr_segs * sizeof(*orig_iovec));
345 for (seg = begin_seg; seg < nr_segs; seg++) {
346 if (tmpnew_nr_segs >= max_new_nr_segs ||
347 sizes_count >= max_new_nr_segs) {
352 ("split_iovecs: exceeded the index limit (%lu)\n",
356 if (count + orig_iovec[seg].iov_len <
357 pvfs_bufmap_size_query()) {
358 count += orig_iovec[seg].iov_len;
359 memcpy(&new_iovec[tmpnew_nr_segs],
363 sizes[sizes_count]++;
365 new_iovec[tmpnew_nr_segs].iov_base =
366 orig_iovec[seg].iov_base;
367 new_iovec[tmpnew_nr_segs].iov_len =
368 (pvfs_bufmap_size_query() - count);
370 sizes[sizes_count]++;
373 orig_iovec[seg].iov_base +=
374 (pvfs_bufmap_size_query() - count);
375 orig_iovec[seg].iov_len -=
376 (pvfs_bufmap_size_query() - count);
386 *new_nr_segs = tmpnew_nr_segs;
387 /* new_iovec is freed by the caller */
388 *new_vec = new_iovec;
389 *seg_count = sizes_count;
390 /* seg_array is also freed by the caller */
396 static long bound_max_iovecs(const struct iovec *curr, unsigned long nr_segs,
397 ssize_t *total_count)
407 for (i = 0; i < nr_segs; i++) {
408 const struct iovec *iv = &curr[i];
410 count += iv->iov_len;
411 if (unlikely((ssize_t) (count | iv->iov_len) < 0))
413 if (total + iv->iov_len < pvfs_bufmap_size_query()) {
414 total += iv->iov_len;
418 (total + iv->iov_len - pvfs_bufmap_size_query());
419 max_nr_iovecs += (total / pvfs_bufmap_size_query() + 2);
422 *total_count = count;
423 return max_nr_iovecs;
427 * Common entry point for read/write/readv/writev
428 * This function will dispatch it to either the direct I/O
429 * or buffered I/O path depending on the mount options and/or
430 * augmented/extended metadata attached to the file.
431 * Note: File extended attributes override any mount options.
433 static ssize_t do_readv_writev(enum PVFS_io_type type, struct file *file,
434 loff_t *offset, const struct iovec *iov, unsigned long nr_segs)
436 struct inode *inode = file->f_mapping->host;
437 struct pvfs2_inode_s *pvfs2_inode = PVFS2_I(inode);
438 struct pvfs2_khandle *handle = &pvfs2_inode->refn.khandle;
441 unsigned int to_free;
444 unsigned long new_nr_segs;
445 unsigned long max_new_nr_segs;
446 unsigned long seg_count;
447 unsigned long *seg_array;
448 struct iovec *iovecptr;
456 /* Compute total and max number of segments after split */
457 max_new_nr_segs = bound_max_iovecs(iov, nr_segs, &count);
459 gossip_debug(GOSSIP_FILE_DEBUG,
460 "%s-BEGIN(%pU): count(%d) after estimate_max_iovecs.\n",
465 if (type == PVFS_IO_WRITE) {
466 gossip_debug(GOSSIP_FILE_DEBUG,
467 "%s(%pU): proceeding with offset : %llu, "
481 * if the total size of data transfer requested is greater than
482 * the kernel-set blocksize of PVFS2, then we split the iovecs
483 * such that no iovec description straddles a block size limit
486 gossip_debug(GOSSIP_FILE_DEBUG,
487 "%s: pvfs_bufmap_size:%d\n",
489 pvfs_bufmap_size_query());
491 if (count > pvfs_bufmap_size_query()) {
493 * Split up the given iovec description such that
494 * no iovec descriptor straddles over the block-size limitation.
495 * This makes us our job easier to stage the I/O.
496 * In addition, this function will also compute an array
497 * with seg_count entries that will store the number of
498 * segments that straddle the block-size boundaries.
500 ret = split_iovecs(max_new_nr_segs, /* IN */
503 &new_nr_segs, /* OUT */
505 &seg_count, /* OUT */
506 &seg_array); /* OUT */
508 gossip_err("%s: Failed to split iovecs to satisfy larger than blocksize readv/writev request %zd\n",
513 gossip_debug(GOSSIP_FILE_DEBUG,
514 "%s: Splitting iovecs from %lu to %lu"
520 /* We must free seg_array and iovecptr */
523 new_nr_segs = nr_segs;
524 /* use the given iovec description */
525 iovecptr = (struct iovec *)iov;
526 /* There is only 1 element in the seg_array */
528 /* and its value is the number of segments passed in */
529 seg_array = &nr_segs;
530 /* We dont have to free up anything */
535 gossip_debug(GOSSIP_FILE_DEBUG,
536 "%s(%pU) %zd@%llu\n",
541 gossip_debug(GOSSIP_FILE_DEBUG,
542 "%s(%pU): new_nr_segs: %lu, seg_count: %lu\n",
545 new_nr_segs, seg_count);
547 /* PVFS2_KERNEL_DEBUG is a CFLAGS define. */
548 #ifdef PVFS2_KERNEL_DEBUG
549 for (seg = 0; seg < new_nr_segs; seg++)
550 gossip_debug(GOSSIP_FILE_DEBUG,
551 "%s: %d) %p to %p [%d bytes]\n",
554 iovecptr[seg].iov_base,
555 iovecptr[seg].iov_base + iovecptr[seg].iov_len,
556 (int)iovecptr[seg].iov_len);
557 for (seg = 0; seg < seg_count; seg++)
558 gossip_debug(GOSSIP_FILE_DEBUG,
565 while (total_count < count) {
569 /* how much to transfer in this loop iteration */
571 (((count - total_count) > pvfs_bufmap_size_query()) ?
572 pvfs_bufmap_size_query() :
573 (count - total_count));
575 gossip_debug(GOSSIP_FILE_DEBUG,
576 "%s(%pU): size of each_count(%d)\n",
580 gossip_debug(GOSSIP_FILE_DEBUG,
581 "%s(%pU): BEFORE wait_for_io: offset is %d\n",
586 ret = wait_for_direct_io(type, inode, offset, ptr,
587 seg_array[seg], each_count, 0);
588 gossip_debug(GOSSIP_FILE_DEBUG,
589 "%s(%pU): return from wait_for_io:%d\n",
597 /* advance the iovec pointer */
598 ptr += seg_array[seg];
604 gossip_debug(GOSSIP_FILE_DEBUG,
605 "%s(%pU): AFTER wait_for_io: offset is %d\n",
611 * if we got a short I/O operations,
612 * fall out and return what we got so far
614 if (amt_complete < each_count)
626 if (type == PVFS_IO_READ) {
629 SetMtimeFlag(pvfs2_inode);
630 inode->i_mtime = CURRENT_TIME;
631 mark_inode_dirty_sync(inode);
635 gossip_debug(GOSSIP_FILE_DEBUG,
636 "%s(%pU): Value(%d) returned.\n",
645 * Read data from a specified offset in a file (referenced by inode).
646 * Data may be placed either in a user or kernel buffer.
648 ssize_t pvfs2_inode_read(struct inode *inode,
652 loff_t readahead_size)
654 struct pvfs2_inode_s *pvfs2_inode = PVFS2_I(inode);
657 ssize_t ret = -EINVAL;
659 g_pvfs2_stats.reads++;
664 bufmap_size = pvfs_bufmap_size_query();
665 if (count > bufmap_size) {
666 gossip_debug(GOSSIP_FILE_DEBUG,
667 "%s: count is too large (%zd/%zd)!\n",
668 __func__, count, bufmap_size);
672 gossip_debug(GOSSIP_FILE_DEBUG,
673 "%s(%pU) %zd@%llu\n",
675 &pvfs2_inode->refn.khandle,
679 ret = wait_for_direct_io(PVFS_IO_READ, inode, offset, &vec, 1,
680 count, readahead_size);
684 gossip_debug(GOSSIP_FILE_DEBUG,
685 "%s(%pU): Value(%zd) returned.\n",
687 &pvfs2_inode->refn.khandle,
693 static ssize_t pvfs2_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
695 struct file *file = iocb->ki_filp;
696 loff_t pos = *(&iocb->ki_pos);
698 unsigned long nr_segs = iter->nr_segs;
700 BUG_ON(iocb->private);
702 gossip_debug(GOSSIP_FILE_DEBUG, "pvfs2_file_read_iter\n");
704 g_pvfs2_stats.reads++;
706 rc = do_readv_writev(PVFS_IO_READ,
716 static ssize_t pvfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *iter)
718 struct file *file = iocb->ki_filp;
719 loff_t pos = *(&iocb->ki_pos);
720 unsigned long nr_segs = iter->nr_segs;
723 BUG_ON(iocb->private);
725 gossip_debug(GOSSIP_FILE_DEBUG, "pvfs2_file_write_iter\n");
727 mutex_lock(&file->f_mapping->host->i_mutex);
729 /* Make sure generic_write_checks sees an up to date inode size. */
730 if (file->f_flags & O_APPEND) {
731 rc = pvfs2_inode_getattr(file->f_mapping->host,
734 gossip_err("%s: pvfs2_inode_getattr failed, rc:%zd:.\n",
740 if (file->f_pos > i_size_read(file->f_mapping->host))
741 pvfs2_i_size_write(file->f_mapping->host, file->f_pos);
743 rc = generic_write_checks(iocb, iter);
746 gossip_err("%s: generic_write_checks failed, rc:%zd:.\n",
751 rc = do_readv_writev(PVFS_IO_WRITE,
757 gossip_err("%s: do_readv_writev failed, rc:%zd:.\n",
763 g_pvfs2_stats.writes++;
767 mutex_unlock(&file->f_mapping->host->i_mutex);
772 * Perform a miscellaneous operation on a file.
774 static long pvfs2_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
780 gossip_debug(GOSSIP_FILE_DEBUG,
781 "pvfs2_ioctl: called with cmd %d\n",
785 * we understand some general ioctls on files, such as the immutable
788 if (cmd == FS_IOC_GETFLAGS) {
790 ret = pvfs2_xattr_get_default(file->f_path.dentry,
791 "user.pvfs2.meta_hint",
795 if (ret < 0 && ret != -ENODATA)
797 else if (ret == -ENODATA)
800 gossip_debug(GOSSIP_FILE_DEBUG,
801 "pvfs2_ioctl: FS_IOC_GETFLAGS: %llu\n",
802 (unsigned long long)uval);
803 return put_user(uval, (int __user *)arg);
804 } else if (cmd == FS_IOC_SETFLAGS) {
806 if (get_user(uval, (int __user *)arg))
809 * PVFS_MIRROR_FL is set internally when the mirroring mode
810 * is turned on for a file. The user is not allowed to turn
811 * on this bit, but the bit is present if the user first gets
812 * the flags and then updates the flags with some new
813 * settings. So, we ignore it in the following edit. bligon.
815 if ((uval & ~PVFS_MIRROR_FL) &
816 (~(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_NOATIME_FL))) {
817 gossip_err("pvfs2_ioctl: the FS_IOC_SETFLAGS only supports setting one of FS_IMMUTABLE_FL|FS_APPEND_FL|FS_NOATIME_FL\n");
821 gossip_debug(GOSSIP_FILE_DEBUG,
822 "pvfs2_ioctl: FS_IOC_SETFLAGS: %llu\n",
823 (unsigned long long)val);
824 ret = pvfs2_xattr_set_default(file->f_path.dentry,
825 "user.pvfs2.meta_hint",
836 * Memory map a region of a file.
838 static int pvfs2_file_mmap(struct file *file, struct vm_area_struct *vma)
840 gossip_debug(GOSSIP_FILE_DEBUG,
841 "pvfs2_file_mmap: called on %s\n",
843 (char *)file->f_path.dentry->d_name.name :
846 /* set the sequential readahead hint */
847 vma->vm_flags |= VM_SEQ_READ;
848 vma->vm_flags &= ~VM_RAND_READ;
850 /* Use readonly mmap since we cannot support writable maps. */
851 return generic_file_readonly_mmap(file, vma);
854 #define mapping_nrpages(idata) ((idata)->nrpages)
857 * Called to notify the module that there are no more references to
858 * this file (i.e. no processes have it open).
860 * \note Not called when each file is closed.
862 static int pvfs2_file_release(struct inode *inode, struct file *file)
864 gossip_debug(GOSSIP_FILE_DEBUG,
865 "pvfs2_file_release: called on %s\n",
866 file->f_path.dentry->d_name.name);
868 pvfs2_flush_inode(inode);
871 * remove all associated inode pages from the page cache and mmap
872 * readahead cache (if any); this forces an expensive refresh of
873 * data for the next caller of mmap (or 'get_block' accesses)
875 if (file->f_path.dentry->d_inode &&
876 file->f_path.dentry->d_inode->i_mapping &&
877 mapping_nrpages(&file->f_path.dentry->d_inode->i_data))
878 truncate_inode_pages(file->f_path.dentry->d_inode->i_mapping,
884 * Push all data for a specific file onto permanent storage.
886 static int pvfs2_fsync(struct file *file,
892 struct pvfs2_inode_s *pvfs2_inode =
893 PVFS2_I(file->f_path.dentry->d_inode);
894 struct pvfs2_kernel_op_s *new_op = NULL;
897 filemap_write_and_wait_range(file->f_mapping, start, end);
899 new_op = op_alloc(PVFS2_VFS_OP_FSYNC);
902 new_op->upcall.req.fsync.refn = pvfs2_inode->refn;
904 ret = service_operation(new_op,
906 get_interruptible_flag(file->f_path.dentry->d_inode));
908 gossip_debug(GOSSIP_FILE_DEBUG,
909 "pvfs2_fsync got return value of %d\n",
914 pvfs2_flush_inode(file->f_path.dentry->d_inode);
919 * Change the file pointer position for an instance of an open file.
921 * \note If .llseek is overriden, we must acquire lock as described in
922 * Documentation/filesystems/Locking.
924 * Future upgrade could support SEEK_DATA and SEEK_HOLE but would
925 * require much changes to the FS
927 static loff_t pvfs2_file_llseek(struct file *file, loff_t offset, int origin)
930 struct inode *inode = file->f_path.dentry->d_inode;
933 gossip_err("pvfs2_file_llseek: invalid inode (NULL)\n");
937 if (origin == PVFS2_SEEK_END) {
939 * revalidate the inode's file size.
940 * NOTE: We are only interested in file size here,
941 * so we set mask accordingly.
943 ret = pvfs2_inode_getattr(inode, PVFS_ATTR_SYS_SIZE);
945 gossip_debug(GOSSIP_FILE_DEBUG,
946 "%s:%s:%d calling make bad inode\n",
950 pvfs2_make_bad_inode(inode);
955 gossip_debug(GOSSIP_FILE_DEBUG,
956 "pvfs2_file_llseek: offset is %ld | origin is %d"
957 " | inode size is %lu\n",
960 (unsigned long)file->f_path.dentry->d_inode->i_size);
962 return generic_file_llseek(file, offset, origin);
966 * Support local locks (locks that only this kernel knows about)
967 * if Orangefs was mounted -o local_lock.
969 static int pvfs2_lock(struct file *filp, int cmd, struct file_lock *fl)
973 if (PVFS2_SB(filp->f_inode->i_sb)->flags & PVFS2_OPT_LOCAL_LOCK) {
974 if (cmd == F_GETLK) {
976 posix_test_lock(filp, fl);
978 rc = posix_lock_file(filp, fl, NULL);
985 /** PVFS2 implementation of VFS file operations */
986 const struct file_operations pvfs2_file_operations = {
987 .llseek = pvfs2_file_llseek,
988 .read_iter = pvfs2_file_read_iter,
989 .write_iter = pvfs2_file_write_iter,
991 .unlocked_ioctl = pvfs2_ioctl,
992 .mmap = pvfs2_file_mmap,
993 .open = generic_file_open,
994 .release = pvfs2_file_release,
995 .fsync = pvfs2_fsync,