/**
* gfs2_readahead - Read a bunch of pages at once
- * @file: The file to read from
- * @mapping: Address space info
- * @pages: List of pages to read
- * @nr_pages: Number of pages to read
+ * @rac: Read-ahead control structure
*
* Some notes:
* 1. This is only for readahead, so we can simply ignore any things
/**
* sweep_bh_for_rgrps - find an rgrp in a meta buffer and free blocks therein
* @ip: inode
- * @rg_gh: holder of resource group glock
+ * @rd_gh: holder of resource group glock
* @bh: buffer head to sweep
* @start: starting point in bh
* @end: end point in bh
/**
* find_nonnull_ptr - find a non-null pointer given a metapath and height
+ * @sdp: The superblock
* @mp: starting metapath
* @h: desired height to search
+ * @end_list: See punch_hole().
+ * @end_aligned: See punch_hole().
*
* Assumes the metapath is valid (with buffers) out to height h.
* Returns: true if a non-null pointer was found in the metapath buffer
return error;
}
-/**
- * fsflag_gfs2flag
+/*
+ * struct fsflag_gfs2flag
*
* The FS_JOURNAL_DATA_FL flag maps to GFS2_DIF_INHERIT_JDATA for directories,
* and to GFS2_DIF_JDATA for non-directories.
/**
* gfs2_page_mkwrite - Make a shared, mmap()ed, page writable
- * @vma: The virtual memory area
* @vmf: The virtual memory fault containing the page to become writable
*
* When the page becomes writable, we need to ensure that we have
};
/**
- * gfs2_mmap -
+ * gfs2_mmap
* @file: The file to map
* @vma: The VMA which described the mapping
*
/**
* do_error - Something unexpected has happened during a lock request
- *
+ * @gl: The glock
+ * @ret: The status from the DLM
*/
static void do_error(struct gfs2_glock *gl, const int ret)
/**
* state_change - record that the glock is now in a different state
* @gl: the glock
- * @new_state the new state
- *
+ * @new_state: the new state
*/
static void state_change(struct gfs2_glock *gl, unsigned int new_state)
* handle_callback - process a demote request
* @gl: the glock
* @state: the state the caller wants us to change to
+ * @delay: zero to demote immediately; otherwise pending demote
+ * @remote: true if this came from a different cluster node
*
* There are only two requests that we are going to see in actual
* practise: LM_ST_SHARED and LM_ST_UNLOCKED
* nq_m_sync - synchonously acquire more than one glock in deadlock free order
* @num_gh: the number of structures
* @ghs: an array of struct gfs2_holder structures
+ * @p: placeholder for the holder structure to pass back
*
* Returns: 0 on success (all glocks acquired),
* errno on failure (no glocks acquired)
/**
* gfs2_gl_hash_clear - Empty out the glock hash table
* @sdp: the filesystem
- * @wait: wait until it's all gone
*
* Called when unmounting the filesystem.
*/
* __gfs2_ail_flush - remove all buffers for a given lock from the AIL
* @gl: the glock
* @fsync: set when called from fsync (not all buffers will be clean)
+ * @nr_revokes: Number of buffers to revoke
*
* None of the buffers should be dirty, locked, or pinned.
*/
/**
* inode_go_lock - operation done after an inode lock is locked by a process
- * @gl: the glock
- * @flags:
+ * @gh: The glock holder
*
* Returns: errno
*/
/**
* inode_go_dump - print information about an inode
* @seq: The iterator
- * @ip: the inode
+ * @gl: The glock
* @fs_id_buf: file system id (may be empty)
*
*/
/**
* freeze_go_sync - promote/demote the freeze glock
* @gl: the glock
- * @state: the requested state
- * @flags:
- *
*/
static int freeze_go_sync(struct gfs2_glock *gl)
/**
* freeze_go_xmote_bh - After promoting/demoting the freeze glock
* @gl: the glock
- *
*/
-
static int freeze_go_xmote_bh(struct gfs2_glock *gl)
{
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
}
/**
- * trans_go_demote_ok
+ * freeze_go_demote_ok
* @gl: the glock
*
* Always returns 0
/**
* iopen_go_callback - schedule the dcache entry for the inode to be deleted
* @gl: the glock
+ * @remote: true if this came from a different cluster node
*
* gl_lockref.lock lock is held while calling this
*/
/**
* gfs2_lookupi - Look up a filename in a directory and return its inode
- * @d_gh: An initialized holder for the directory glock
+ * @dir: The inode of the directory containing the inode to look-up
* @name: The name of the inode to look for
* @is_root: If 1, ignore the caller's permissions
- * @i_gh: An uninitialized holder for the new inode glock
*
* This can be called via the VFS filldir function when NFS is doing
* a readdirplus and the inode which its intending to stat isn't
* @dip: The directory this inode is being created in
* @ip: The inode
* @symname: The symlink destination (if a symlink)
- * @bhp: The buffer head (returned to caller)
*
*/
}
/**
- * gfs2_trans_da_blocks - Calculate number of blocks to link inode
+ * gfs2_trans_da_blks - Calculate number of blocks to link inode
* @dip: The directory we are linking into
* @da: The dir add information
* @nr_inodes: The number of inodes involved
* @dev: For device nodes, this is the device number
* @symname: For symlinks, this is the link destination
* @size: The initial size of the inode (ignored for directories)
+ * @excl: Force fail if inode exists
*
* Returns: 0 on success, or error code
*/
/**
* gfs2_create - Create a file
+ * @mnt_userns: User namespace of the mount the inode was found from
* @dir: The directory in which to create the file
* @dentry: The dentry of the new file
* @mode: The mode of the new file
+ * @excl: Force fail if inode exists
*
* Returns: errno
*/
/**
* gfs2_unlink_inode - Removes an inode from its parent dir and unlinks it
* @dip: The parent directory
- * @name: The name of the entry in the parent directory
- * @inode: The inode to be removed
+ * @dentry: The dentry to unlink
*
* Called with all the locks and in a transaction. This will only be
* called for a directory after it has been checked to ensure it is empty.
/**
* gfs2_symlink - Create a symlink
+ * @mnt_userns: User namespace of the mount the inode was found from
* @dir: The directory to create the symlink in
* @dentry: The dentry to put the symlink in
* @symname: The thing which the link points to
/**
* gfs2_mkdir - Make a directory
+ * @mnt_userns: User namespace of the mount the inode was found from
* @dir: The parent directory of the new one
* @dentry: The dentry of the new directory
* @mode: The mode of the new directory
/**
* gfs2_mknod - Make a special file
+ * @mnt_userns: User namespace of the mount the inode was found from
* @dir: The directory in which the special file will reside
* @dentry: The dentry of the special file
* @mode: The mode of the special file
}
/**
- * gfs2_permission -
+ * gfs2_permission
+ * @mnt_userns: User namespace of the mount the inode was found from
* @inode: The inode
* @mask: The mask to be tested
- * @flags: Indicates whether this is an RCU path walk or not
*
* This may be called from the VFS directly, or from within GFS2 with the
* inode locked, so we look to see if the glock is already locked and only
return 0;
}
-/**
- * gfs2_setattr_simple -
- * @ip:
- * @attr:
- *
- * Returns: errno
- */
-
static int gfs2_setattr_simple(struct inode *inode, struct iattr *attr)
{
int error;
/**
* gfs2_setattr - Change attributes on an inode
+ * @mnt_userns: User namespace of the mount the inode was found from
* @dentry: The dentry which is changing
* @attr: The structure describing the change
*
/**
* gfs2_update_stats - Update time based stats
- * @mv: Pointer to mean/variance structure to update
+ * @s: The stats to update (local or global)
+ * @index: The index inside @s
* @sample: New data to include
- *
- * @delta is the difference between the current rtt sample and the
- * running average srtt. We add 1/8 of that to the srtt in order to
- * update the current srtt estimate. The variance estimate is a bit
- * more complicated. We subtract the current variance estimate from
- * the abs value of the @delta and add 1/4 of that to the running
- * total. That's equivalent to 3/4 of the current variance
- * estimate plus 1/4 of the abs of @delta.
- *
- * Note that the index points at the array entry containing the smoothed
- * mean value, and the variance is always in the following entry
- *
- * Reference: TCP/IP Illustrated, vol 2, p. 831,832
- * All times are in units of integer nanoseconds. Unlike the TCP/IP case,
- * they are not scaled fixed point.
*/
-
static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index,
s64 sample)
{
+ /*
+ * @delta is the difference between the current rtt sample and the
+ * running average srtt. We add 1/8 of that to the srtt in order to
+ * update the current srtt estimate. The variance estimate is a bit
+ * more complicated. We subtract the current variance estimate from
+ * the abs value of the @delta and add 1/4 of that to the running
+ * total. That's equivalent to 3/4 of the current variance
+ * estimate plus 1/4 of the abs of @delta.
+ *
+ * Note that the index points at the array entry containing the
+ * smoothed mean value, and the variance is always in the following
+ * entry
+ *
+ * Reference: TCP/IP Illustrated, vol 2, p. 831,832
+ * All times are in units of integer nanoseconds. Unlike the TCP/IP
+ * case, they are not scaled fixed point.
+ */
+
s64 delta = sample - s->stats[index];
s->stats[index] += (delta >> 3);
index++;
/**
* gfs2_remove_from_ail - Remove an entry from the ail lists, updating counters
- * @mapping: The associated mapping (maybe NULL)
* @bd: The gfs2_bufdata to remove
*
* The ail lock _must_ be held when calling this function
}
/**
- * gfs2_ail1_start_one - Start I/O on a part of the AIL
- * @sdp: the filesystem
+ * gfs2_ail1_start_one - Start I/O on a transaction
+ * @sdp: The superblock
* @wbc: The writeback control structure
- * @ai: The ail structure
- *
+ * @tr: The transaction to start I/O on
+ * @plug: The block plug currently active
*/
static int gfs2_ail1_start_one(struct gfs2_sbd *sdp,
sdp->sd_log_head = new_head;
}
-/**
+/*
* gfs2_ail_empty_tr - empty one of the ail lists of a transaction
*/
/**
* gfs2_log_flush - flush incore transaction(s)
- * @sdp: the filesystem
+ * @sdp: The filesystem
* @gl: The glock structure to flush. If NULL, flush the whole incore log
* @flags: The log header flags: GFS2_LOG_HEAD_FLUSH_* and debug flags
*
/**
* gfs2_merge_trans - Merge a new transaction into a cached transaction
- * @old: Original transaction to be expanded
+ * @sdp: the filesystem
* @new: New transaction to be merged
*/
/**
* gfs2_logd - Update log tail as Active Items get flushed to in-place blocks
- * @sdp: Pointer to GFS2 superblock
+ * @data: Pointer to GFS2 superblock
*
* Also, periodically check to make sure that we're using the most recent
* journal index.
* gfs2_unpin - Unpin a buffer
* @sdp: the filesystem the buffer belongs to
* @bh: The buffer to unpin
- * @ai:
- * @flags: The inode dirty flags
- *
+ * @tr: The system transaction being flushed
*/
static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
* gfs2_log_get_bio - Get cached log bio, or allocate a new one
* @sdp: The super block
* @blkno: The device block number we want to write to
- * @bio: The bio to get or allocate
+ * @biop: The bio to get or allocate
* @op: REQ_OP
* @end_io: The bi_end_io callback
* @flush: Always flush the current bio and allocate a new one?
/**
* gfs2_log_write - write to log
* @sdp: the filesystem
+ * @jd: The journal descriptor
* @page: the page to write
* @size: the size of the data to write
* @offset: the offset within the page
/**
* gfs2_jhead_pg_srch - Look for the journal head in a given page.
* @jd: The journal descriptor
+ * @head: The journal head to start from
* @page: The page to look in
*
* Returns: 1 if found, 0 otherwise.
* gfs2_jhead_process_page - Search/cleanup a page
* @jd: The journal descriptor
* @index: Index of the page to look into
+ * @head: The journal head to start from
* @done: If set, perform only cleanup, else search and set if found.
*
* Find the page with 'index' in the journal's mapping. Search the page for
* gfs2_find_jhead - find the head of a log
* @jd: The journal descriptor
* @head: The log descriptor for the head of the log is returned here
+ * @keep_cache: If set inode pages will not be truncated
*
* Do a search of a journal by reading it in large chunks using bios and find
* the valid log entry with the highest sequence number. (i.e. the log head)
/**
* databuf_lo_before_commit - Scan the data buffers, writing as we go
- *
+ * @sdp: The filesystem
+ * @tr: The system transaction being flushed
*/
static void databuf_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
* @gl: The glock covering the block
* @blkno: The block number
* @flags: flags
+ * @rahead: Do read-ahead
* @bhp: the place where the buffer is returned (NULL on failure)
*
* Returns: errno
/**
* gfs2_check_sb - Check superblock
* @sdp: the filesystem
- * @sb: The superblock
* @silent: Don't print a message if the check fails
*
* Checks the version code of the FS is one that we understand how to
* gfs2_read_super - Read the gfs2 super block from disk
* @sdp: The GFS2 super block
* @sector: The location of the super block
- * @error: The error code to return
+ * @silent: Don't print a message if the check fails
*
* This uses the bio functions to read the super block from disk
* because we want to be 100% sure that we never read cached data.
/**
* gfs2_lm_mount - mount a locking protocol
* @sdp: the filesystem
- * @args: mount arguments
* @silent: if 1, don't complain if the FS isn't a GFS2 fs
*
* Returns: errno
/**
* gfs2_fill_super - Read in superblock
* @sb: The VFS superblock
- * @args: Mount options
- * @silent: Don't complain if it's not a GFS2 filesystem
+ * @fc: Mount options and flags
*
* Returns: -errno
*/
/**
* gfs2_quotad - Write cached quota changes into the quota file
- * @sdp: Pointer to GFS2 superblock
+ * @data: Pointer to GFS2 superblock
*
*/
* get_log_header - read the log header for a given segment
* @jd: the journal
* @blk: the block to look at
- * @lh: the log header to return
+ * @head: the log header to return
*
* Read the log header for a given segement in a given journal. Do a few
* sanity checks on it.
* @jd: the journal
* @start: the first log header in the active region
* @end: the last log header (don't process the contents of this entry))
+ * @pass: iteration number (foreach_descriptor() is called in a for() loop)
*
* Call a given function once for every log descriptor in the active
* portion of the log.
}
/**
- * gfs2_compute_bitstructs - Compute the bitmap sizes
+ * compute_bitstructs - Compute the bitmap sizes
* @rgd: The resource group descriptor
*
* Calculates bitmap descriptors, one for each block that contains bitmap data
}
/**
- * rgd_free - return the number of free blocks we can allocate.
+ * rgd_free - return the number of free blocks we can allocate
* @rgd: the resource group
+ * @rs: The reservation to free
*
* This function returns the number of free blocks for an rgrp.
* That's the clone-free blocks (blocks that are free, not including those
/**
* fast_to_acquire - determine if a resource group will be fast to acquire
+ * @rgd: The rgrp
*
* If this is one of our preferred rgrps, it should be quicker to acquire,
* because we tried to set ourselves up as dlm lock master.
* gfs2_lock_fs_check_clean - Stop all writes to the FS and check that all
* journals are clean
* @sdp: the file system
- * @state: the state to put the transaction lock into
- * @t_gh: the hold on the transaction lock
*
* Returns: errno
*/
/**
* gfs2_sync_fs - sync the filesystem
* @sb: the superblock
+ * @wait: true to wait for completion
*
* Flushes the log to disk.
*/
}
/**
- * statfs_fill - fill in the sg for a given RG
+ * statfs_slow_fill - fill in the sg for a given RG
* @rgd: the RG
* @sc: the sc structure
*
/**
* gfs2_statfs_i - Do a statfs
* @sdp: the filesystem
- * @sg: the sg structure
+ * @sc: the sc structure
*
* Returns: errno
*/
/**
* gfs2_statfs - Gather and return stats about the filesystem
- * @sb: The superblock
- * @statfsbuf: The buffer
+ * @dentry: The name of the link
+ * @buf: The buffer
*
* Returns: 0 on success or error code
*/
/**
* evict_should_delete - determine whether the inode is eligible for deletion
* @inode: The inode to evict
+ * @gh: The glock holder structure
*
* This function determines whether the evicted inode is eligible to be deleted
* and locks the inode glock.
* check_journal_clean - Make sure a journal is clean for a spectator mount
* @sdp: The GFS2 superblock
* @jd: The journal descriptor
+ * @verbose: Show more prints in the log
*
* Returns: 0 if the journal is clean or locked, else an error
*/
return -1;
}
-/**
+/*
* gfs2_assert_withdraw_i - Cause the machine to withdraw if @assertion is false
*/
dump_stack();
}
-/**
+/*
* gfs2_assert_warn_i - Print a message to the console if @assertion is false
*/
sdp->sd_last_warning = jiffies;
}
-/**
+/*
* gfs2_consist_i - Flag a filesystem consistency error and withdraw
*/
gfs2_withdraw(sdp);
}
-/**
+/*
* gfs2_consist_inode_i - Flag an inode consistency error and withdraw
*/
gfs2_withdraw(sdp);
}
-/**
+/*
* gfs2_consist_rgrpd_i - Flag a RG consistency error and withdraw
*/
gfs2_withdraw(sdp);
}
-/**
+/*
* gfs2_meta_check_ii - Flag a magic number consistency error and withdraw
* Returns: -1 if this call withdrew the machine,
* -2 if it was already withdrawn
return (me) ? -1 : -2;
}
-/**
+/*
* gfs2_metatype_check_ii - Flag a metadata type consistency error and withdraw
* Returns: -1 if this call withdrew the machine,
* -2 if it was already withdrawn
return (me) ? -1 : -2;
}
-/**
+/*
* gfs2_io_error_i - Flag an I/O error and withdraw
* Returns: -1 if this call withdrew the machine,
* 0 if it was already withdrawn
return gfs2_withdraw(sdp);
}
-/**
+/*
* gfs2_io_error_bh_i - Flag a buffer I/O error
* @withdraw: withdraw the filesystem
*/
#include "trans.h"
#include "util.h"
-/**
- * ea_calc_size - returns the acutal number of bytes the request will take up
+/*
+ * ea_calc_size - returns the actual number of bytes the request will take up
* (not counting any unstuffed data blocks)
- * @sdp:
- * @er:
- * @size:
*
* Returns: 1 if the EA should be stuffed
*/
return error;
}
-/**
- * ea_dealloc_unstuffed -
- * @ip:
- * @bh:
- * @ea:
- * @prev:
- * @private:
+/*
+ * ea_dealloc_unstuffed
*
* Take advantage of the fact that all unstuffed blocks are
* allocated from the same RG. But watch, this may not always
}
/**
- * ea_iter_unstuffed - copies the unstuffed xattr data to/from the
- * request buffer
+ * gfs2_iter_unstuffed - copies the unstuffed xattr data to/from the
+ * request buffer
* @ip: The GFS2 inode
* @ea: The extended attribute header structure
* @din: The data to be copied in
}
/**
- * gfs2_xattr_get - Get a GFS2 extended attribute
+ * __gfs2_xattr_get - Get a GFS2 extended attribute
* @inode: The inode
* @name: The name of the extended attribute
* @buffer: The buffer to write the result into
return error;
}
-/**
+/*
* ea_init - initializes a new eattr block
- * @ip:
- * @er:
*
* Returns: errno
*/
-
static int ea_init(struct gfs2_inode *ip, int type, const char *name,
const void *data, size_t size)
{
/**
* __gfs2_xattr_set - Set (or remove) a GFS2 extended attribute
- * @ip: The inode
+ * @inode: The inode
* @name: The name of the extended attribute
* @value: The value of the extended attribute (NULL for remove)
* @size: The size of the @value argument