2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License v.2.
10 #include <linux/sched.h>
11 #include <linux/slab.h>
12 #include <linux/spinlock.h>
13 #include <linux/completion.h>
14 #include <linux/buffer_head.h>
15 #include <linux/pagemap.h>
16 #include <linux/uio.h>
17 #include <linux/blkdev.h>
19 #include <linux/smp_lock.h>
20 #include <linux/gfs2_ioctl.h>
22 #include <asm/semaphore.h>
23 #include <asm/uaccess.h>
40 /* "bad" is for NFS support */
41 struct filldir_bad_entry {
43 unsigned int fbe_length;
45 struct gfs2_inum fbe_inum;
46 unsigned int fbe_type;
50 struct gfs2_sbd *fdb_sbd;
52 struct filldir_bad_entry *fdb_entry;
53 unsigned int fdb_entry_num;
54 unsigned int fdb_entry_off;
57 unsigned int fdb_name_size;
58 unsigned int fdb_name_off;
61 /* For regular, non-NFS */
63 struct gfs2_sbd *fdr_sbd;
66 filldir_t fdr_filldir;
70 static int gfs2_read_actor(read_descriptor_t *desc, struct page *page,
71 unsigned long offset, unsigned long size)
74 unsigned long count = desc->count;
80 memcpy(desc->arg.buf, kaddr + offset, size);
83 desc->count = count - size;
84 desc->written += size;
85 desc->arg.buf += size;
89 int gfs2_internal_read(struct gfs2_inode *ip, struct file_ra_state *ra_state,
90 char *buf, loff_t *pos, unsigned size)
92 struct inode *inode = ip->i_vnode;
93 read_descriptor_t desc;
98 do_generic_mapping_read(inode->i_mapping, ra_state, NULL, pos, &desc, gfs2_read_actor);
99 return desc.written ? desc.written : desc.error;
103 * gfs2_llseek - seek to a location in a file
105 * @offset: the offset
106 * @origin: Where to seek from (SEEK_SET, SEEK_CUR, or SEEK_END)
108 * SEEK_END requires the glock for the file because it references the
111 * Returns: The new offset, or errno
114 static loff_t gfs2_llseek(struct file *file, loff_t offset, int origin)
116 struct gfs2_inode *ip = get_v2ip(file->f_mapping->host);
117 struct gfs2_holder i_gh;
120 atomic_inc(&ip->i_sbd->sd_ops_file);
123 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY,
126 error = remote_llseek(file, offset, origin);
127 gfs2_glock_dq_uninit(&i_gh);
130 error = remote_llseek(file, offset, origin);
136 static ssize_t gfs2_direct_IO_read(struct kiocb *iocb, const struct iovec *iov,
137 loff_t offset, unsigned long nr_segs)
139 struct file *file = iocb->ki_filp;
140 struct address_space *mapping = file->f_mapping;
143 retval = filemap_write_and_wait(mapping);
145 retval = mapping->a_ops->direct_IO(READ, iocb, iov, offset,
152 * __gfs2_file_aio_read - The main GFS2 read function
154 * N.B. This is almost, but not quite the same as __generic_file_aio_read()
155 * the important subtle different being that inode->i_size isn't valid
156 * unless we are holding a lock, and we do this _only_ on the O_DIRECT
157 * path since otherwise locking is done entirely at the page cache
160 static ssize_t __gfs2_file_aio_read(struct kiocb *iocb,
161 const struct iovec *iov,
162 unsigned long nr_segs, loff_t *ppos)
164 struct file *filp = iocb->ki_filp;
165 struct gfs2_inode *ip = get_v2ip(filp->f_mapping->host);
166 struct gfs2_holder gh;
172 for (seg = 0; seg < nr_segs; seg++) {
173 const struct iovec *iv = &iov[seg];
176 * If any segment has a negative length, or the cumulative
177 * length ever wraps negative then return -EINVAL.
179 count += iv->iov_len;
180 if (unlikely((ssize_t)(count|iv->iov_len) < 0))
182 if (access_ok(VERIFY_WRITE, iv->iov_base, iv->iov_len))
187 count -= iv->iov_len; /* This segment is no good */
191 /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
192 if (filp->f_flags & O_DIRECT) {
193 loff_t pos = *ppos, size;
194 struct address_space *mapping;
197 mapping = filp->f_mapping;
198 inode = mapping->host;
201 goto out; /* skip atime */
203 gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &gh);
204 retval = gfs2_glock_nq_m_atime(1, &gh);
207 if (gfs2_is_stuffed(ip)) {
208 gfs2_glock_dq_m(1, &gh);
209 gfs2_holder_uninit(&gh);
210 goto fallback_to_normal;
212 size = i_size_read(inode);
214 retval = gfs2_direct_IO_read(iocb, iov, pos, nr_segs);
215 if (retval > 0 && !is_sync_kiocb(iocb))
216 retval = -EIOCBQUEUED;
218 *ppos = pos + retval;
221 gfs2_glock_dq_m(1, &gh);
222 gfs2_holder_uninit(&gh);
229 for (seg = 0; seg < nr_segs; seg++) {
230 read_descriptor_t desc;
233 desc.arg.buf = iov[seg].iov_base;
234 desc.count = iov[seg].iov_len;
238 do_generic_file_read(filp,ppos,&desc,file_read_actor);
239 retval += desc.written;
241 retval = retval ?: desc.error;
251 * gfs2_read - Read bytes from a file
252 * @file: The file to read from
253 * @buf: The buffer to copy into
254 * @size: The amount of data requested
255 * @offset: The current file offset
257 * Outputs: Offset - updated according to number of bytes read
259 * Returns: The number of bytes read, errno on failure
262 static ssize_t gfs2_read(struct file *filp, char __user *buf, size_t size,
265 struct iovec local_iov = { .iov_base = buf, .iov_len = size };
269 atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file);
271 init_sync_kiocb(&kiocb, filp);
272 ret = __gfs2_file_aio_read(&kiocb, &local_iov, 1, offset);
273 if (-EIOCBQUEUED == ret)
274 ret = wait_on_sync_kiocb(&kiocb);
278 static ssize_t gfs2_file_readv(struct file *filp, const struct iovec *iov,
279 unsigned long nr_segs, loff_t *ppos)
284 atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file);
286 init_sync_kiocb(&kiocb, filp);
287 ret = __gfs2_file_aio_read(&kiocb, iov, nr_segs, ppos);
288 if (-EIOCBQUEUED == ret)
289 ret = wait_on_sync_kiocb(&kiocb);
293 static ssize_t gfs2_file_aio_read(struct kiocb *iocb, char __user *buf,
294 size_t count, loff_t pos)
296 struct file *filp = iocb->ki_filp;
297 struct iovec local_iov = { .iov_base = buf, .iov_len = count };
299 atomic_inc(&get_v2sdp(filp->f_mapping->host->i_sb)->sd_ops_file);
301 BUG_ON(iocb->ki_pos != pos);
302 return __gfs2_file_aio_read(iocb, &local_iov, 1, &iocb->ki_pos);
307 * filldir_reg_func - Report a directory entry to the caller of gfs2_dir_read()
308 * @opaque: opaque data used by the function
309 * @name: the name of the directory entry
310 * @length: the length of the name
311 * @offset: the entry's offset in the directory
312 * @inum: the inode number the entry points to
313 * @type: the type of inode the entry points to
315 * Returns: 0 on success, 1 if buffer full
318 static int filldir_reg_func(void *opaque, const char *name, unsigned int length,
319 uint64_t offset, struct gfs2_inum *inum,
322 struct filldir_reg *fdr = (struct filldir_reg *)opaque;
323 struct gfs2_sbd *sdp = fdr->fdr_sbd;
326 error = fdr->fdr_filldir(fdr->fdr_opaque, name, length, offset,
327 inum->no_formal_ino, type);
331 if (fdr->fdr_prefetch && !(length == 1 && *name == '.')) {
332 gfs2_glock_prefetch_num(sdp,
333 inum->no_addr, &gfs2_inode_glops,
334 LM_ST_SHARED, LM_FLAG_TRY | LM_FLAG_ANY);
335 gfs2_glock_prefetch_num(sdp,
336 inum->no_addr, &gfs2_iopen_glops,
337 LM_ST_SHARED, LM_FLAG_TRY);
344 * readdir_reg - Read directory entries from a directory
345 * @file: The directory to read from
346 * @dirent: Buffer for dirents
347 * @filldir: Function used to do the copying
352 static int readdir_reg(struct file *file, void *dirent, filldir_t filldir)
354 struct gfs2_inode *dip = get_v2ip(file->f_mapping->host);
355 struct filldir_reg fdr;
356 struct gfs2_holder d_gh;
357 uint64_t offset = file->f_pos;
360 fdr.fdr_sbd = dip->i_sbd;
361 fdr.fdr_prefetch = 1;
362 fdr.fdr_filldir = filldir;
363 fdr.fdr_opaque = dirent;
365 gfs2_holder_init(dip->i_gl, LM_ST_SHARED, GL_ATIME, &d_gh);
366 error = gfs2_glock_nq_atime(&d_gh);
368 gfs2_holder_uninit(&d_gh);
372 error = gfs2_dir_read(dip, &offset, &fdr, filldir_reg_func);
374 gfs2_glock_dq_uninit(&d_gh);
376 file->f_pos = offset;
382 * filldir_bad_func - Report a directory entry to the caller of gfs2_dir_read()
383 * @opaque: opaque data used by the function
384 * @name: the name of the directory entry
385 * @length: the length of the name
386 * @offset: the entry's offset in the directory
387 * @inum: the inode number the entry points to
388 * @type: the type of inode the entry points to
390 * For supporting NFS.
392 * Returns: 0 on success, 1 if buffer full
395 static int filldir_bad_func(void *opaque, const char *name, unsigned int length,
396 uint64_t offset, struct gfs2_inum *inum,
399 struct filldir_bad *fdb = (struct filldir_bad *)opaque;
400 struct gfs2_sbd *sdp = fdb->fdb_sbd;
401 struct filldir_bad_entry *fbe;
403 if (fdb->fdb_entry_off == fdb->fdb_entry_num ||
404 fdb->fdb_name_off + length > fdb->fdb_name_size)
407 fbe = &fdb->fdb_entry[fdb->fdb_entry_off];
408 fbe->fbe_name = fdb->fdb_name + fdb->fdb_name_off;
409 memcpy(fbe->fbe_name, name, length);
410 fbe->fbe_length = length;
411 fbe->fbe_offset = offset;
412 fbe->fbe_inum = *inum;
413 fbe->fbe_type = type;
415 fdb->fdb_entry_off++;
416 fdb->fdb_name_off += length;
418 if (!(length == 1 && *name == '.')) {
419 gfs2_glock_prefetch_num(sdp,
420 inum->no_addr, &gfs2_inode_glops,
421 LM_ST_SHARED, LM_FLAG_TRY | LM_FLAG_ANY);
422 gfs2_glock_prefetch_num(sdp,
423 inum->no_addr, &gfs2_iopen_glops,
424 LM_ST_SHARED, LM_FLAG_TRY);
431 * readdir_bad - Read directory entries from a directory
432 * @file: The directory to read from
433 * @dirent: Buffer for dirents
434 * @filldir: Function used to do the copying
436 * For supporting NFS.
441 static int readdir_bad(struct file *file, void *dirent, filldir_t filldir)
443 struct gfs2_inode *dip = get_v2ip(file->f_mapping->host);
444 struct gfs2_sbd *sdp = dip->i_sbd;
445 struct filldir_reg fdr;
446 unsigned int entries, size;
447 struct filldir_bad *fdb;
448 struct gfs2_holder d_gh;
449 uint64_t offset = file->f_pos;
451 struct filldir_bad_entry *fbe;
454 entries = gfs2_tune_get(sdp, gt_entries_per_readdir);
455 size = sizeof(struct filldir_bad) +
456 entries * (sizeof(struct filldir_bad_entry) + GFS2_FAST_NAME_SIZE);
458 fdb = kzalloc(size, GFP_KERNEL);
463 fdb->fdb_entry = (struct filldir_bad_entry *)(fdb + 1);
464 fdb->fdb_entry_num = entries;
465 fdb->fdb_name = ((char *)fdb) + sizeof(struct filldir_bad) +
466 entries * sizeof(struct filldir_bad_entry);
467 fdb->fdb_name_size = entries * GFS2_FAST_NAME_SIZE;
469 gfs2_holder_init(dip->i_gl, LM_ST_SHARED, GL_ATIME, &d_gh);
470 error = gfs2_glock_nq_atime(&d_gh);
472 gfs2_holder_uninit(&d_gh);
476 error = gfs2_dir_read(dip, &offset, fdb, filldir_bad_func);
478 gfs2_glock_dq_uninit(&d_gh);
481 fdr.fdr_prefetch = 0;
482 fdr.fdr_filldir = filldir;
483 fdr.fdr_opaque = dirent;
485 for (x = 0; x < fdb->fdb_entry_off; x++) {
486 fbe = &fdb->fdb_entry[x];
488 error = filldir_reg_func(&fdr,
489 fbe->fbe_name, fbe->fbe_length,
491 &fbe->fbe_inum, fbe->fbe_type);
493 file->f_pos = fbe->fbe_offset;
499 file->f_pos = offset;
508 * gfs2_readdir - Read directory entries from a directory
509 * @file: The directory to read from
510 * @dirent: Buffer for dirents
511 * @filldir: Function used to do the copying
516 static int gfs2_readdir(struct file *file, void *dirent, filldir_t filldir)
520 atomic_inc(&get_v2sdp(file->f_mapping->host->i_sb)->sd_ops_file);
522 if (strcmp(current->comm, "nfsd") != 0)
523 error = readdir_reg(file, dirent, filldir);
525 error = readdir_bad(file, dirent, filldir);
530 static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd, unsigned long arg)
532 unsigned int lmode = (cmd == GFS2_IOCTL_SETFLAGS) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
533 struct buffer_head *dibh;
534 struct gfs2_holder i_gh;
536 __u32 flags = 0, change;
538 if (cmd == GFS2_IOCTL_SETFLAGS) {
539 error = get_user(flags, (__u32 __user *)arg);
544 error = gfs2_glock_nq_init(ip->i_gl, lmode, 0, &i_gh);
548 if (cmd == GFS2_IOCTL_SETFLAGS) {
549 change = flags ^ ip->i_di.di_flags;
551 if (change & (GFS2_DIF_IMMUTABLE|GFS2_DIF_APPENDONLY)) {
552 if (!capable(CAP_LINUX_IMMUTABLE))
556 if (flags & (GFS2_DIF_JDATA|GFS2_DIF_DIRECTIO)) {
557 if (!S_ISREG(ip->i_di.di_mode))
560 if (flags & (GFS2_DIF_INHERIT_JDATA|GFS2_DIF_INHERIT_DIRECTIO)) {
561 if (!S_ISDIR(ip->i_di.di_mode))
565 error = gfs2_trans_begin(ip->i_sbd, RES_DINODE, 0);
569 error = gfs2_meta_inode_buffer(ip, &dibh);
573 ip->i_di.di_flags = flags;
575 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
576 gfs2_dinode_out(&ip->i_di, dibh->b_data);
581 gfs2_trans_end(ip->i_sbd);
583 flags = ip->i_di.di_flags;
586 gfs2_glock_dq_uninit(&i_gh);
587 if (cmd == GFS2_IOCTL_GETFLAGS) {
588 if (put_user(flags, (__u32 __user *)arg))
595 * gfs2_ioctl - do an ioctl on a file
597 * @file: the file pointer
598 * @cmd: the ioctl command
604 static int gfs2_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
607 struct gfs2_inode *ip = get_v2ip(inode);
609 atomic_inc(&ip->i_sbd->sd_ops_file);
612 case GFS2_IOCTL_SETFLAGS:
613 case GFS2_IOCTL_GETFLAGS:
614 return gfs2_ioctl_flags(ip, cmd, arg);
623 * @file: The file to map
624 * @vma: The VMA which described the mapping
626 * Returns: 0 or error code
629 static int gfs2_mmap(struct file *file, struct vm_area_struct *vma)
631 struct gfs2_inode *ip = get_v2ip(file->f_mapping->host);
632 struct gfs2_holder i_gh;
635 atomic_inc(&ip->i_sbd->sd_ops_file);
637 gfs2_holder_init(ip->i_gl, LM_ST_SHARED, GL_ATIME, &i_gh);
638 error = gfs2_glock_nq_atime(&i_gh);
640 gfs2_holder_uninit(&i_gh);
644 /* This is VM_MAYWRITE instead of VM_WRITE because a call
645 to mprotect() can turn on VM_WRITE later. */
647 if ((vma->vm_flags & (VM_MAYSHARE | VM_MAYWRITE)) ==
648 (VM_MAYSHARE | VM_MAYWRITE))
649 vma->vm_ops = &gfs2_vm_ops_sharewrite;
651 vma->vm_ops = &gfs2_vm_ops_private;
653 gfs2_glock_dq_uninit(&i_gh);
659 * gfs2_open - open a file
660 * @inode: the inode to open
661 * @file: the struct file for this opening
666 static int gfs2_open(struct inode *inode, struct file *file)
668 struct gfs2_inode *ip = get_v2ip(inode);
669 struct gfs2_holder i_gh;
670 struct gfs2_file *fp;
673 atomic_inc(&ip->i_sbd->sd_ops_file);
675 fp = kzalloc(sizeof(struct gfs2_file), GFP_KERNEL);
679 init_MUTEX(&fp->f_fl_mutex);
684 gfs2_assert_warn(ip->i_sbd, !get_v2fp(file));
687 if (S_ISREG(ip->i_di.di_mode)) {
688 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY,
693 if (!(file->f_flags & O_LARGEFILE) &&
694 ip->i_di.di_size > MAX_NON_LFS) {
699 /* Listen to the Direct I/O flag */
701 if (ip->i_di.di_flags & GFS2_DIF_DIRECTIO)
702 file->f_flags |= O_DIRECT;
704 gfs2_glock_dq_uninit(&i_gh);
710 gfs2_glock_dq_uninit(&i_gh);
713 set_v2fp(file, NULL);
720 * gfs2_close - called to close a struct file
721 * @inode: the inode the struct file belongs to
722 * @file: the struct file being closed
727 static int gfs2_close(struct inode *inode, struct file *file)
729 struct gfs2_sbd *sdp = get_v2sdp(inode->i_sb);
730 struct gfs2_file *fp;
732 atomic_inc(&sdp->sd_ops_file);
735 set_v2fp(file, NULL);
737 if (gfs2_assert_warn(sdp, fp))
746 * gfs2_fsync - sync the dirty data for a file (across the cluster)
747 * @file: the file that points to the dentry (we ignore this)
748 * @dentry: the dentry that points to the inode to sync
753 static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync)
755 struct gfs2_inode *ip = get_v2ip(dentry->d_inode);
757 atomic_inc(&ip->i_sbd->sd_ops_file);
758 gfs2_log_flush_glock(ip->i_gl);
764 * gfs2_lock - acquire/release a posix lock on a file
765 * @file: the file pointer
766 * @cmd: either modify or retrieve lock state, possibly wait
767 * @fl: type and range of lock
772 static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
774 struct gfs2_inode *ip = get_v2ip(file->f_mapping->host);
775 struct gfs2_sbd *sdp = ip->i_sbd;
776 struct lm_lockname name =
777 { .ln_number = ip->i_num.no_addr,
778 .ln_type = LM_TYPE_PLOCK };
780 atomic_inc(&sdp->sd_ops_file);
782 if (!(fl->fl_flags & FL_POSIX))
784 if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
787 if (sdp->sd_args.ar_localflocks) {
789 struct file_lock *tmp;
791 tmp = posix_test_lock(file, fl);
792 fl->fl_type = F_UNLCK;
794 memcpy(fl, tmp, sizeof(struct file_lock));
800 error = posix_lock_file_wait(file, fl);
807 return gfs2_lm_plock_get(sdp, &name, file, fl);
808 else if (fl->fl_type == F_UNLCK)
809 return gfs2_lm_punlock(sdp, &name, file, fl);
811 return gfs2_lm_plock(sdp, &name, file, cmd, fl);
815 * gfs2_sendfile - Send bytes to a file or socket
816 * @in_file: The file to read from
817 * @out_file: The file to write to
818 * @count: The amount of data
819 * @offset: The beginning file offset
821 * Outputs: offset - updated according to number of bytes read
823 * Returns: The number of bytes sent, errno on failure
826 static ssize_t gfs2_sendfile(struct file *in_file, loff_t *offset, size_t count,
827 read_actor_t actor, void *target)
829 struct gfs2_inode *ip = get_v2ip(in_file->f_mapping->host);
831 atomic_inc(&ip->i_sbd->sd_ops_file);
833 return generic_file_sendfile(in_file, offset, count, actor, target);
836 static int do_flock(struct file *file, int cmd, struct file_lock *fl)
838 struct gfs2_file *fp = get_v2fp(file);
839 struct gfs2_holder *fl_gh = &fp->f_fl_gh;
840 struct gfs2_inode *ip = fp->f_inode;
841 struct gfs2_glock *gl;
846 state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED;
847 flags = ((IS_SETLKW(cmd)) ? 0 : LM_FLAG_TRY) | GL_EXACT | GL_NOCACHE;
849 down(&fp->f_fl_mutex);
853 if (fl_gh->gh_state == state)
856 flock_lock_file_wait(file,
857 &(struct file_lock){.fl_type = F_UNLCK});
858 gfs2_glock_dq_uninit(fl_gh);
860 error = gfs2_glock_get(ip->i_sbd,
861 ip->i_num.no_addr, &gfs2_flock_glops,
867 gfs2_holder_init(gl, state, flags, fl_gh);
870 error = gfs2_glock_nq(fl_gh);
872 gfs2_holder_uninit(fl_gh);
873 if (error == GLR_TRYFAILED)
876 error = flock_lock_file_wait(file, fl);
877 gfs2_assert_warn(ip->i_sbd, !error);
886 static void do_unflock(struct file *file, struct file_lock *fl)
888 struct gfs2_file *fp = get_v2fp(file);
889 struct gfs2_holder *fl_gh = &fp->f_fl_gh;
891 down(&fp->f_fl_mutex);
892 flock_lock_file_wait(file, fl);
894 gfs2_glock_dq_uninit(fl_gh);
899 * gfs2_flock - acquire/release a flock lock on a file
900 * @file: the file pointer
901 * @cmd: either modify or retrieve lock state, possibly wait
902 * @fl: type and range of lock
907 static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl)
909 struct gfs2_inode *ip = get_v2ip(file->f_mapping->host);
910 struct gfs2_sbd *sdp = ip->i_sbd;
912 atomic_inc(&ip->i_sbd->sd_ops_file);
914 if (!(fl->fl_flags & FL_FLOCK))
916 if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
919 if (sdp->sd_args.ar_localflocks)
920 return flock_lock_file_wait(file, fl);
922 if (fl->fl_type == F_UNLCK) {
923 do_unflock(file, fl);
926 return do_flock(file, cmd, fl);
929 struct file_operations gfs2_file_fops = {
930 .llseek = gfs2_llseek,
932 .readv = gfs2_file_readv,
933 .aio_read = gfs2_file_aio_read,
934 .write = generic_file_write,
935 .writev = generic_file_writev,
936 .aio_write = generic_file_aio_write,
940 .release = gfs2_close,
943 .sendfile = gfs2_sendfile,
947 struct file_operations gfs2_dir_fops = {
948 .readdir = gfs2_readdir,
951 .release = gfs2_close,