From d1469908927fab3c54ad740bad7f8991cc69d363 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 14 Sep 2021 08:42:51 -0600 Subject: [PATCH 01/49] Vim plugin bankruptcy!!!! --- README.md | 13 + config/nvim/init.vim | 690 ++- .../.github/ISSUE_TEMPLATE/bug_report.md | 33 + .../.github/ISSUE_TEMPLATE/feature_request.md | 26 + vim-plugins-profile-master/.gitignore | 30 + vim-plugins-profile-master/.travis.yml | 55 + vim-plugins-profile-master/.travis/vimrc | 13 + vim-plugins-profile-master/LICENSE | 674 +++ vim-plugins-profile-master/README.md | 146 + .../vim-plugins-profile-plot.R | 91 + .../vim-plugins-profile.pl | 114 + .../vim-plugins-profile.py | 328 ++ .../vim-plugins-profile.rb | 59 + .../vim-plugins-profile.sh | 85 + wiretest.c | 4540 +++++++++++++++++ 15 files changed, 6679 insertions(+), 218 deletions(-) create mode 100644 vim-plugins-profile-master/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 vim-plugins-profile-master/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 vim-plugins-profile-master/.gitignore create mode 100644 vim-plugins-profile-master/.travis.yml create mode 100644 vim-plugins-profile-master/.travis/vimrc create mode 100644 vim-plugins-profile-master/LICENSE create mode 100644 vim-plugins-profile-master/README.md create mode 100644 vim-plugins-profile-master/vim-plugins-profile-plot.R create mode 100755 vim-plugins-profile-master/vim-plugins-profile.pl create mode 100755 vim-plugins-profile-master/vim-plugins-profile.py create mode 100755 vim-plugins-profile-master/vim-plugins-profile.rb create mode 100755 vim-plugins-profile-master/vim-plugins-profile.sh create mode 100644 wiretest.c diff --git a/README.md b/README.md index 891609f..57b948f 100644 --- a/README.md +++ b/README.md @@ -66,12 +66,25 @@ rcup -v `-v` instructs it to output what it's doing. +## Vim Profiling + +From https://github.com/hyiltiz/vim-plugins-profile + +```bash + +ruby ./vim-plugins-profile-master/vim-plugins-profile.rb + +python ./vim-plugins-profile-master/vim-plugins-profile.py # -p flag plots a bar chart + +``` + ## Inspiration - [https://github.com/christoomey/dotfiles](https://github.com/christoomey/dotfiles) - [https://github.com/mhartington/dotfiles](https://github.com/mhartington/dotfiles) - [https://github.com/mathiasbynens/dotfiles](https://github.com/mathiasbynens/dotfiles) + ## License [MIT](LICENSE.md) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index cc2d8a2..fb32132 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -24,74 +24,89 @@ " Global plugins for all filetypes Plug 'tpope/vim-abolish' - Plug 'tpope/vim-dispatch' - Plug 'radenling/vim-dispatch-neovim' - Plug 'tpope/vim-eunuch' + " Plug 'tpope/vim-dispatch' + " Plug 'radenling/vim-dispatch-neovim' + " Plug 'tpope/vim-eunuch' " Git - Plug 'tpope/vim-fugitive' - Plug 'tpope/vim-rhubarb' " GH Enterprise support - Plug 'tommcdo/vim-fubitive' " bitbucket for fugitive - Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive - Plug 'idanarye/vim-merginal' " branch mgmt for fugitive + " Plug 'tpope/vim-fugitive' + " Plug 'tpope/vim-rhubarb' " GH Enterprise support + " Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive + " Plug 'idanarye/vim-merginal' " branch mgmt for fugitive " Plug 'lambdalisue/gina.vim' - Plug 'tpope/vim-git' + + " LSP + Plug 'neovim/nvim-lspconfig' + Plug 'jose-elias-alvarez/null-ls.nvim', { 'branch': 'main' } + Plug 'jose-elias-alvarez/nvim-lsp-ts-utils', { 'branch': 'main' } + Plug 'folke/trouble.nvim', { 'branch': 'main' } + + " Snippets + Plug 'hrsh7th/vim-vsnip' " snippet engine + + " Completion + Plug 'nvim-lua/completion-nvim' + " Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' } " nvim-cmp + " Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' } " Install the buffer completion source + + " Generally usefull stuff Plug 'tpope/vim-repeat' - Plug 'tpope/vim-rhubarb' - Plug 'tpope/vim-scriptease' - Plug 'tpope/vim-speeddating' - Plug 'tpope/vim-surround' - Plug 'tpope/vim-tbone' - Plug 'tpope/vim-unimpaired' + " Plug 'tpope/vim-rhubarb' " TODO find replacement or re-enable + Plug 'tpope/vim-speeddating' " increment stuff + Plug 'tpope/vim-surround' " obviously + " Plug 'tpope/vim-tbone' + Plug 'tpope/vim-unimpaired' " bracket mappings " Plug 'tpope/vim-obsession' " Colors - some plugins rely on this - Plug 'devth/vim-colors-solarized' " Note: devth-fork - - " General Syntax - Plug 'tpope/vim-markdown', {'for': 'markdown'} - Plug 'ekalinin/Dockerfile.vim', {'for': 'Dockerfile'} - Plug 'google/vim-jsonnet', {'for': 'jsonnet'} - Plug 'fatih/vim-go', {'for': 'go'} - Plug 'hashivim/vim-vagrant', {'for': 'vagrant'} - Plug 'mattn/emmet-vim' - Plug 'mustache/vim-mustache-handlebars' + " Plug 'devth/vim-colors-solarized' " Note: devth-fork + Plug 'overcache/NeoSolarized' + + " Use TreeSitter for language highlighting instead + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + + " General Syntax - these shouldn't slow things down + " Plug 'tpope/vim-markdown', {'for': 'markdown'} + " Plug 'ekalinin/Dockerfile.vim', {'for': 'Dockerfile'} + " Plug 'google/vim-jsonnet', {'for': 'jsonnet'} + " Plug 'fatih/vim-go', {'for': 'go'} + " Plug 'hashivim/vim-vagrant', {'for': 'vagrant'} + " Plug 'mustache/vim-mustache-handlebars' + " " Plug 'jparise/vim-graphql', {'for': 'graphql'} " Plug 'jparise/vim-graphql', {'for': 'graphql'} - Plug 'jparise/vim-graphql', {'for': 'graphql'} Plug 'delphinus/vim-firestore' " firestore highlighting + " Plug 'pangloss/vim-javascript', {'for': 'javascript'} + + Plug 'mattn/emmet-vim' " expanding abbreviations (HTML mostly) " JavaScript - Plug 'pangloss/vim-javascript' - " Plug 'mxw/vim-jsx' - Plug 'neoclide/vim-jsx-improve' + " " Plug 'mxw/vim-jsx' + " Plug 'neoclide/vim-jsx-improve' " Clojure - " Test out a fork of tpope/vim-fire place until - " https://github.com/tpope/vim-fireplace/pull/323 is merged - " Plug 'raymond-w-ko/vim-fireplace', {'for': 'clojure'} - " Plug 'tpope/vim-fireplace', {'for': 'clojure'} - - Plug 'clojure-vim/async-clj-omni', {'for': 'clojure'} " clj completion - " needed for edn and the latest clojure syntax - Plug 'guns/vim-clojure-static', {'for': 'clojure'} - Plug 'guns/vim-sexp', {'for': 'clojure'} - Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'} - " Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'dev'} - Plug 'liquidz/vim-iced', {'for': 'clojure'} - Plug 'liquidz/vim-iced-project-namespaces', {'for': 'clojure'} - Plug 'liquidz/vim-iced-kaocha' - " Plug 'matthias-margush/vim-iced', {'for': 'clojure', 'branch': 'piggieback' } - " Note: Doesn't work with .cljc files yet: - " TODO get this working - " Plug 'clojure-vim/acid.nvim', { 'do': ':UpdateRemotePlugins' } - - " Elm - Plug 'ElmCast/elm-vim' + " Plug 'clojure-vim/async-clj-omni', {'for': 'clojure'} " clj completion + " " needed for edn and the latest clojure syntax + " Plug 'guns/vim-clojure-static', {'for': 'clojure'} + " Plug 'guns/vim-sexp', {'for': 'clojure'} + " Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'} + " " Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'dev'} + " Plug 'liquidz/vim-iced', {'for': 'clojure'} + " Plug 'liquidz/vim-iced-project-namespaces', {'for': 'clojure'} + " Plug 'liquidz/vim-iced-kaocha' + " " Plug 'matthias-margush/vim-iced', {'for': 'clojure', 'branch': 'piggieback' } + " " Note: Doesn't work with .cljc files yet: + " " TODO get this working + " " Plug 'clojure-vim/acid.nvim', { 'do': ':UpdateRemotePlugins' } + + " " Elm + " Plug 'ElmCast/elm-vim', {'for': 'elm'} " File exploration / openning - Plug 'scrooloose/nerdtree' - Plug 'Xuyuanp/nerdtree-git-plugin' + Plug 'kyazdani42/nvim-web-devicons' " for file icons + Plug 'kyazdani42/nvim-tree.lua' + " Plug 'scrooloose/nerdtree' + " Plug 'Xuyuanp/nerdtree-git-plugin' " Can't get these to work right - font is not configured? " Plug 'tiagofumo/vim-nerdtree-syntax-highlight' " Plug 'ryanoasis/vim-devicons' @@ -102,68 +117,68 @@ " Utils " Plug 'vimlab/split-term.vim' " Terminal utils - Plug 'christianrondeau/vim-base64' + " Plug 'christianrondeau/vim-base64' + " Plug 'mhinz/vim-signify' + " Plug 'kassio/neoterm' " Terminal utils + " Plug 'vim-scripts/regreplop.vim' " replace! + + Plug 'svermeulen/vim-subversive' " Replace stuff + Plug 'tpope/vim-commentary' " commenting + - Plug 'mhinz/vim-signify' - Plug 'kassio/neoterm' " Terminal utils - Plug 'vim-scripts/regreplop.vim' " replace! " TODO possibly re-enable this but figure out how to make it not conflict with " CoC.nvim " Plug 'dense-analysis/ale' " Async Lint Engine - Plug 'vim-scripts/YankRing.vim' " Keep track of past yanked values - Plug 'vim-scripts/tComment' " Comment stuff - Plug 'junegunn/goyo.vim' " Writing mode - Plug 'preservim/tagbar' " ctags! - Plug 'lvht/tagbar-markdown' " tagbar for md files + " Plug 'vim-scripts/YankRing.vim' " (SLOW) Keep track of past yanked values + " Plug 'vim-scripts/tComment' " Comment stuff + " Plug 'junegunn/goyo.vim' " Writing mode + " Plug 'preservim/tagbar' " ctags! + " Plug 'lvht/tagbar-markdown' " tagbar for md files + " Plug 'liuchengxu/vista.vim' Plug 'michaeljsmith/vim-indent-object' " indent objects - Plug 'junegunn/vim-easy-align' " alignment! - Plug 'mileszs/ack.vim' " search file contents via ag or ack - Plug 'simnalamburt/vim-mundo' " Vim undo tree viz + " Plug 'junegunn/vim-easy-align' " alignment! + " Plug 'mileszs/ack.vim' " search file contents via ag or ack + " Plug 'simnalamburt/vim-mundo' " Vim undo tree viz + " Plug 'chr4/sslsecure.vim' " Highlight insecure SSL configuration - " Superfast fuzzy file finder + + " Fuzzy file finder + Plug 'nvim-lua/popup.nvim' + Plug 'nvim-lua/plenary.nvim' + Plug 'nvim-telescope/telescope.nvim' " Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " Plug '/usr/local/opt/fzf' " installed via Homebrew " Plug 'junegunn/fzf.vim' " if you want latest fzf use this instead " Plug 'junegunn/fzf', { 'do': './install --all' } - Plug 'junegunn/fzf', { 'do': './install --bin' } - Plug 'junegunn/fzf.vim' + " Plug 'junegunn/fzf', { 'do': './install --bin' } + " Plug 'junegunn/fzf.vim' " Use actual tmux instead " Plug 'Vigemus/nvimux' " Tmux-like key bindings for NeoVim + " Status line + Plug 'hoob3rt/lualine.nvim' + " " Powerline alternatives - Plug 'vim-airline/vim-airline' - Plug 'vim-airline/vim-airline-themes' - - Plug 'gcmt/taboo.vim' - - " Completion and snippets - Plug 'ncm2/ncm2' - Plug 'roxma/nvim-yarp' - " Plug 'ncm2/ncm2-tmux' " don't use tmux anymore - Plug 'ncm2/ncm2-path' " bufpath, cwdpath, rootpath - Plug 'ncm2/ncm2-github' " github users, repos, links, issues, emoji - Plug 'ncm2/ncm2-bufword' " words from current buffer for completion - " View https://github.com/ncm2/ncm2/wiki for more completion plugins - " Plug 'ncm2/ncm2-ultisnips' " TODO test this - " Plug 'SirVer/ultisnips' " throws runtime errors - " Plug 'honza/vim-snippets' " Do we need this? + " Plug 'vim-airline/vim-airline' + " Plug 'vim-airline/vim-airline-themes' + + " Plug 'gcmt/taboo.vim' " Tabs " TypeScript - Plug 'pangloss/vim-javascript' - Plug 'leafgarland/typescript-vim' - Plug 'peitalin/vim-jsx-typescript' + " Plug 'pangloss/vim-javascript' + " Plug 'leafgarland/typescript-vim' + " Plug 'peitalin/vim-jsx-typescript' " Language Service Client " Originally configured for TypeScript following " https://thoughtbot.com/blog/modern-typescript-and-react-development-in-vim - Plug 'neoclide/coc.nvim', {'branch': 'release'} - Plug 'neoclide/coc.nvim', {'branch': 'release'} - let g:coc_global_extensions = [ - \ 'coc-tsserver' - \ ] + " Plug 'neoclide/coc.nvim', {'branch': 'release'} + " let g:coc_global_extensions = [ + " \ 'coc-tsserver' + " \ ] " Plug 'HerringtonDarkholme/yats.vim' " TS Syntax " Plug 'mhartington/nvim-typescript', {'do': './install.sh'} " TSServer client @@ -190,6 +205,8 @@ set undolevels=1000 set nocursorline nocursorcolumn " vim is slow with these on :/ + imap kj + " don't auto resize window on splitting " set noequalalways @@ -233,8 +250,6 @@ set wrapmargin=1 " prevent double spaces when joining with C-j set nojoinspaces - " Completion - set complete=.,w,b,u,t,i,],kspell set spelllang=en_us " whitespace characters set list listchars=tab:»·,trail:·,nbsp:· @@ -402,6 +417,8 @@ set foldtext=MyFoldText() + set foldlevel=3 + " Use marker foldmethod for specific file types autocmd FileType yaml,vim,zsh,sh,make setlocal foldmethod=marker foldlevel=0 nnoremap z za " easier toggling @@ -410,8 +427,22 @@ set fdo-=search " }}} +" Lualine {{{ + + +lua << EOF +require'lualine'.setup{ + options = { theme = 'solarized_light' }, +} +EOF + +" }}} + + " Aesthetics {{{ + let g:neosolarized_vertSplitBgTrans = 1 + " This must be defined before activating colorscheme " augroup my_neomake_signs @@ -422,22 +453,22 @@ " augroup END fun! CustomizeDarkColors() - " Remove background on vertical splits - " Hide the ~ characters at end of files - " Customize Folds - if &background == 'dark' - hi VertSplit ctermbg=0 ctermfg=0 guibg=#FAF2DC - hi NonText cterm=NONE gui=NONE guibg=NONE guifg=#FAF2DC ctermbg=0 ctermfg=0 - hi ColorColumn ctermbg=black - hi Folded cterm=bold ctermfg=cyan ctermbg=black - hi FoldColumn cterm=reverse - hi fmrkr ctermbg=black ctermfg=black - else - hi NonText ctermbg=7 ctermfg=7 - hi ColorColumn ctermbg=7 - hi VertSplit ctermbg=7 ctermfg=7 - hi fmrkr ctermbg=7 ctermfg=7 - endif + " " Remove background on vertical splits + " " Hide the ~ characters at end of files + " " Customize Folds + " if &background == 'dark' + " hi VertSplit ctermbg=0 ctermfg=0 guibg=#FAF2DC + " hi NonText cterm=NONE gui=NONE guibg=NONE guifg=#FAF2DC ctermbg=0 ctermfg=0 + " hi ColorColumn ctermbg=black + " hi Folded cterm=bold ctermfg=cyan ctermbg=black + " hi FoldColumn cterm=reverse + " hi fmrkr ctermbg=black ctermfg=black + " else + " hi NonText ctermbg=7 ctermfg=7 + " hi ColorColumn ctermbg=7 + " hi VertSplit ctermbg=7 ctermfg=7 + " hi fmrkr ctermbg=7 ctermfg=7 + " endif endfun augroup vimrc @@ -449,13 +480,15 @@ autocmd BufRead,BufNewFile * syn match fmrkr '"*{{{\|"*}}}' | \ syn cluster vimCommentGroup contains=fmrkr - colorscheme solarized + " colorscheme solarized + colorscheme NeoSolarized + set termguicolors " https://github.com/overcache/NeoSolarized set colorcolumn=80 set guioptions=egmt set bg=dark - let g:airline_powerline_fonts = 1 + let g:airline_powerline_fonts = 1 " Only load the Airline extensions we want " let g:airline_extensions = ['tabline', 'ale', 'fugitive'] @@ -492,11 +525,6 @@ nnoremap bgl :set bg=light nnoremap bgd :set bg=dark - " set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Nerd\ Font\ Complete\ 12 - " set guifont=Knack\ Nerd\ Font\ Regular:12 - " set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types:h11 - " Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 11 - " Remove vertical split pipe set fillchars= @@ -525,16 +553,309 @@ " }}} -" NERDTree {{{ - map nt :NERDTreeFocus - map ntf :NERDTreeFind - map ntc :NERDTreeClose - " Stay in sync with current working directory - let NERDTreeChDirMode=2 - let NERDTreeQuitOnOpen=0 - let NERDTreeMapToggleHidden=1 - let NERDTreeCascadeSingleChildDir=0 " do not collapse - let NERDTreeShowHidden=1 +" Replace / substitute {{{ + " s for substitute + nmap s (SubversiveSubstitute) + nmap ss (SubversiveSubstituteLine) + nmap S (SubversiveSubstituteToEndOfLine) +" }}} + +" TreeSitter {{{ + +lua <xx TroubleToggle +nnoremap xw TroubleToggle lsp_workspace_diagnostics +nnoremap xd TroubleToggle lsp_document_diagnostics +nnoremap xq TroubleToggle quickfix +nnoremap xl TroubleToggle loclist +nnoremap gR TroubleToggle lsp_references +" }}} + +" LSP {{{ + +lua << EOF +local nvim_lsp = require('lspconfig') + +-- Use an on_attach function to only map the following keys +-- after the language server attaches to the current buffer + +-- local on_attach = function(client, bufnr) +-- local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end +-- local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end +-- +-- -- Enable completion triggered by +-- buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') +-- +-- -- Mappings. +-- local opts = { noremap=true, silent=true } +-- +-- -- See `:help vim.lsp.*` for documentation on any of the below functions +-- buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) +-- buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) +-- buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) +-- buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) +-- buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) +-- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) +-- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) +-- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) +-- buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) +-- buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) +-- buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) +-- buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) +-- buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) +-- buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) +-- buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) +-- buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) +-- buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) +-- +-- end +-- Use a loop to conveniently call 'setup' on multiple servers and +-- map buffer local keybindings when the language server attaches +-- local servers = { 'tsserver' } +-- for _, lsp in ipairs(servers) do +-- nvim_lsp[lsp].setup { +-- on_attach = on_attach, +-- flags = { +-- debounce_text_changes = 150, +-- } +-- } +-- end + + +-- https://jose-elias-alvarez.medium.com/configuring-neovims-lsp-client-for-typescript-development-5789d58ea9c + +local nvim_lsp = require("lspconfig") +local format_async = function(err, _, result, _, bufnr) + if err ~= nil or result == nil then return end + if not vim.api.nvim_buf_get_option(bufnr, "modified") then + local view = vim.fn.winsaveview() + vim.lsp.util.apply_text_edits(result, bufnr) + vim.fn.winrestview(view) + if bufnr == vim.api.nvim_get_current_buf() then + vim.api.nvim_command("noautocmd :update") + end + end +end +vim.lsp.handlers["textDocument/formatting"] = format_async +_G.lsp_organize_imports = function() + local params = { + command = "_typescript.organizeImports", + arguments = {vim.api.nvim_buf_get_name(0)}, + title = "" + } + vim.lsp.buf.execute_command(params) +end +local on_attach = function(client, bufnr) + local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + require'completion'.on_attach(client, bufnr) + + -- Enable completion triggered by + buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + + local buf_map = vim.api.nvim_buf_set_keymap + vim.cmd("command! LspDef lua vim.lsp.buf.definition()") + vim.cmd("command! LspFormatting lua vim.lsp.buf.formatting()") + vim.cmd("command! LspCodeAction lua vim.lsp.buf.code_action()") + vim.cmd("command! LspHover lua vim.lsp.buf.hover()") + vim.cmd("command! LspRename lua vim.lsp.buf.rename()") + vim.cmd("command! LspOrganize lua lsp_organize_imports()") + vim.cmd("command! LspRefs lua vim.lsp.buf.references()") + vim.cmd("command! LspTypeDef lua vim.lsp.buf.type_definition()") + vim.cmd("command! LspImplementation lua vim.lsp.buf.implementation()") + vim.cmd("command! LspDiagPrev lua vim.lsp.diagnostic.goto_prev()") + vim.cmd("command! LspDiagNext lua vim.lsp.diagnostic.goto_next()") + vim.cmd( + "command! LspDiagLine lua vim.lsp.diagnostic.show_line_diagnostics()") + vim.cmd("command! LspSignatureHelp lua vim.lsp.buf.signature_help()") +buf_map(bufnr, "n", "gd", ":LspDef", {silent = true}) + buf_map(bufnr, "n", "gr", ":LspRename", {silent = true}) + buf_map(bufnr, "n", "gR", ":LspRefs", {silent = true}) + buf_map(bufnr, "n", "gy", ":LspTypeDef", {silent = true}) + buf_map(bufnr, "n", "K", ":LspHover", {silent = true}) + buf_map(bufnr, "n", "gs", ":LspOrganize", {silent = true}) + buf_map(bufnr, "n", "[a", ":LspDiagPrev", {silent = true}) + buf_map(bufnr, "n", "]a", ":LspDiagNext", {silent = true}) + buf_map(bufnr, "n", "ga", ":LspCodeAction", {silent = true}) + buf_map(bufnr, "n", "a", ":LspDiagLine", {silent = true}) + buf_map(bufnr, "i", "", " LspSignatureHelp", + {silent = true}) +if client.resolved_capabilities.document_formatting then + vim.api.nvim_exec([[ + augroup LspAutocommands + autocmd! * + autocmd BufWritePost LspFormatting + augroup END + ]], true) + end +end + + +nvim_lsp.tsserver.setup { + on_attach = function(client) + client.resolved_capabilities.document_formatting = false + on_attach(client) + end +} +local filetypes = { + typescript = "eslint", + typescriptreact = "eslint", +} +local linters = { + eslint = { + sourceName = "eslint", + command = "eslint_d", + rootPatterns = {".eslintrc.js", "package.json"}, + debounce = 100, + args = {"--stdin", "--stdin-filename", "%filepath", "--format", "json"}, + parseJson = { + errorsRoot = "[0].messages", + line = "line", + column = "column", + endLine = "endLine", + endColumn = "endColumn", + message = "${message} [${ruleId}]", + security = "severity" + }, + securities = {[2] = "error", [1] = "warning"} + } +} +local formatters = { + prettier = {command = "eslint_d", args = {"--fix-to-stdout", "--stdin", "--stdin-filename", "%filepath"}} +} +local formatFiletypes = { + typescript = "prettier", + typescriptreact = "prettier" +} +nvim_lsp.diagnosticls.setup { + on_attach = on_attach, + filetypes = vim.tbl_keys(filetypes), + init_options = { + filetypes = filetypes, + linters = linters, + formatters = formatters, + formatFiletypes = formatFiletypes + } +} + + +EOF + +" au BufEnter * typescript require'completion'.on_attach() + +" }}} + +" Completion {{{ + +" Use and to navigate through popup menu +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" + +" Set completeopt to have a better completion experience +set completeopt=menuone,noinsert,noselect + +" Avoid showing message extra message when using completion +set shortmess+=c + +lua <" + elseif vim.fn.call("vsnip#available", {1}) == 1 then + return t "(vsnip-expand-or-jump)" + else + return t "" + end +end +_G.s_tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t "" + elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then + return t "(vsnip-jump-prev)" + else + return t "" + end +end + +vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) + +-- Chain completion list +vim.g.completion_chain_complete_list = { + default = { + default = {{complete_items = {'lsp', 'snippet', 'buffers'}}, {mode = ''}, {mode = ''}}, + comment = {}, + string = {{complete_items = {'path'}}} + } +} + +-- use .ts snippets in .tsx files +vim.g.vsnip_filetypes = { + typescriptreact = {"typescript"} +} +EOF + + +let g:completion_chain_complete_list = [ + \{'complete_items': ['lsp', 'snippet']}, + \{'mode': ''}, + \{'mode': ''} +\] + + +" }}} + +" File explorer {{{ + + " NERDTree + " map nt :NERDTreeFocus + " map ntf :NERDTreeFind + " map ntc :NERDTreeClose + " " Stay in sync with current working directory + " let NERDTreeChDirMode=2 + " let NERDTreeQuitOnOpen=0 + " let NERDTreeMapToggleHidden=1 + " let NERDTreeCascadeSingleChildDir=0 " do not collapse + " let NERDTreeShowHidden=1 + + " NvimTree + nnoremap tt :NvimTreeToggle + nnoremap tr :NvimTreeRefresh + nnoremap tf :NvimTreeFindFile + " }}} " tbone {{{ @@ -683,17 +1004,33 @@ nnoremap cy :let @"=@+ " }}} +" Telescope fuzzy finder {{{ + " Find files using Telescope command-line sugar. + nnoremap ff Telescope find_files + nnoremap p Telescope git_files + nnoremap fg Telescope live_grep + nnoremap fb Telescope buffers + nnoremap fh Telescope help_tags + nnoremap fl Telescope git_files + nnoremap tgb Telescope git_branches + nnoremap tts Telescope treesitter + + " :lua require'telescope.builtin'.planets{} + " :nnoremap pp :lua require'telescope.builtin'.planets{} + +" }}} + " fzf {{{ " let g:fzf_layout = { 'left': '~30%' } " ctrl-p replacement - nmap p :Files - nmap bp :Buffers - " line wise completion - imap (fzf-complete-line) - " find commits - nnoremap fc :Commits - " find lines - nnoremap fl :Lines + " nmap p :Files + " nmap bp :Buffers + " " line wise completion + " imap (fzf-complete-line) + " " find commits + " nnoremap fc :Commits + " " find lines + " nnoremap fl :Lines " }}} @@ -831,7 +1168,6 @@ " TypeScript {{{ " From https://github.com/peitalin/vim-jsx-typescript autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx - hi tsxTag guifg=#F99575 ctermfg=lightgray hi tsxTagName guifg=#E06C75 ctermfg=darkblue hi tsxCloseString guifg=#F99575 ctermfg=darkblue @@ -855,58 +1191,8 @@ hi WebBrowser ctermfg=204 guifg=#56B6C2 hi ReactLifeCycleMethods ctermfg=204 guifg=#D19A66 - - " COC for TypeScript - nmap gd (coc-definition) - nmap gy (coc-type-definition) - nmap gr (coc-references) - nmap [g (coc-diagnostic-prev) - nmap ]g (coc-diagnostic-next) - - " Apply AutoFix to problem on the current line. - nmap qf (coc-fix-current) - nmap do (coc-codeaction) - - " Symbol renaming. - nmap rn (coc-rename) - - " Applying codeAction to the selected region. - " Example: `aap` for current paragraph - xmap a (coc-codeaction-selected) - nmap a (coc-codeaction-selected) - - " In the future we could allow this shortcut for other languages that use LSP - " Use K to show documentation in preview window - autocmd FileType typescript nnoremap K :call show_documentation() - - function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - else - call CocAction('doHover') - endif - endfunction - - if isdirectory('./node_modules') && isdirectory('./node_modules/prettier') - let g:coc_global_extensions += ['coc-prettier'] - endif - - if isdirectory('./node_modules') && isdirectory('./node_modules/eslint') - let g:coc_global_extensions += ['coc-eslint'] - endif - " Give more space for displaying messages. - set cmdheight=2 - - " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable - " delays and poor user experience. - set updatetime=300 - - " Don't pass messages to |ins-completion-menu|. - set shortmess+=c - - - + " set cmdheight=2 " }}} " }}} @@ -951,38 +1237,6 @@ nnoremap yr :YRShow autocmd FileType typescript.jsx setlocal commentstring=//\ %s " }}} -" ncm2 and UltiSnips {{{ - - " When the key is pressed while the popup menu is visible, it only - " hides the menu. Use this mapping to hide the menu and also start a new line. - " inoremap (pumvisible() ? "\\" : "\") - - " let g:UltiSnipsSnippetsDir='~/.vim_snippets' - " let g:UltiSnipsSnippetDirectories = ['UltiSnips', $HOME.'/.vim_snippets'] - - " let g:UltiSnipsExpandTrigger = "(ultisnips_expand)" - " let g:UltiSnipsExpandTrigger = "" - - " let g:UltiSnipsJumpForwardTrigger = "" - " let g:UltiSnipsJumpBackwardTrigger = "" - " let g:UltiSnipsRemoveSelectModeMappings = 0 - " inoremap =cm#sources#ultisnips#trigger_or_popup("\(ultisnips_expand)") - - " enable ncm2 for all buffers - " autocmd BufEnter * call ncm2#enable_for_buffer() - - " noesnippet - " imap (neosnippet_expand_or_jump) - " vmap (neosnippet_expand_or_jump) - " inoremap =cm#sources#neosnippet#trigger_or_popup("\(neosnippet_expand_or_jump)") - " vmap (neosnippet_expand_target) - " " expand parameters - " let g:neosnippet#enable_completed_snippet=1 - " let g:neosnippet#snippets_directory=$HOME.'/.vim_snippets' - - -" }}} - " JavaScript {{{ let g:jsx_ext_required = 0 " }}} diff --git a/vim-plugins-profile-master/.github/ISSUE_TEMPLATE/bug_report.md b/vim-plugins-profile-master/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..f702048 --- /dev/null +++ b/vim-plugins-profile-master/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Install (n)vim version +2. Provide a link for your .vimrc or other vim config (please remove any personal information) +3. What command to run +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** + - OS: [e.g. iOS] + - Vim [e.g. vi, vim, neovim] and version + - vim plugin manager and version [e.g. vim-plug, pathogen etc.] + - link to a pastebin with the profile file (generate it with `vim --startuptime output.log` and upload `output.log` to a pastebin like paste.debian.net or Github Gist) + +**Additional context** +Add any other context about the problem here. diff --git a/vim-plugins-profile-master/.github/ISSUE_TEMPLATE/feature_request.md b/vim-plugins-profile-master/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..c398bfe --- /dev/null +++ b/vim-plugins-profile-master/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,26 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. + +** Environment ** +- OS: [e.g. iOS] +- Vim [e.g. vi, vim, neovim] and version +- vim plugin manager and version [e.g. vim-plug, pathogen etc.] +- link to a pastebin with the profile file (generate it with vim --startuptime output.log and upload output.log to a pastebin like paste.debian.net or Github Gist) diff --git a/vim-plugins-profile-master/.gitignore b/vim-plugins-profile-master/.gitignore new file mode 100644 index 0000000..88456a1 --- /dev/null +++ b/vim-plugins-profile-master/.gitignore @@ -0,0 +1,30 @@ +# History files +.Rhistory +.Rapp.history + +# Session Data files +.RData + +# Example code in package build process +*-Ex.R + +# RStudio files +.Rproj.user/ + +# produced vignettes +vignettes/*.html +vignettes/*.pdf + +# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 +.httr-oauth + +*~ + +*.csv +*.png +*.svg + +*.Rproj.user +.Rproj.user +*.Rproj +*.log diff --git a/vim-plugins-profile-master/.travis.yml b/vim-plugins-profile-master/.travis.yml new file mode 100644 index 0000000..f30f717 --- /dev/null +++ b/vim-plugins-profile-master/.travis.yml @@ -0,0 +1,55 @@ +language: r +r: + - release + #- devel + +dist: xenial +os: linux + +branches: + only: + - master + - develop + +addons: + apt: + packages: + - vim + - ruby + - python-matplotlib + # - r-base + # - r-base-dev + +install: + # Install vim plugins + - curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + - cp .travis/vimrc ~/.vimrc + - vim -u ~/.vimrc +PlugInstall +qall + +before_script: + - mkdir -p ~/R/library + - export R_LIBS_USER="~/R/library/" + +cache: + directories: + - $TRAVIS_BUILD_DIR/packrat/src + - $TRAVIS_BUILD_DIR/packrat/lib + - $R_LIBS_USER + packages: true + +script: + - vim --version + - python --version + - perl --version + - ruby --version + - R --version + - python ./vim-plugins-profile.py vim -u NONE + - python ./vim-plugins-profile.py vim -u .travis/vimrc + - python ./vim-plugins-profile.py -n 5 vim -u .travis/vimrc + - python ./vim-plugins-profile.py -n 5 -r 10 vim -u .travis/vimrc + - python ./vim-plugins-profile.py -s vim -N -u NORC + - perl ./vim-plugins-profile.pl + - ruby ./vim-plugins-profile.rb + - yes | bash vim-plugins-profile.sh + #- find ~/R/ + #- ls -laR ~/R/ diff --git a/vim-plugins-profile-master/.travis/vimrc b/vim-plugins-profile-master/.travis/vimrc new file mode 100644 index 0000000..58a5006 --- /dev/null +++ b/vim-plugins-profile-master/.travis/vimrc @@ -0,0 +1,13 @@ +set nocompatible + +call plug#begin('~/.vim/plugged') + +" Add a bunch of random plugins +Plug 'tpope/vim-surround' +Plug 'tomtom/tcomment_vim' +Plug 'tpope/vim-fugitive' +Plug 'octol/vim-cpp-enhanced-highlight' +Plug 'ervandew/supertab' +Plug 'jiangmiao/auto-pairs' + +call plug#end() diff --git a/vim-plugins-profile-master/LICENSE b/vim-plugins-profile-master/LICENSE new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/vim-plugins-profile-master/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/vim-plugins-profile-master/README.md b/vim-plugins-profile-master/README.md new file mode 100644 index 0000000..074bae2 --- /dev/null +++ b/vim-plugins-profile-master/README.md @@ -0,0 +1,146 @@ +[![Build Status](https://api.travis-ci.org/hyiltiz/vim-plugins-profile.svg?branch=master)](https://travis-ci.org/hyiltiz/vim-plugins-profile) + +## TL;DR +```{BASH} +# Perl version as an example: +perl <(curl -sSL https://raw.githubusercontent.com/hyiltiz/vim-plugins-profile/master/vim-plugins-profile.pl) + +# or Ruby +ruby <(curl -sSL https://raw.githubusercontent.com/hyiltiz/vim-plugins-profile/master/vim-plugins-profile.rb) + +# or Python (add -p flat to plot a bar chart) +python <(curl -sSL https://raw.githubusercontent.com/hyiltiz/vim-plugins-profile/master/vim-plugins-profile.py) + +# or R +bash <(curl -sSL https://raw.githubusercontent.com/hyiltiz/vim-plugins-profile/master/vim-plugins-profile.sh) +``` + +Here is a screenshot to have a quick look at what this is all about. + +![My Plugins Profile](./test/result.png) + +Here is a peek at the profiling result for my plugins: + +``` + +Generating vim startup profile... +Parsing vim startup profile... +Crunching data and generating profile plot ... + +Your plugins startup profile graph is saved +as `profile.png` under current directory. + +========================================== +Top 10 Plugins That Slows Down Vim Startup +========================================== + 1 105.13 "vim-colorschemes" + 2 42.661 "vim-easytags" + 3 31.173 "vim-vendetta" + 4 22.02 "syntastic" + 5 13.362 "vim-online-thesaurus" + 6 7.888 "vim-easymotion" + 7 6.931 "vim-airline" + 8 6.608 "YankRing.vim" + 9 5.266 "nerdcommenter" + 10 5.017 "delimitMate" +========================================== +Done! +``` + +## Story + +If you use `vim-plug` (or other amazing plugin manager of your choice) to install +your vim (gvim or macvim) plugins, then chances are high that it gets +addictive. You will find yourself with several dozens of useful plugins. + +`vim-plug` (and `NeoBundle`) offers you to load your plugins on-demand (lazy-loading). But +which needs fine tuning? Well, using vim's built-in profiling `vim +--startuptime` you can get a timing for all function calls during +startup. However, the data is for each functions. You will have to +figure out the math, and make sure those functions calls are form the +same plugins. Even some sorting might help, but sorting the timing for +each functions does not really make sense because it is really time of the +plugins (but not the functions) that you really care about. + +I am poor at doing mental math, even for simple sums. However, with the power +of a simple bash script and `R`, we can get all we want. + +This utility automatically detects your plugins directory, and does the +rest of the hard work for you. + + +### Supported Plugin-Managers + +Here is the list of supported managers. Hopefully, your favourite plugin manager is among the list. If not, or if you prefer to manage your own plguins (using symlinks, of course), we could still adjust the code. + + - [vim-plug] + - [NeoBundle] + - [Vundle] + - [Pathogen] + + +### Installation + +This is *NOT* a vim plugin! This is simply a profiler for your vim +plugins that are installed through various plugin managers such as +`vim-plug`. + +Download the `.zip` [here][zip] and then simply run the bash script: + + +```BASH +bash ./vim-plugins-profile.sh # calls R after pre-processing + +# Use Perl powers! Built-in RegEx, no dependencies. +perl ./vim-plugins-profile.pl + +# Or Python if you are from the other camp. +python ./vim-plugins-profile.py # -p flag plots a bar chart + +# Alternatively use Ruby powers! Less dependency, graph with ASCII art +ruby ./vim-plugins-profile.rb + +# To use an alternative executable such as neovim, pass it as the first argument. +ruby ./vim-plugins-profile.rb nvim +``` + +Then open the `profile.png` file for the result! It is that simple. + +You can run it even without installation: + +### Dependency + +*Nothing*. Well, at least `Bash` or `Ruby` or `Perl` or `Python`, but most systems already come with those pre-installed already. + +If not (e.g. in M\$ Windows systems), then you will need to install several tools before you can run this. + +For the Perl Version: + + - Git for Windows: The Git Bash contains a minimal Perl installation which is sufficient to run `vim-plugins-profile.pl`. + +For the Ruby Version: + + - Bash (Cygwin, or Git for Windows will also work). + - Ruby 2.3 (other version might as well just work. If not, you can repurt an Issue then I'll fix it) + +To produce the eye-candy graphs, you can use either `R`, `Perl` + `GNUplot` or `Python`. + +For `R`, the script prompts whether it should install the `R:ggplot2` package if you already have `R`. Here are the list of dependencies for it: + + - [R] + - [R:ggplot2] (the ggplot2 package for R) + +For `Python`, you can use either `python2` or `python3`. If you have +`matplotlib` (optional) installed, then you can even generate the bar plot. +Implementation for people from the Python camp is merged from [@bchretien](https://github.com/bchretien/vim-profiler). It also supports a custom command to run in the exec mode. Feel free to hack your way! + + + +[zip]: https://github.com/hyiltiz/vim-plugins-profile/archive/master.zip +[vim-plug]: https://github.com/junegunn/vim-plug +[GNUplot]: http://www.gnuplot.info +[R]: https://cran.r-project.org/ +[R:ggplot2]: http://ggplot2.org/ +[NeoBundle]: https://github.com/Shougo/neobundle.vim +[Vundle]: https://github.com/VundleVim/Vundle.vim +[Pathogen]: https://github.com/tpope/vim-pathogen diff --git a/vim-plugins-profile-master/vim-plugins-profile-plot.R b/vim-plugins-profile-master/vim-plugins-profile-plot.R new file mode 100644 index 0000000..e8eea42 --- /dev/null +++ b/vim-plugins-profile-master/vim-plugins-profile-plot.R @@ -0,0 +1,91 @@ +# vim-plugins-profile project data parser and plotter script +# Copyright 2015-2020, Hörmet Yiltiz +# Released under GNU GPL version 3 or later. + +if("ggplot2" %in% rownames(installed.packages()) == FALSE) { + + isOk <- FALSE + # we need to install the ggplot2 package + while(!isOk){ + message("Trying in install the required R:ggplot2 package. Confirm? (y/n)") + ANSWER <- readLines(con="stdin", 1) + if (tolower(substr(ANSWER, 1,1)) == "y" ) { + isOk = TRUE + message("Confirmed to install.") + message(" ") + message("==========================================\n") + message("Installing required R dependency package...\n") + + # install the required package if not present from the default package repository + install.packages("ggplot2", repos="http://cran.rstudio.com/", dep = TRUE) + message("Installation finished!\n") + message("==========================================\n") + } + else { + isOk = FALSE + message("You did not say yes, so aborting.") + return(-1) + } + } +} + + +out <- tryCatch( + { + require(ggplot2) + dat <- read.csv("profile.csv", header = FALSE, col.names = c("TraceTime", "SourceTime", "ExecTime", "PluginName")) + dat.n <- aggregate(ExecTime ~ PluginName, data = dat, "sum") + + # now plot! + p <- ggplot(dat.n, aes(x = reorder(PluginName, ExecTime), y = ExecTime, fill = ExecTime)) + + geom_bar(stat="identity") + + xlab("Total Execution Time (ms)") + coord_flip() + + # add in the colors! + p <- p + scale_fill_continuous(low = "blue", high = "red", na.value = "grey50", trans = "sqrt", guide= FALSE) + + # use this if you hate colors to get grey figure + # p <- p + scale_fill_continuous(low = "grey50", high = "grey50", na.value = "grey50", trans = "sqrt", guide= FALSE) + + png("result.png", width = 768, height = 768, bg = "transparent") + print(p) + dev.off() + pdf("result.pdf", width = 768, height = 768, bg = "transparent") + print(p) + dev.off() + svg("result.svg", width = 768, height = 768, bg = "transparent") + print(p) + dev.off() + + # sort the data, then save .csv for the result + dat.n <- dat.n[order(dat.n$ExecTime, decreasing = TRUE),] + dat.n <- dat.n[,2:1] + png("result.png", width = 1366, height = 768) + print(p) + dev.off() + write.table(dat.n, "result.csv", sep = "\t", row.names = FALSE) + + }, + error=function(cond) { + message("Package R caused an error!") + message("Here's the original error message:") + message(cond) + # Choose a return value in case of error + return(NA) + }, + warning=function(cond) { + message("Package R caused a warning:") + message("Here's the original warning message:") + message(cond) + # Choose a return value in case of warning + return(NULL) + }, + finally={ + # NOTE: + # Here goes everything that should be executed at the end, + # regardless of success or error. + + # Do nothing + } + ) diff --git a/vim-plugins-profile-master/vim-plugins-profile.pl b/vim-plugins-profile-master/vim-plugins-profile.pl new file mode 100755 index 0000000..4694d16 --- /dev/null +++ b/vim-plugins-profile-master/vim-plugins-profile.pl @@ -0,0 +1,114 @@ +#!/usr/bin/perl +# Copyright (C) 2020, Gerhard Gappmeier +# This file is based on vim-plugins-profile.rb, which is much better +# readable than the python variant. +use strict; +use File::Basename; +#use Smart::Comments; # comment in this to enable smart comments + +# Users can pass "nvim" as a first argument to use neovim. +my $vim = $ARGV[0] // 'vim'; # vim to use +my $logfile = "vim-plugins-profile.$$.log"; # logfile for profiling +my $plugdir; # plugin manager directory +my $gnuplot = '/usr/bin/gnuplot'; # path to gnuplot binary +### logfile: $logfile + +# detect vim config dir +my $XDG_CONFIG_HOME = $ENV{'XDG_CONFIG_HOME'} // "$ENV{'HOME'}/.config"; +my $VIMFILES_DIR = ($vim eq "nvim") ? "$XDG_CONFIG_HOME/nvim" : "$ENV{HOME}/.vim"; +print "Assuming your vimfiles folder is $VIMFILES_DIR.\n"; + +# start vim with logging and execute the quit command +print "Generating ${vim} startup profile...\n"; +system("$vim --startuptime $logfile -c q"); + +# detect plugin manager +if (-d "$VIMFILES_DIR/plugged") { + print "vim-plug has been detected.\n"; + $plugdir = "plugged"; +} elsif (-d "$VIMFILES_DIR/bundle") { + print "NeoBundle/Vundle/Pathogen has been detected.\n"; + $plugdir = "bundle"; +} else { + print "Cannot tell your plugin-manager. Adjust this script to meet your own needs for now.\n"; + print "Cue: `plug_dir` variable would be a good starting place.\n"; + exit 1; +} + +# now parse the Vim profile +my %profile; # hash with profile data +my $rxtime = qr/\d+\.\d+/; # regex for time values +my $plugpath = "$VIMFILES_DIR/$plugdir/"; # path to plugin manager +my $pluginpath = "$VIMFILES_DIR/plugin/"; # path to Vim's plugin dir +open PROFILE, "<$logfile" or die("Could not open $logfile: $!"); +while () { + if (/($rxtime) ($rxtime) ($rxtime): sourcing (.*)$/) { + my ($trace_time, $source_time, $exec_time, $path) = ($1, $2, $3, $4); + my $name; + if ($path =~ m/$plugpath/) { # files from plugin manager + $path =~ s/$plugpath//; + ($name) = split(/\//, $path); # get 1st folder name + $name .= " ($plugdir)"; + } elsif ($path =~ m/$pluginpath/) { # files from plugin subfolder (the old way of plugins) + $path =~ s/$pluginpath//; + ($name) = split(/\//, $path); # get 1st folder name + $name .= " (plugin)"; + } else { # other system files, e.g. from /usr/share + $name = $path; + } + $profile{$name} += $exec_time; # sum up the time per name + } +} +close PROFILE; +unlink $logfile; + +# output +my $idx = 0; +foreach my $name (sort { $profile{$b} <=> $profile{$a} } keys %profile) { + my $time = $profile{$name}; + printf "%40s: (%.3fms) %s\n", $name, $time, '*' x $time; + last if ($idx == 30); # limit output to 30 highest values + $idx++; +} + +# gnuplot +if (-x $gnuplot) { + print "Plotting using GNUplot...\n"; + # plot data + open DATA, ">result.dat" or die("Could not open result.dat: $!"); + print DATA "# Idx\tName\tTime\n"; + my $idx = 1; + foreach my $name (sort { $profile{$b} <=> $profile{$a} } keys %profile) { + my $time = $profile{$name}; + printf DATA "$idx\t$name\t$time\n"; + last if ($idx == 30); # limit output to 30 highest values + $idx++; + } + close DATA; + + open GNUPLOT, ">result.gp" or die("Could not open result.gp $!"); + print GNUPLOT <<"EOF"; +set title "Vim Profile" +set datafile separator "\t" +#set auto x +set style data histogram +set style fill solid border -1 +set style histogram errorbars gap 2 lw 1 +set boxwidth 0.9 +set ylabel "Execution Time [ms]" +set xtics rotate by 45 right +set grid ytics +set yrange [0:*] +set palette model RGB defined ( 0 'green', 1 'red' ) +unset colorbox +set terminal pngcairo size 1280,1024 enhanced font 'Verdana,10' +set output "result.png" +plot 'result.dat' using 1:3:3:xtic(2) title "time [ms]" w boxes palette +EOF + close GNUPLOT; + system("$gnuplot result.gp") == 0 or die("gnuplot failed: $!"); + print "Finished. Open result.png to view the plot.\n"; +} else { + print "No GNUplot found. Skip plotting.\n"; +} + diff --git a/vim-plugins-profile-master/vim-plugins-profile.py b/vim-plugins-profile-master/vim-plugins-profile.py new file mode 100755 index 0000000..e47f0ee --- /dev/null +++ b/vim-plugins-profile-master/vim-plugins-profile.py @@ -0,0 +1,328 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# vim-profiler - Utility script to profile (n)vim (e.g. startup) +# Copyright © 2015 Benjamin Chrétien +# Copyright © 2017-2020 Hörmet Yiltiz +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from __future__ import print_function + +import os +import sys +import subprocess +import re +import csv +import operator +import argparse +import collections + + +def to_list(cmd): + if not isinstance(cmd, (list, tuple)): + cmd = cmd.split(' ') + return cmd + + +def get_exe(cmd): + # FIXME: this assumes that the first word is the executable + return to_list(cmd)[0] + + +def is_subdir(paths, subdir): + # See: http://stackoverflow.com/a/18115684/1043187 + for path in paths: + path = os.path.realpath(path) + subdir = os.path.realpath(subdir) + reldir = os.path.relpath(subdir, path) + if not (reldir == os.pardir or reldir.startswith(os.pardir + os.sep)): + return True + return False + + +def stdev(arr): + """ + Compute the standard deviation. + """ + if sys.version_info >= (3, 0): + import statistics + return statistics.pstdev(arr) + else: + # Dependency on NumPy + try: + import numpy + return numpy.std(arr, axis=0) + except ImportError: + return 0. + + +class StartupData(object): + """ + Data for (n)vim startup (timings etc.). + """ + def __init__(self, cmd, log_filename, check_system=False): + super(StartupData, self).__init__() + self.cmd = cmd + self.log_filename = log_filename + self.times = dict() + self.system_dirs = ["/usr", "/usr/local"] + self.generate(check_system) + + def generate(self, check_system=False): + """ + Generate startup data. + """ + self.__run_vim() + try: + self.__load_times(check_system) + except RuntimeError: + print("\nNo plugin found. Exiting.") + sys.exit() + + if not self.times: + sys.exit() + + def __guess_plugin_dir(self, log_txt): + """ + Try to guess the vim directory containing plugins. + """ + candidates = list() + + # Get common plugin dir if any + vim_subdirs = "autoload|ftdetect|plugin|syntax" + matches = re.findall("^\d+.\d+\s+\d+.\d+\s+\d+.\d+: " + "sourcing (.+?)/(?:[^/]+/)(?:%s)/[^/]+" + % vim_subdirs, log_txt, re.MULTILINE) + for plugin_dir in matches: + # Ignore system plugins + if not is_subdir(self.system_dirs, plugin_dir): + candidates.append(plugin_dir) + + if candidates: + # FIXME: the directory containing vimrc could be returned as well + return collections.Counter(candidates).most_common(1)[0][0] + else: + raise RuntimeError("no user plugin found") + + def __load_times(self, check_system=False): + """ + Load startup times for log file. + """ + # Load log file and process it + print("Loading and processing logs...", end="") + with open(self.log_filename, 'r') as log: + log_txt = log.read() + plugin_dir = "" + + # Try to guess the folder based on the logs themselves + try: + plugin_dir = self.__guess_plugin_dir(log_txt) + matches = re.findall("^\d+.\d+\s+\d+.\d+\s+(\d+.\d+): " + "sourcing %s/([^/]+)/" % plugin_dir, + log_txt, re.MULTILINE) + for res in matches: + time = res[0] + plugin = res[1] + if plugin in self.times: + self.times[plugin] += float(time) + else: + self.times[plugin] = float(time) + # Catch exception if no plugin was found + except RuntimeError as e: + if not check_system: + raise + else: + plugin_dir = "" + + if check_system: + for d in self.system_dirs: + matches = re.findall("^\d+.\d+\s+\d+.\d+\s+(\d+.\d+): " + "sourcing %s/.+/([^/]+.vim)\n" % d, + log_txt, re.MULTILINE) + for res in matches: + time = res[0] + plugin = "*%s" % res[1] + if plugin in self.times: + self.times[plugin] += float(time) + else: + self.times[plugin] = float(time) + + print(" done.") + if plugin_dir: + print("Plugin directory: %s" % plugin_dir) + else: + print("No user plugin found.") + if not self.times: + print("No system plugin found.") + + def __run_vim(self): + """ + Run vim/nvim to generate startup logs. + """ + print("Running %s to generate startup logs..." % get_exe(self.cmd), + end="") + self.__clean_log() + full_cmd = to_list(self.cmd) + ["--startuptime", self.log_filename, + "-f", "-c", "q"] + subprocess.call(full_cmd, shell=False) + print(" done.") + + def __clean_log(self): + """ + Clean log file. + """ + if os.path.isfile(self.log_filename): + os.remove(self.log_filename) + + def __del__(self): + """ + Destructor taking care of clean up. + """ + self.__clean_log() + + +class StartupAnalyzer(object): + """ + Analyze startup times for (n)vim. + """ + def __init__(self, param): + super(StartupAnalyzer, self).__init__() + self.runs = param.runs + self.cmd = param.cmd + self.raw_data = [StartupData(self.cmd, "vim_%i.log" % (i+1), + check_system=param.check_system) + for i in range(self.runs)] + self.data = self.process_data() + + def process_data(self): + """ + Merge startup times for each plugin. + """ + return {k: [d.times[k] for d in self.raw_data] + for k in self.raw_data[0].times.keys()} + + def average_data(self): + """ + Return average times for each plugin. + """ + return {k: sum(v)/len(v) for k, v in self.data.items()} + + def stdev_data(self): + """ + Return standard deviation for each plugin. + """ + return {k: stdev(v) for k, v in self.data.items()} + + def plot(self): + """ + Plot startup data. + """ + import pylab + + print("Plotting result...", end="") + avg_data = self.average_data() + avg_data = self.__sort_data(avg_data, False) + if len(self.raw_data) > 1: + err = self.stdev_data() + sorted_err = [err[k] for k in list(zip(*avg_data))[0]] + else: + sorted_err = None + pylab.barh(range(len(avg_data)), list(zip(*avg_data))[1], + xerr=sorted_err, align='center', alpha=0.4) + pylab.yticks(range(len(avg_data)), list(zip(*avg_data))[0]) + pylab.xlabel("Average startup time (ms)") + pylab.ylabel("Plugins") + pylab.show() + print(" done.") + + def export(self, output_filename="result.csv"): + """ + Write sorted result to file. + """ + assert len(self.data) > 0 + print("Writing result to %s..." % output_filename, end="") + with open(output_filename, 'w') as fp: + writer = csv.writer(fp, delimiter='\t') + # Compute average times + avg_data = self.average_data() + # Sort by average time + for name, avg_time in self.__sort_data(avg_data): + writer.writerow(["%.3f" % avg_time, name]) + print(" done.") + + def print_summary(self, n): + """ + Print summary of startup times for plugins. + """ + title = "Top %i plugins slowing %s's startup" % (n, get_exe(self.cmd)) + length = len(title) + print(''.center(length, '=')) + print(title) + print(''.center(length, '=')) + + # Compute average times + avg_data = self.average_data() + # Sort by average time + rank = 0 + for name, time in self.__sort_data(avg_data)[:n]: + rank += 1 + print("%i\t%7.3f %s" % (rank, time, name)) + + print(''.center(length, '=')) + + @staticmethod + def __sort_data(d, reverse=True): + """ + Sort data by decreasing time. + """ + return sorted(d.items(), key=operator.itemgetter(1), reverse=reverse) + + +def main(): + parser = argparse.ArgumentParser( + description='Analyze startup times of vim/neovim plugins.') + parser.add_argument("-o", dest="csv", type=str, + help="Export result to a csv file") + parser.add_argument("-p", dest="plot", action='store_true', + help="Plot result as a bar chart") + parser.add_argument("-s", dest="check_system", action='store_true', + help="Consider system plugins as well (marked with *)") + parser.add_argument("-n", dest="n", type=int, default=10, + help="Number of plugins to list in the summary") + parser.add_argument("-r", dest="runs", type=int, default=1, + help="Number of runs (for average/standard deviation)") + parser.add_argument(dest="cmd", nargs=argparse.REMAINDER, type=str, default="vim", + help="vim/neovim executable or command") + + # Parse CLI arguments + args = parser.parse_args() + output_filename = args.csv + n = args.n + + # Command (default = vim) + if args.cmd == []: + args.cmd = "vim" + + # Run analysis + analyzer = StartupAnalyzer(args) + if n > 0: + analyzer.print_summary(n) + if output_filename is not None: + analyzer.export(output_filename) + if args.plot: + analyzer.plot() + +if __name__ == "__main__": + main() diff --git a/vim-plugins-profile-master/vim-plugins-profile.rb b/vim-plugins-profile-master/vim-plugins-profile.rb new file mode 100755 index 0000000..f6e6027 --- /dev/null +++ b/vim-plugins-profile-master/vim-plugins-profile.rb @@ -0,0 +1,59 @@ +#!/usr/bin/env ruby +# encoding: utf-8 + +# Copyright 2015-2020, Hörmet Yiltiz +# Released under GNU GPL version 3 or later. + +# Users can pass "nvim" as a first argument to use neovim. +vim = ARGV.first || 'vim' +puts "Testing #{vim} performance..." + +PLOT_WIDTH = 120 +LOG = "vim-plugins-profile.#{$$}.log" + +XDG_CONFIG_HOME = ENV['XDG_CONFIG_HOME'] || File.join(ENV['HOME'], '.config') + +VIMFILES_DIR = vim == "nvim" ? File.join(XDG_CONFIG_HOME, 'nvim') : File.join(ENV['HOME'], '.vim') +puts "Assuming your vimfiles folder is #{VIMFILES_DIR}." + +puts "Generating #{vim} startup profile..." +system(vim, '--startuptime', LOG, '-c', 'q') + +# detect plugin manager +plug_dir="" +if File.directory? File.join(VIMFILES_DIR, 'plugged') + puts "vim-plug has been detected." + plug_dir="plugged" +elsif File.directory? File.join(VIMFILES_DIR, 'bundle') + puts "NeoBundle/Vundle/Pathogen has been detected." + plug_dir="bundle" +else + puts "Cannot tell your plugin-manager. Adjust this script to meet your own needs for now." + puts "Cue: `plug_dir` variable would be a good starting place." + exit 1 +end + +# parse +exec_times_by_name = Hash.new(0) +lines = File.readlines(LOG).select { |line| line =~ /sourcing.*#{Regexp.escape(plug_dir)}/ } +lines.each do |line| + trace_time, source_time, exec_time, _, path = line.split(' ') + relative_path = path.gsub(File.join(VIMFILES_DIR, plug_dir) + '/', '') + name = File.basename(relative_path.split('/')[0], '.vim') + time = exec_time.to_f + exec_times_by_name[name] += time +end + +# plot +max = exec_times_by_name.values.max +relatives = exec_times_by_name.reduce({}) do |hash, (name, time)| + hash.merge!(name => time/max.to_f) +end +max_name_length = relatives.keys.map(&:length).max +puts +Hash[ relatives.sort_by { |k, v| -v } ].each do |name, rel_time| + time = exec_times_by_name[name] + puts "#{name.rjust(max_name_length)}: (#{time.round(3).to_s.ljust(5)}ms) #{'*' * (rel_time*PLOT_WIDTH)}" +end + +File.delete(LOG) diff --git a/vim-plugins-profile-master/vim-plugins-profile.sh b/vim-plugins-profile-master/vim-plugins-profile.sh new file mode 100755 index 0000000..0992188 --- /dev/null +++ b/vim-plugins-profile-master/vim-plugins-profile.sh @@ -0,0 +1,85 @@ +#! /bin/bash + +# Copyright 2015-2020, Hörmet Yiltiz +# Released under GNU GPL version 3 or later. + +set -eu +# set -x + +echo "Generating vim startup profile..." +logfile="vim.log" + +if [ -f $logfile ]; then + # clear the log file first + rm $logfile +fi + +if [[ $# -eq 0 ]]; then + vim --startuptime $logfile -c q +else + vim --startuptime $logfile $1 +fi + + +echo 'Assuming your vimfiles folder as `~/.vim/`' +vimfilesDir="$HOME/.vim/" + +plugDir="" +if [ -d "${vimfilesDir}plugged" ]; then + echo "vim-plug has been detected." + plugDir="plugged" +elif [ -d "${vimfilesDir}bundle" ]; then + echo "NeoBundle/Vundle/Pathogen has been detected." + plugDir="bundle" +else + echo "Cannot tell your plugin-manager. Adjust this bash script\n" + echo "to meet your own needs for now." + echo 'Cue: `plugDir` variable would be a good starting place.' + exit 1 +fi + + + +echo "Parsing vim startup profile..." +# logfile=hi.log +# cat $logfile +grep $plugDir $logfile > tmp.log +awk -F\: '{print $1}' tmp.log > tmp1.log +awk -F\: '{print $2}' tmp.log | awk -F\: '{print $2}' tmp.log | sed "s/.*${plugDir}\///g"|sed 's/\/.*//g' > tmp2.log +paste -d ',' tmp1.log tmp2.log | tr -s ' ' ',' > profile.csv +rm tmp.log tmp1.log tmp2.log +rm $logfile + + + + +# Let's do the R magic! +echo "Crunching data and generating profile plot ..." + +# Check if R is available +echo " " +type R > /dev/null 2>&1 || { echo -e >&2 "Package R is required but it's not installed. \nPlease install R using your package manager, \nor check out cran.r-project.org for instructions. \nAborting."; exit 1; } + + +# Still here? Great! Let's move on! +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +R --vanilla --quiet --slave --file="$DIR/vim-plugins-profile-plot.R" +#R --vanilla --file="vim-plugins-profile-plot.R" # or use this for debugging + +# we use result.csv, which is saved from R +# delete profile.csv since it is used to feed into R +rm profile.csv + + +echo " " +echo 'Your plugins startup profile graph is saved ' +echo 'as `result.png` under current directory.' +echo " " +echo "==========================================" +echo "Top 10 Plugins That Slows Down Vim Startup" +echo "==========================================" +cat -n result.csv |head -n 10 # change this 10 to see more in this `Top List` +echo "==========================================" + +echo "Done!" +echo " " diff --git a/wiretest.c b/wiretest.c new file mode 100644 index 0000000..3c88460 --- /dev/null +++ b/wiretest.c @@ -0,0 +1,4540 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + * GPL HEADER END + */ +/* + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * Copyright (c) 2011, Intel Corporation. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + */ + +#define DEBUG_SUBSYSTEM S_RPC + +#include +#include + +#include +#include +#include +#include +void lustre_assert_wire_constants(void) +{ + /* Wire protocol assertions generated by 'wirecheck' + * (make -C lustre/utils newwiretest) + * running on Linux centos6-bis 2.6.32-358.0.1.el6-head + * #3 SMP Wed Apr 17 17:37:43 CEST 2013 + * with gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) + */ + + /* Constants... */ + LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n", + (long long)PTL_RPC_MSG_REQUEST); + LASSERTF(PTL_RPC_MSG_ERR == 4712, "found %lld\n", + (long long)PTL_RPC_MSG_ERR); + LASSERTF(PTL_RPC_MSG_REPLY == 4713, "found %lld\n", + (long long)PTL_RPC_MSG_REPLY); + LASSERTF(MDS_DIR_END_OFF == 0xfffffffffffffffeULL, "found 0x%.16llxULL\n", + MDS_DIR_END_OFF); + LASSERTF(DEAD_HANDLE_MAGIC == 0xdeadbeefcafebabeULL, "found 0x%.16llxULL\n", + DEAD_HANDLE_MAGIC); + CLASSERT(MTI_NAME_MAXLEN == 64); + LASSERTF(OST_REPLY == 0, "found %lld\n", + (long long)OST_REPLY); + LASSERTF(OST_GETATTR == 1, "found %lld\n", + (long long)OST_GETATTR); + LASSERTF(OST_SETATTR == 2, "found %lld\n", + (long long)OST_SETATTR); + LASSERTF(OST_READ == 3, "found %lld\n", + (long long)OST_READ); + LASSERTF(OST_WRITE == 4, "found %lld\n", + (long long)OST_WRITE); + LASSERTF(OST_CREATE == 5, "found %lld\n", + (long long)OST_CREATE); + LASSERTF(OST_DESTROY == 6, "found %lld\n", + (long long)OST_DESTROY); + LASSERTF(OST_GET_INFO == 7, "found %lld\n", + (long long)OST_GET_INFO); + LASSERTF(OST_CONNECT == 8, "found %lld\n", + (long long)OST_CONNECT); + LASSERTF(OST_DISCONNECT == 9, "found %lld\n", + (long long)OST_DISCONNECT); + LASSERTF(OST_PUNCH == 10, "found %lld\n", + (long long)OST_PUNCH); + LASSERTF(OST_OPEN == 11, "found %lld\n", + (long long)OST_OPEN); + LASSERTF(OST_CLOSE == 12, "found %lld\n", + (long long)OST_CLOSE); + LASSERTF(OST_STATFS == 13, "found %lld\n", + (long long)OST_STATFS); + LASSERTF(OST_SYNC == 16, "found %lld\n", + (long long)OST_SYNC); + LASSERTF(OST_SET_INFO == 17, "found %lld\n", + (long long)OST_SET_INFO); + LASSERTF(OST_QUOTACHECK == 18, "found %lld\n", + (long long)OST_QUOTACHECK); + LASSERTF(OST_QUOTACTL == 19, "found %lld\n", + (long long)OST_QUOTACTL); + LASSERTF(OST_QUOTA_ADJUST_QUNIT == 20, "found %lld\n", + (long long)OST_QUOTA_ADJUST_QUNIT); + LASSERTF(OST_LAST_OPC == 21, "found %lld\n", + (long long)OST_LAST_OPC); + LASSERTF(OBD_OBJECT_EOF == 0xffffffffffffffffULL, "found 0x%.16llxULL\n", + OBD_OBJECT_EOF); + LASSERTF(OST_MIN_PRECREATE == 32, "found %lld\n", + (long long)OST_MIN_PRECREATE); + LASSERTF(OST_MAX_PRECREATE == 20000, "found %lld\n", + (long long)OST_MAX_PRECREATE); + LASSERTF(OST_LVB_ERR_INIT == 0xffbadbad80000000ULL, "found 0x%.16llxULL\n", + OST_LVB_ERR_INIT); + LASSERTF(OST_LVB_ERR_MASK == 0xffbadbad00000000ULL, "found 0x%.16llxULL\n", + OST_LVB_ERR_MASK); + LASSERTF(MDS_FIRST_OPC == 33, "found %lld\n", + (long long)MDS_FIRST_OPC); + LASSERTF(MDS_GETATTR == 33, "found %lld\n", + (long long)MDS_GETATTR); + LASSERTF(MDS_GETATTR_NAME == 34, "found %lld\n", + (long long)MDS_GETATTR_NAME); + LASSERTF(MDS_CLOSE == 35, "found %lld\n", + (long long)MDS_CLOSE); + LASSERTF(MDS_REINT == 36, "found %lld\n", + (long long)MDS_REINT); + LASSERTF(MDS_READPAGE == 37, "found %lld\n", + (long long)MDS_READPAGE); + LASSERTF(MDS_CONNECT == 38, "found %lld\n", + (long long)MDS_CONNECT); + LASSERTF(MDS_DISCONNECT == 39, "found %lld\n", + (long long)MDS_DISCONNECT); + LASSERTF(MDS_GETSTATUS == 40, "found %lld\n", + (long long)MDS_GETSTATUS); + LASSERTF(MDS_STATFS == 41, "found %lld\n", + (long long)MDS_STATFS); + LASSERTF(MDS_PIN == 42, "found %lld\n", + (long long)MDS_PIN); + LASSERTF(MDS_UNPIN == 43, "found %lld\n", + (long long)MDS_UNPIN); + LASSERTF(MDS_SYNC == 44, "found %lld\n", + (long long)MDS_SYNC); + LASSERTF(MDS_DONE_WRITING == 45, "found %lld\n", + (long long)MDS_DONE_WRITING); + LASSERTF(MDS_SET_INFO == 46, "found %lld\n", + (long long)MDS_SET_INFO); + LASSERTF(MDS_QUOTACHECK == 47, "found %lld\n", + (long long)MDS_QUOTACHECK); + LASSERTF(MDS_QUOTACTL == 48, "found %lld\n", + (long long)MDS_QUOTACTL); + LASSERTF(MDS_GETXATTR == 49, "found %lld\n", + (long long)MDS_GETXATTR); + LASSERTF(MDS_SETXATTR == 50, "found %lld\n", + (long long)MDS_SETXATTR); + LASSERTF(MDS_WRITEPAGE == 51, "found %lld\n", + (long long)MDS_WRITEPAGE); + LASSERTF(MDS_IS_SUBDIR == 52, "found %lld\n", + (long long)MDS_IS_SUBDIR); + LASSERTF(MDS_GET_INFO == 53, "found %lld\n", + (long long)MDS_GET_INFO); + LASSERTF(MDS_HSM_STATE_GET == 54, "found %lld\n", + (long long)MDS_HSM_STATE_GET); + LASSERTF(MDS_HSM_STATE_SET == 55, "found %lld\n", + (long long)MDS_HSM_STATE_SET); + LASSERTF(MDS_HSM_ACTION == 56, "found %lld\n", + (long long)MDS_HSM_ACTION); + LASSERTF(MDS_HSM_PROGRESS == 57, "found %lld\n", + (long long)MDS_HSM_PROGRESS); + LASSERTF(MDS_HSM_REQUEST == 58, "found %lld\n", + (long long)MDS_HSM_REQUEST); + LASSERTF(MDS_HSM_CT_REGISTER == 59, "found %lld\n", + (long long)MDS_HSM_CT_REGISTER); + LASSERTF(MDS_HSM_CT_UNREGISTER == 60, "found %lld\n", + (long long)MDS_HSM_CT_UNREGISTER); + LASSERTF(MDS_SWAP_LAYOUTS == 61, "found %lld\n", + (long long)MDS_SWAP_LAYOUTS); + LASSERTF(MDS_LAST_OPC == 62, "found %lld\n", + (long long)MDS_LAST_OPC); + LASSERTF(REINT_SETATTR == 1, "found %lld\n", + (long long)REINT_SETATTR); + LASSERTF(REINT_CREATE == 2, "found %lld\n", + (long long)REINT_CREATE); + LASSERTF(REINT_LINK == 3, "found %lld\n", + (long long)REINT_LINK); + LASSERTF(REINT_UNLINK == 4, "found %lld\n", + (long long)REINT_UNLINK); + LASSERTF(REINT_RENAME == 5, "found %lld\n", + (long long)REINT_RENAME); + LASSERTF(REINT_OPEN == 6, "found %lld\n", + (long long)REINT_OPEN); + LASSERTF(REINT_SETXATTR == 7, "found %lld\n", + (long long)REINT_SETXATTR); + LASSERTF(REINT_RMENTRY == 8, "found %lld\n", + (long long)REINT_RMENTRY); + LASSERTF(REINT_MAX == 9, "found %lld\n", + (long long)REINT_MAX); + LASSERTF(DISP_IT_EXECD == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)DISP_IT_EXECD); + LASSERTF(DISP_LOOKUP_EXECD == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)DISP_LOOKUP_EXECD); + LASSERTF(DISP_LOOKUP_NEG == 0x00000004UL, "found 0x%.8xUL\n", + (unsigned)DISP_LOOKUP_NEG); + LASSERTF(DISP_LOOKUP_POS == 0x00000008UL, "found 0x%.8xUL\n", + (unsigned)DISP_LOOKUP_POS); + LASSERTF(DISP_OPEN_CREATE == 0x00000010UL, "found 0x%.8xUL\n", + (unsigned)DISP_OPEN_CREATE); + LASSERTF(DISP_OPEN_OPEN == 0x00000020UL, "found 0x%.8xUL\n", + (unsigned)DISP_OPEN_OPEN); + LASSERTF(DISP_ENQ_COMPLETE == 0x00400000UL, "found 0x%.8xUL\n", + (unsigned)DISP_ENQ_COMPLETE); + LASSERTF(DISP_ENQ_OPEN_REF == 0x00800000UL, "found 0x%.8xUL\n", + (unsigned)DISP_ENQ_OPEN_REF); + LASSERTF(DISP_ENQ_CREATE_REF == 0x01000000UL, "found 0x%.8xUL\n", + (unsigned)DISP_ENQ_CREATE_REF); + LASSERTF(DISP_OPEN_LOCK == 0x02000000UL, "found 0x%.8xUL\n", + (unsigned)DISP_OPEN_LOCK); + LASSERTF(MDS_STATUS_CONN == 1, "found %lld\n", + (long long)MDS_STATUS_CONN); + LASSERTF(MDS_STATUS_LOV == 2, "found %lld\n", + (long long)MDS_STATUS_LOV); + LASSERTF(LUSTRE_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n", + (long long)LUSTRE_BFLAG_UNCOMMITTED_WRITES); + LASSERTF(MF_SOM_CHANGE == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)MF_SOM_CHANGE); + LASSERTF(MF_EPOCH_OPEN == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)MF_EPOCH_OPEN); + LASSERTF(MF_EPOCH_CLOSE == 0x00000004UL, "found 0x%.8xUL\n", + (unsigned)MF_EPOCH_CLOSE); + LASSERTF(MF_MDC_CANCEL_FID1 == 0x00000008UL, "found 0x%.8xUL\n", + (unsigned)MF_MDC_CANCEL_FID1); + LASSERTF(MF_MDC_CANCEL_FID2 == 0x00000010UL, "found 0x%.8xUL\n", + (unsigned)MF_MDC_CANCEL_FID2); + LASSERTF(MF_MDC_CANCEL_FID3 == 0x00000020UL, "found 0x%.8xUL\n", + (unsigned)MF_MDC_CANCEL_FID3); + LASSERTF(MF_MDC_CANCEL_FID4 == 0x00000040UL, "found 0x%.8xUL\n", + (unsigned)MF_MDC_CANCEL_FID4); + LASSERTF(MF_SOM_AU == 0x00000080UL, "found 0x%.8xUL\n", + (unsigned)MF_SOM_AU); + LASSERTF(MF_GETATTR_LOCK == 0x00000100UL, "found 0x%.8xUL\n", + (unsigned)MF_GETATTR_LOCK); + LASSERTF(MDS_ATTR_MODE == 0x0000000000000001ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_MODE); + LASSERTF(MDS_ATTR_UID == 0x0000000000000002ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_UID); + LASSERTF(MDS_ATTR_GID == 0x0000000000000004ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_GID); + LASSERTF(MDS_ATTR_SIZE == 0x0000000000000008ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_SIZE); + LASSERTF(MDS_ATTR_ATIME == 0x0000000000000010ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_ATIME); + LASSERTF(MDS_ATTR_MTIME == 0x0000000000000020ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_MTIME); + LASSERTF(MDS_ATTR_CTIME == 0x0000000000000040ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_CTIME); + LASSERTF(MDS_ATTR_ATIME_SET == 0x0000000000000080ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_ATIME_SET); + LASSERTF(MDS_ATTR_MTIME_SET == 0x0000000000000100ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_MTIME_SET); + LASSERTF(MDS_ATTR_FORCE == 0x0000000000000200ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_FORCE); + LASSERTF(MDS_ATTR_ATTR_FLAG == 0x0000000000000400ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_ATTR_FLAG); + LASSERTF(MDS_ATTR_KILL_SUID == 0x0000000000000800ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_KILL_SUID); + LASSERTF(MDS_ATTR_KILL_SGID == 0x0000000000001000ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_KILL_SGID); + LASSERTF(MDS_ATTR_CTIME_SET == 0x0000000000002000ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_CTIME_SET); + LASSERTF(MDS_ATTR_FROM_OPEN == 0x0000000000004000ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_FROM_OPEN); + LASSERTF(MDS_ATTR_BLOCKS == 0x0000000000008000ULL, "found 0x%.16llxULL\n", + (long long)MDS_ATTR_BLOCKS); + LASSERTF(FLD_QUERY == 900, "found %lld\n", + (long long)FLD_QUERY); + LASSERTF(FLD_FIRST_OPC == 900, "found %lld\n", + (long long)FLD_FIRST_OPC); + LASSERTF(FLD_LAST_OPC == 901, "found %lld\n", + (long long)FLD_LAST_OPC); + LASSERTF(SEQ_QUERY == 700, "found %lld\n", + (long long)SEQ_QUERY); + LASSERTF(SEQ_FIRST_OPC == 700, "found %lld\n", + (long long)SEQ_FIRST_OPC); + LASSERTF(SEQ_LAST_OPC == 701, "found %lld\n", + (long long)SEQ_LAST_OPC); + LASSERTF(SEQ_ALLOC_SUPER == 0, "found %lld\n", + (long long)SEQ_ALLOC_SUPER); + LASSERTF(SEQ_ALLOC_META == 1, "found %lld\n", + (long long)SEQ_ALLOC_META); + LASSERTF(LDLM_ENQUEUE == 101, "found %lld\n", + (long long)LDLM_ENQUEUE); + LASSERTF(LDLM_CONVERT == 102, "found %lld\n", + (long long)LDLM_CONVERT); + LASSERTF(LDLM_CANCEL == 103, "found %lld\n", + (long long)LDLM_CANCEL); + LASSERTF(LDLM_BL_CALLBACK == 104, "found %lld\n", + (long long)LDLM_BL_CALLBACK); + LASSERTF(LDLM_CP_CALLBACK == 105, "found %lld\n", + (long long)LDLM_CP_CALLBACK); + LASSERTF(LDLM_GL_CALLBACK == 106, "found %lld\n", + (long long)LDLM_GL_CALLBACK); + LASSERTF(LDLM_SET_INFO == 107, "found %lld\n", + (long long)LDLM_SET_INFO); + LASSERTF(LDLM_LAST_OPC == 108, "found %lld\n", + (long long)LDLM_LAST_OPC); + LASSERTF(LCK_MINMODE == 0, "found %lld\n", + (long long)LCK_MINMODE); + LASSERTF(LCK_EX == 1, "found %lld\n", + (long long)LCK_EX); + LASSERTF(LCK_PW == 2, "found %lld\n", + (long long)LCK_PW); + LASSERTF(LCK_PR == 4, "found %lld\n", + (long long)LCK_PR); + LASSERTF(LCK_CW == 8, "found %lld\n", + (long long)LCK_CW); + LASSERTF(LCK_CR == 16, "found %lld\n", + (long long)LCK_CR); + LASSERTF(LCK_NL == 32, "found %lld\n", + (long long)LCK_NL); + LASSERTF(LCK_GROUP == 64, "found %lld\n", + (long long)LCK_GROUP); + LASSERTF(LCK_COS == 128, "found %lld\n", + (long long)LCK_COS); + LASSERTF(LCK_MAXMODE == 129, "found %lld\n", + (long long)LCK_MAXMODE); + LASSERTF(LCK_MODE_NUM == 8, "found %lld\n", + (long long)LCK_MODE_NUM); + CLASSERT(LDLM_PLAIN == 10); + CLASSERT(LDLM_EXTENT == 11); + CLASSERT(LDLM_FLOCK == 12); + CLASSERT(LDLM_IBITS == 13); + CLASSERT(LDLM_MAX_TYPE == 14); + CLASSERT(LUSTRE_RES_ID_SEQ_OFF == 0); + CLASSERT(LUSTRE_RES_ID_VER_OID_OFF == 1); + LASSERTF(UPDATE_OBJ == 1000, "found %lld\n", + (long long)UPDATE_OBJ); + LASSERTF(UPDATE_LAST_OPC == 1001, "found %lld\n", + (long long)UPDATE_LAST_OPC); + CLASSERT(LUSTRE_RES_ID_QUOTA_SEQ_OFF == 2); + CLASSERT(LUSTRE_RES_ID_QUOTA_VER_OID_OFF == 3); + CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3); + CLASSERT(LQUOTA_TYPE_USR == 0); + CLASSERT(LQUOTA_TYPE_GRP == 1); + CLASSERT(LQUOTA_RES_MD == 1); + CLASSERT(LQUOTA_RES_DT == 2); + LASSERTF(OBD_PING == 400, "found %lld\n", + (long long)OBD_PING); + LASSERTF(OBD_LOG_CANCEL == 401, "found %lld\n", + (long long)OBD_LOG_CANCEL); + LASSERTF(OBD_QC_CALLBACK == 402, "found %lld\n", + (long long)OBD_QC_CALLBACK); + LASSERTF(OBD_IDX_READ == 403, "found %lld\n", + (long long)OBD_IDX_READ); + LASSERTF(OBD_LAST_OPC == 404, "found %lld\n", + (long long)OBD_LAST_OPC); + LASSERTF(QUOTA_DQACQ == 601, "found %lld\n", + (long long)QUOTA_DQACQ); + LASSERTF(QUOTA_DQREL == 602, "found %lld\n", + (long long)QUOTA_DQREL); + LASSERTF(QUOTA_LAST_OPC == 603, "found %lld\n", + (long long)QUOTA_LAST_OPC); + LASSERTF(MGS_CONNECT == 250, "found %lld\n", + (long long)MGS_CONNECT); + LASSERTF(MGS_DISCONNECT == 251, "found %lld\n", + (long long)MGS_DISCONNECT); + LASSERTF(MGS_EXCEPTION == 252, "found %lld\n", + (long long)MGS_EXCEPTION); + LASSERTF(MGS_TARGET_REG == 253, "found %lld\n", + (long long)MGS_TARGET_REG); + LASSERTF(MGS_TARGET_DEL == 254, "found %lld\n", + (long long)MGS_TARGET_DEL); + LASSERTF(MGS_SET_INFO == 255, "found %lld\n", + (long long)MGS_SET_INFO); + LASSERTF(MGS_LAST_OPC == 257, "found %lld\n", + (long long)MGS_LAST_OPC); + LASSERTF(SEC_CTX_INIT == 801, "found %lld\n", + (long long)SEC_CTX_INIT); + LASSERTF(SEC_CTX_INIT_CONT == 802, "found %lld\n", + (long long)SEC_CTX_INIT_CONT); + LASSERTF(SEC_CTX_FINI == 803, "found %lld\n", + (long long)SEC_CTX_FINI); + LASSERTF(SEC_LAST_OPC == 804, "found %lld\n", + (long long)SEC_LAST_OPC); + /* Sizes and Offsets */ + + /* Checks for struct obd_uuid */ + LASSERTF((int)sizeof(struct obd_uuid) == 40, "found %lld\n", + (long long)(int)sizeof(struct obd_uuid)); + + /* Checks for struct lu_seq_range */ + LASSERTF((int)sizeof(struct lu_seq_range) == 24, "found %lld\n", + (long long)(int)sizeof(struct lu_seq_range)); + LASSERTF((int)offsetof(struct lu_seq_range, lsr_start) == 0, "found %lld\n", + (long long)(int)offsetof(struct lu_seq_range, lsr_start)); + LASSERTF((int)sizeof(((struct lu_seq_range *)0)->lsr_start) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lu_seq_range *)0)->lsr_start)); + LASSERTF((int)offsetof(struct lu_seq_range, lsr_end) == 8, "found %lld\n", + (long long)(int)offsetof(struct lu_seq_range, lsr_end)); + LASSERTF((int)sizeof(((struct lu_seq_range *)0)->lsr_end) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lu_seq_range *)0)->lsr_end)); + LASSERTF((int)offsetof(struct lu_seq_range, lsr_index) == 16, "found %lld\n", + (long long)(int)offsetof(struct lu_seq_range, lsr_index)); + LASSERTF((int)sizeof(((struct lu_seq_range *)0)->lsr_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lu_seq_range *)0)->lsr_index)); + LASSERTF((int)offsetof(struct lu_seq_range, lsr_flags) == 20, "found %lld\n", + (long long)(int)offsetof(struct lu_seq_range, lsr_flags)); + LASSERTF((int)sizeof(((struct lu_seq_range *)0)->lsr_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lu_seq_range *)0)->lsr_flags)); + LASSERTF(LU_SEQ_RANGE_MDT == 0, "found %lld\n", + (long long)LU_SEQ_RANGE_MDT); + LASSERTF(LU_SEQ_RANGE_OST == 1, "found %lld\n", + (long long)LU_SEQ_RANGE_OST); + + /* Checks for struct lustre_mdt_attrs */ + LASSERTF((int)sizeof(struct lustre_mdt_attrs) == 24, "found %lld\n", + (long long)(int)sizeof(struct lustre_mdt_attrs)); + LASSERTF((int)offsetof(struct lustre_mdt_attrs, lma_compat) == 0, "found %lld\n", + (long long)(int)offsetof(struct lustre_mdt_attrs, lma_compat)); + LASSERTF((int)sizeof(((struct lustre_mdt_attrs *)0)->lma_compat) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_mdt_attrs *)0)->lma_compat)); + LASSERTF((int)offsetof(struct lustre_mdt_attrs, lma_incompat) == 4, "found %lld\n", + (long long)(int)offsetof(struct lustre_mdt_attrs, lma_incompat)); + LASSERTF((int)sizeof(((struct lustre_mdt_attrs *)0)->lma_incompat) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_mdt_attrs *)0)->lma_incompat)); + LASSERTF((int)offsetof(struct lustre_mdt_attrs, lma_self_fid) == 8, "found %lld\n", + (long long)(int)offsetof(struct lustre_mdt_attrs, lma_self_fid)); + LASSERTF((int)sizeof(((struct lustre_mdt_attrs *)0)->lma_self_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct lustre_mdt_attrs *)0)->lma_self_fid)); + LASSERTF(LMAI_RELEASED == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)LMAI_RELEASED); + LASSERTF(LMAC_HSM == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)LMAC_HSM); + LASSERTF(LMAC_SOM == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)LMAC_SOM); + LASSERTF(LMAC_NOT_IN_OI == 0x00000004UL, "found 0x%.8xUL\n", + (unsigned)LMAC_NOT_IN_OI); + LASSERTF(LMAC_FID_ON_OST == 0x00000008UL, "found 0x%.8xUL\n", + (unsigned)LMAC_FID_ON_OST); + LASSERTF(OBJ_CREATE == 1, "found %lld\n", + (long long)OBJ_CREATE); + LASSERTF(OBJ_DESTROY == 2, "found %lld\n", + (long long)OBJ_DESTROY); + LASSERTF(OBJ_REF_ADD == 3, "found %lld\n", + (long long)OBJ_REF_ADD); + LASSERTF(OBJ_REF_DEL == 4, "found %lld\n", + (long long)OBJ_REF_DEL); + LASSERTF(OBJ_ATTR_SET == 5, "found %lld\n", + (long long)OBJ_ATTR_SET); + LASSERTF(OBJ_ATTR_GET == 6, "found %lld\n", + (long long)OBJ_ATTR_GET); + LASSERTF(OBJ_XATTR_SET == 7, "found %lld\n", + (long long)OBJ_XATTR_SET); + LASSERTF(OBJ_XATTR_GET == 8, "found %lld\n", + (long long)OBJ_XATTR_GET); + LASSERTF(OBJ_INDEX_LOOKUP == 9, "found %lld\n", + (long long)OBJ_INDEX_LOOKUP); + LASSERTF(OBJ_INDEX_LOOKUP == 9, "found %lld\n", + (long long)OBJ_INDEX_LOOKUP); + LASSERTF(OBJ_INDEX_INSERT == 10, "found %lld\n", + (long long)OBJ_INDEX_INSERT); + LASSERTF(OBJ_INDEX_DELETE == 11, "found %lld\n", + (long long)OBJ_INDEX_DELETE); + + /* Checks for struct som_attrs */ + LASSERTF((int)sizeof(struct som_attrs) == 40, "found %lld\n", + (long long)(int)sizeof(struct som_attrs)); + LASSERTF((int)offsetof(struct som_attrs, som_compat) == 0, "found %lld\n", + (long long)(int)offsetof(struct som_attrs, som_compat)); + LASSERTF((int)sizeof(((struct som_attrs *)0)->som_compat) == 4, "found %lld\n", + (long long)(int)sizeof(((struct som_attrs *)0)->som_compat)); + LASSERTF((int)offsetof(struct som_attrs, som_incompat) == 4, "found %lld\n", + (long long)(int)offsetof(struct som_attrs, som_incompat)); + LASSERTF((int)sizeof(((struct som_attrs *)0)->som_incompat) == 4, "found %lld\n", + (long long)(int)sizeof(((struct som_attrs *)0)->som_incompat)); + LASSERTF((int)offsetof(struct som_attrs, som_ioepoch) == 8, "found %lld\n", + (long long)(int)offsetof(struct som_attrs, som_ioepoch)); + LASSERTF((int)sizeof(((struct som_attrs *)0)->som_ioepoch) == 8, "found %lld\n", + (long long)(int)sizeof(((struct som_attrs *)0)->som_ioepoch)); + LASSERTF((int)offsetof(struct som_attrs, som_size) == 16, "found %lld\n", + (long long)(int)offsetof(struct som_attrs, som_size)); + LASSERTF((int)sizeof(((struct som_attrs *)0)->som_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct som_attrs *)0)->som_size)); + LASSERTF((int)offsetof(struct som_attrs, som_blocks) == 24, "found %lld\n", + (long long)(int)offsetof(struct som_attrs, som_blocks)); + LASSERTF((int)sizeof(((struct som_attrs *)0)->som_blocks) == 8, "found %lld\n", + (long long)(int)sizeof(((struct som_attrs *)0)->som_blocks)); + LASSERTF((int)offsetof(struct som_attrs, som_mountid) == 32, "found %lld\n", + (long long)(int)offsetof(struct som_attrs, som_mountid)); + LASSERTF((int)sizeof(((struct som_attrs *)0)->som_mountid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct som_attrs *)0)->som_mountid)); + + /* Checks for struct hsm_attrs */ + LASSERTF((int)sizeof(struct hsm_attrs) == 24, "found %lld\n", + (long long)(int)sizeof(struct hsm_attrs)); + LASSERTF((int)offsetof(struct hsm_attrs, hsm_compat) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_attrs, hsm_compat)); + LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_compat) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_compat)); + LASSERTF((int)offsetof(struct hsm_attrs, hsm_flags) == 4, "found %lld\n", + (long long)(int)offsetof(struct hsm_attrs, hsm_flags)); + LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_flags)); + LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_id) == 8, "found %lld\n", + (long long)(int)offsetof(struct hsm_attrs, hsm_arch_id)); + LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_id)); + LASSERTF((int)offsetof(struct hsm_attrs, hsm_arch_ver) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_attrs, hsm_arch_ver)); + LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver)); + + /* Checks for struct ost_id */ + LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n", + (long long)(int)sizeof(struct ost_id)); + LASSERTF((int)offsetof(struct ost_id, oi) == 0, "found %lld\n", + (long long)(int)offsetof(struct ost_id, oi)); + LASSERTF((int)sizeof(((struct ost_id *)0)->oi) == 16, "found %lld\n", + (long long)(int)sizeof(((struct ost_id *)0)->oi)); + LASSERTF(LUSTRE_FID_INIT_OID == 1, "found %lld\n", + (long long)LUSTRE_FID_INIT_OID); + LASSERTF(FID_SEQ_OST_MDT0 == 0, "found %lld\n", + (long long)FID_SEQ_OST_MDT0); + LASSERTF(FID_SEQ_LLOG == 1, "found %lld\n", + (long long)FID_SEQ_LLOG); + LASSERTF(FID_SEQ_ECHO == 2, "found %lld\n", + (long long)FID_SEQ_ECHO); + LASSERTF(FID_SEQ_OST_MDT1 == 3, "found %lld\n", + (long long)FID_SEQ_OST_MDT1); + LASSERTF(FID_SEQ_OST_MAX == 9, "found %lld\n", + (long long)FID_SEQ_OST_MAX); + LASSERTF(FID_SEQ_RSVD == 11, "found %lld\n", + (long long)FID_SEQ_RSVD); + LASSERTF(FID_SEQ_IGIF == 12, "found %lld\n", + (long long)FID_SEQ_IGIF); + LASSERTF(FID_SEQ_IGIF_MAX == 0x00000000ffffffffULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_IGIF_MAX); + LASSERTF(FID_SEQ_IDIF == 0x0000000100000000ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_IDIF); + LASSERTF(FID_SEQ_IDIF_MAX == 0x00000001ffffffffULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_IDIF_MAX); + LASSERTF(FID_SEQ_START == 0x0000000200000000ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_START); + LASSERTF(FID_SEQ_LOCAL_FILE == 0x0000000200000001ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_LOCAL_FILE); + LASSERTF(FID_SEQ_DOT_LUSTRE == 0x0000000200000002ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_DOT_LUSTRE); + LASSERTF(FID_SEQ_SPECIAL == 0x0000000200000004ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_SPECIAL); + LASSERTF(FID_SEQ_QUOTA == 0x0000000200000005ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_QUOTA); + LASSERTF(FID_SEQ_QUOTA_GLB == 0x0000000200000006ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_QUOTA_GLB); + LASSERTF(FID_SEQ_ROOT == 0x0000000200000007ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_ROOT); + LASSERTF(FID_SEQ_NORMAL == 0x0000000200000400ULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_NORMAL); + LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n", + (long long)FID_SEQ_LOV_DEFAULT); + LASSERTF(FID_OID_SPECIAL_BFL == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)FID_OID_SPECIAL_BFL); + LASSERTF(FID_OID_DOT_LUSTRE == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)FID_OID_DOT_LUSTRE); + LASSERTF(FID_OID_DOT_LUSTRE_OBF == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)FID_OID_DOT_LUSTRE_OBF); + + /* Checks for struct lu_dirent */ + LASSERTF((int)sizeof(struct lu_dirent) == 32, "found %lld\n", + (long long)(int)sizeof(struct lu_dirent)); + LASSERTF((int)offsetof(struct lu_dirent, lde_fid) == 0, "found %lld\n", + (long long)(int)offsetof(struct lu_dirent, lde_fid)); + LASSERTF((int)sizeof(((struct lu_dirent *)0)->lde_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirent *)0)->lde_fid)); + LASSERTF((int)offsetof(struct lu_dirent, lde_hash) == 16, "found %lld\n", + (long long)(int)offsetof(struct lu_dirent, lde_hash)); + LASSERTF((int)sizeof(((struct lu_dirent *)0)->lde_hash) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirent *)0)->lde_hash)); + LASSERTF((int)offsetof(struct lu_dirent, lde_reclen) == 24, "found %lld\n", + (long long)(int)offsetof(struct lu_dirent, lde_reclen)); + LASSERTF((int)sizeof(((struct lu_dirent *)0)->lde_reclen) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirent *)0)->lde_reclen)); + LASSERTF((int)offsetof(struct lu_dirent, lde_namelen) == 26, "found %lld\n", + (long long)(int)offsetof(struct lu_dirent, lde_namelen)); + LASSERTF((int)sizeof(((struct lu_dirent *)0)->lde_namelen) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirent *)0)->lde_namelen)); + LASSERTF((int)offsetof(struct lu_dirent, lde_attrs) == 28, "found %lld\n", + (long long)(int)offsetof(struct lu_dirent, lde_attrs)); + LASSERTF((int)sizeof(((struct lu_dirent *)0)->lde_attrs) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirent *)0)->lde_attrs)); + LASSERTF((int)offsetof(struct lu_dirent, lde_name[0]) == 32, "found %lld\n", + (long long)(int)offsetof(struct lu_dirent, lde_name[0])); + LASSERTF((int)sizeof(((struct lu_dirent *)0)->lde_name[0]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirent *)0)->lde_name[0])); + LASSERTF(LUDA_FID == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)LUDA_FID); + LASSERTF(LUDA_TYPE == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)LUDA_TYPE); + LASSERTF(LUDA_64BITHASH == 0x00000004UL, "found 0x%.8xUL\n", + (unsigned)LUDA_64BITHASH); + + /* Checks for struct luda_type */ + LASSERTF((int)sizeof(struct luda_type) == 2, "found %lld\n", + (long long)(int)sizeof(struct luda_type)); + LASSERTF((int)offsetof(struct luda_type, lt_type) == 0, "found %lld\n", + (long long)(int)offsetof(struct luda_type, lt_type)); + LASSERTF((int)sizeof(((struct luda_type *)0)->lt_type) == 2, "found %lld\n", + (long long)(int)sizeof(((struct luda_type *)0)->lt_type)); + + /* Checks for struct lu_dirpage */ + LASSERTF((int)sizeof(struct lu_dirpage) == 24, "found %lld\n", + (long long)(int)sizeof(struct lu_dirpage)); + LASSERTF((int)offsetof(struct lu_dirpage, ldp_hash_start) == 0, "found %lld\n", + (long long)(int)offsetof(struct lu_dirpage, ldp_hash_start)); + LASSERTF((int)sizeof(((struct lu_dirpage *)0)->ldp_hash_start) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirpage *)0)->ldp_hash_start)); + LASSERTF((int)offsetof(struct lu_dirpage, ldp_hash_end) == 8, "found %lld\n", + (long long)(int)offsetof(struct lu_dirpage, ldp_hash_end)); + LASSERTF((int)sizeof(((struct lu_dirpage *)0)->ldp_hash_end) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirpage *)0)->ldp_hash_end)); + LASSERTF((int)offsetof(struct lu_dirpage, ldp_flags) == 16, "found %lld\n", + (long long)(int)offsetof(struct lu_dirpage, ldp_flags)); + LASSERTF((int)sizeof(((struct lu_dirpage *)0)->ldp_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirpage *)0)->ldp_flags)); + LASSERTF((int)offsetof(struct lu_dirpage, ldp_pad0) == 20, "found %lld\n", + (long long)(int)offsetof(struct lu_dirpage, ldp_pad0)); + LASSERTF((int)sizeof(((struct lu_dirpage *)0)->ldp_pad0) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirpage *)0)->ldp_pad0)); + LASSERTF((int)offsetof(struct lu_dirpage, ldp_entries[0]) == 24, "found %lld\n", + (long long)(int)offsetof(struct lu_dirpage, ldp_entries[0])); + LASSERTF((int)sizeof(((struct lu_dirpage *)0)->ldp_entries[0]) == 32, "found %lld\n", + (long long)(int)sizeof(((struct lu_dirpage *)0)->ldp_entries[0])); + LASSERTF(LDF_EMPTY == 1, "found %lld\n", + (long long)LDF_EMPTY); + LASSERTF(LDF_COLLIDE == 2, "found %lld\n", + (long long)LDF_COLLIDE); + LASSERTF(LU_PAGE_SIZE == 4096, "found %lld\n", + (long long)LU_PAGE_SIZE); + /* Checks for union lu_page */ + LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n", + (long long)(int)sizeof(union lu_page)); + + /* Checks for struct lustre_handle */ + LASSERTF((int)sizeof(struct lustre_handle) == 8, "found %lld\n", + (long long)(int)sizeof(struct lustre_handle)); + LASSERTF((int)offsetof(struct lustre_handle, cookie) == 0, "found %lld\n", + (long long)(int)offsetof(struct lustre_handle, cookie)); + LASSERTF((int)sizeof(((struct lustre_handle *)0)->cookie) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lustre_handle *)0)->cookie)); + + /* Checks for struct lustre_msg_v2 */ + LASSERTF((int)sizeof(struct lustre_msg_v2) == 32, "found %lld\n", + (long long)(int)sizeof(struct lustre_msg_v2)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_bufcount) == 0, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_bufcount)); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_bufcount) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_bufcount)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_secflvr) == 4, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_secflvr)); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_secflvr) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_secflvr)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_magic) == 8, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_magic)); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_magic) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_magic)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_repsize) == 12, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_repsize)); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_repsize) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_repsize)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_cksum) == 16, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_cksum)); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_cksum) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_cksum)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_flags) == 20, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_flags)); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_flags)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_padding_2) == 24, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_padding_2)); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_padding_2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_padding_2)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_padding_3) == 28, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_padding_3)); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_padding_3) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_padding_3)); + LASSERTF((int)offsetof(struct lustre_msg_v2, lm_buflens[0]) == 32, "found %lld\n", + (long long)(int)offsetof(struct lustre_msg_v2, lm_buflens[0])); + LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_buflens[0]) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_buflens[0])); + LASSERTF(LUSTRE_MSG_MAGIC_V1 == 0x0BD00BD0, "found 0x%.8x\n", + LUSTRE_MSG_MAGIC_V1); + LASSERTF(LUSTRE_MSG_MAGIC_V2 == 0x0BD00BD3, "found 0x%.8x\n", + LUSTRE_MSG_MAGIC_V2); + LASSERTF(LUSTRE_MSG_MAGIC_V1_SWABBED == 0xD00BD00B, "found 0x%.8x\n", + LUSTRE_MSG_MAGIC_V1_SWABBED); + LASSERTF(LUSTRE_MSG_MAGIC_V2_SWABBED == 0xD30BD00B, "found 0x%.8x\n", + LUSTRE_MSG_MAGIC_V2_SWABBED); + + /* Checks for struct ptlrpc_body */ + LASSERTF((int)sizeof(struct ptlrpc_body_v3) == 184, "found %lld\n", + (long long)(int)sizeof(struct ptlrpc_body_v3)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_handle) == 0, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_handle)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_handle) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_handle)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_type) == 8, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_type)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_type) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_type)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_version) == 12, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_version)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_version) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_version)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_opc) == 16, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_opc)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_opc) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_opc)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_status) == 20, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_status)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_status) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_status)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_xid) == 24, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_xid)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_xid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_xid)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_seen) == 32, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_seen)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_seen) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_seen)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_committed) == 40, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_last_committed)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_transno) == 48, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_transno)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_transno) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_transno)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_flags) == 56, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_flags)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_flags)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_op_flags) == 60, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_op_flags)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_op_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_op_flags)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_conn_cnt) == 64, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_conn_cnt)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_conn_cnt) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_conn_cnt)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_timeout) == 68, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_timeout)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_timeout) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_timeout)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_service_time) == 72, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_service_time)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_service_time) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_service_time)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_limit) == 76, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_limit)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_limit) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_limit)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_slv) == 80, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_slv)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_slv) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_slv)); + CLASSERT(PTLRPC_NUM_VERSIONS == 4); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_pre_versions) == 88, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_pre_versions)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_pre_versions) == 32, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_pre_versions)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_padding) == 120, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_padding)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding) == 32, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding)); + CLASSERT(JOBSTATS_JOBID_SIZE == 32); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_jobid) == 152, "found %lld\n", + (long long)(int)offsetof(struct ptlrpc_body_v3, pb_jobid)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_jobid) == 32, "found %lld\n", + (long long)(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_jobid)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_handle) == (int)offsetof(struct ptlrpc_body_v2, pb_handle), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_handle), (int)offsetof(struct ptlrpc_body_v2, pb_handle)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_handle) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_handle), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_handle), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_handle)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_type) == (int)offsetof(struct ptlrpc_body_v2, pb_type), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_type), (int)offsetof(struct ptlrpc_body_v2, pb_type)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_type) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_type), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_type), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_type)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_version) == (int)offsetof(struct ptlrpc_body_v2, pb_version), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_version), (int)offsetof(struct ptlrpc_body_v2, pb_version)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_version) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_version), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_version), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_version)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_opc) == (int)offsetof(struct ptlrpc_body_v2, pb_opc), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_opc), (int)offsetof(struct ptlrpc_body_v2, pb_opc)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_opc) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_opc), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_opc), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_opc)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_status) == (int)offsetof(struct ptlrpc_body_v2, pb_status), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_status), (int)offsetof(struct ptlrpc_body_v2, pb_status)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_status) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_status), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_status), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_status)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_xid) == (int)offsetof(struct ptlrpc_body_v2, pb_last_xid), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_last_xid), (int)offsetof(struct ptlrpc_body_v2, pb_last_xid)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_xid) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_last_xid), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_xid), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_last_xid)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_seen) == (int)offsetof(struct ptlrpc_body_v2, pb_last_seen), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_last_seen), (int)offsetof(struct ptlrpc_body_v2, pb_last_seen)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_seen) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_last_seen), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_seen), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_last_seen)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_last_committed) == (int)offsetof(struct ptlrpc_body_v2, pb_last_committed), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_last_committed), (int)offsetof(struct ptlrpc_body_v2, pb_last_committed)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_last_committed), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_last_committed), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_last_committed)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_transno) == (int)offsetof(struct ptlrpc_body_v2, pb_transno), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_transno), (int)offsetof(struct ptlrpc_body_v2, pb_transno)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_transno) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_transno), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_transno), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_transno)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_flags) == (int)offsetof(struct ptlrpc_body_v2, pb_flags), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_flags), (int)offsetof(struct ptlrpc_body_v2, pb_flags)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_flags) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_flags), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_flags), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_flags)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_op_flags) == (int)offsetof(struct ptlrpc_body_v2, pb_op_flags), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_op_flags), (int)offsetof(struct ptlrpc_body_v2, pb_op_flags)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_op_flags) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_op_flags), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_op_flags), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_op_flags)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_conn_cnt) == (int)offsetof(struct ptlrpc_body_v2, pb_conn_cnt), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_conn_cnt), (int)offsetof(struct ptlrpc_body_v2, pb_conn_cnt)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_conn_cnt) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_conn_cnt), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_conn_cnt), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_conn_cnt)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_timeout) == (int)offsetof(struct ptlrpc_body_v2, pb_timeout), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_timeout), (int)offsetof(struct ptlrpc_body_v2, pb_timeout)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_timeout) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_timeout), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_timeout), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_timeout)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_service_time) == (int)offsetof(struct ptlrpc_body_v2, pb_service_time), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_service_time), (int)offsetof(struct ptlrpc_body_v2, pb_service_time)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_service_time) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_service_time), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_service_time), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_service_time)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_limit) == (int)offsetof(struct ptlrpc_body_v2, pb_limit), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_limit), (int)offsetof(struct ptlrpc_body_v2, pb_limit)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_limit) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_limit), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_limit), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_limit)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_slv) == (int)offsetof(struct ptlrpc_body_v2, pb_slv), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_slv), (int)offsetof(struct ptlrpc_body_v2, pb_slv)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_slv) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_slv), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_slv), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_slv)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_pre_versions) == (int)offsetof(struct ptlrpc_body_v2, pb_pre_versions), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_pre_versions), (int)offsetof(struct ptlrpc_body_v2, pb_pre_versions)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_pre_versions) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_pre_versions), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_pre_versions), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_pre_versions)); + LASSERTF((int)offsetof(struct ptlrpc_body_v3, pb_padding) == (int)offsetof(struct ptlrpc_body_v2, pb_padding), "%d != %d\n", + (int)offsetof(struct ptlrpc_body_v3, pb_padding), (int)offsetof(struct ptlrpc_body_v2, pb_padding)); + LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding), "%d != %d\n", + (int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding)); + LASSERTF(MSG_PTLRPC_BODY_OFF == 0, "found %lld\n", + (long long)MSG_PTLRPC_BODY_OFF); + LASSERTF(REQ_REC_OFF == 1, "found %lld\n", + (long long)REQ_REC_OFF); + LASSERTF(REPLY_REC_OFF == 1, "found %lld\n", + (long long)REPLY_REC_OFF); + LASSERTF(DLM_LOCKREQ_OFF == 1, "found %lld\n", + (long long)DLM_LOCKREQ_OFF); + LASSERTF(DLM_REQ_REC_OFF == 2, "found %lld\n", + (long long)DLM_REQ_REC_OFF); + LASSERTF(DLM_INTENT_IT_OFF == 2, "found %lld\n", + (long long)DLM_INTENT_IT_OFF); + LASSERTF(DLM_INTENT_REC_OFF == 3, "found %lld\n", + (long long)DLM_INTENT_REC_OFF); + LASSERTF(DLM_LOCKREPLY_OFF == 1, "found %lld\n", + (long long)DLM_LOCKREPLY_OFF); + LASSERTF(DLM_REPLY_REC_OFF == 2, "found %lld\n", + (long long)DLM_REPLY_REC_OFF); + LASSERTF(MSG_PTLRPC_HEADER_OFF == 31, "found %lld\n", + (long long)MSG_PTLRPC_HEADER_OFF); + LASSERTF(PTLRPC_MSG_VERSION == 0x00000003, "found 0x%.8x\n", + PTLRPC_MSG_VERSION); + LASSERTF(LUSTRE_VERSION_MASK == 0xffff0000, "found 0x%.8x\n", + LUSTRE_VERSION_MASK); + LASSERTF(LUSTRE_OBD_VERSION == 0x00010000, "found 0x%.8x\n", + LUSTRE_OBD_VERSION); + LASSERTF(LUSTRE_MDS_VERSION == 0x00020000, "found 0x%.8x\n", + LUSTRE_MDS_VERSION); + LASSERTF(LUSTRE_OST_VERSION == 0x00030000, "found 0x%.8x\n", + LUSTRE_OST_VERSION); + LASSERTF(LUSTRE_DLM_VERSION == 0x00040000, "found 0x%.8x\n", + LUSTRE_DLM_VERSION); + LASSERTF(LUSTRE_LOG_VERSION == 0x00050000, "found 0x%.8x\n", + LUSTRE_LOG_VERSION); + LASSERTF(LUSTRE_MGS_VERSION == 0x00060000, "found 0x%.8x\n", + LUSTRE_MGS_VERSION); + LASSERTF(MSGHDR_AT_SUPPORT == 1, "found %lld\n", + (long long)MSGHDR_AT_SUPPORT); + LASSERTF(MSGHDR_CKSUM_INCOMPAT18 == 2, "found %lld\n", + (long long)MSGHDR_CKSUM_INCOMPAT18); + LASSERTF(MSG_OP_FLAG_MASK == 0xffff0000UL, "found 0x%.8xUL\n", + (unsigned)MSG_OP_FLAG_MASK); + LASSERTF(MSG_OP_FLAG_SHIFT == 16, "found %lld\n", + (long long)MSG_OP_FLAG_SHIFT); + LASSERTF(MSG_GEN_FLAG_MASK == 0x0000ffffUL, "found 0x%.8xUL\n", + (unsigned)MSG_GEN_FLAG_MASK); + LASSERTF(MSG_LAST_REPLAY == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)MSG_LAST_REPLAY); + LASSERTF(MSG_RESENT == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)MSG_RESENT); + LASSERTF(MSG_REPLAY == 0x00000004UL, "found 0x%.8xUL\n", + (unsigned)MSG_REPLAY); + LASSERTF(MSG_DELAY_REPLAY == 0x00000010UL, "found 0x%.8xUL\n", + (unsigned)MSG_DELAY_REPLAY); + LASSERTF(MSG_VERSION_REPLAY == 0x00000020UL, "found 0x%.8xUL\n", + (unsigned)MSG_VERSION_REPLAY); + LASSERTF(MSG_REQ_REPLAY_DONE == 0x00000040UL, "found 0x%.8xUL\n", + (unsigned)MSG_REQ_REPLAY_DONE); + LASSERTF(MSG_LOCK_REPLAY_DONE == 0x00000080UL, "found 0x%.8xUL\n", + (unsigned)MSG_LOCK_REPLAY_DONE); + LASSERTF(MSG_CONNECT_RECOVERING == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)MSG_CONNECT_RECOVERING); + LASSERTF(MSG_CONNECT_RECONNECT == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)MSG_CONNECT_RECONNECT); + LASSERTF(MSG_CONNECT_REPLAYABLE == 0x00000004UL, "found 0x%.8xUL\n", + (unsigned)MSG_CONNECT_REPLAYABLE); + LASSERTF(MSG_CONNECT_LIBCLIENT == 0x00000010UL, "found 0x%.8xUL\n", + (unsigned)MSG_CONNECT_LIBCLIENT); + LASSERTF(MSG_CONNECT_INITIAL == 0x00000020UL, "found 0x%.8xUL\n", + (unsigned)MSG_CONNECT_INITIAL); + LASSERTF(MSG_CONNECT_ASYNC == 0x00000040UL, "found 0x%.8xUL\n", + (unsigned)MSG_CONNECT_ASYNC); + LASSERTF(MSG_CONNECT_NEXT_VER == 0x00000080UL, "found 0x%.8xUL\n", + (unsigned)MSG_CONNECT_NEXT_VER); + LASSERTF(MSG_CONNECT_TRANSNO == 0x00000100UL, "found 0x%.8xUL\n", + (unsigned)MSG_CONNECT_TRANSNO); + + /* Checks for struct obd_connect_data */ + LASSERTF((int)sizeof(struct obd_connect_data) == 192, "found %lld\n", + (long long)(int)sizeof(struct obd_connect_data)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_connect_flags) == 0, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_connect_flags)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_connect_flags) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_connect_flags)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_version) == 8, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_version)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_version) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_version)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant) == 12, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_grant)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_grant)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_index) == 16, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_index)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_index)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_brw_size) == 20, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_brw_size)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_brw_size) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_brw_size)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_ibits_known) == 24, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_ibits_known)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_blocksize) == 32, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_blocksize)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize) == 1, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_inodespace) == 33, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_inodespace)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace) == 1, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant_extent) == 34, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_grant_extent)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent) == 2, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_unused) == 36, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_unused)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_unused) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_unused)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_transno)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_transno) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_transno)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_group) == 48, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_group)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_group) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_group)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_cksum_types) == 52, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_cksum_types)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_max_easize) == 56, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_max_easize)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_instance) == 60, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_instance)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_instance) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_instance)); + LASSERTF((int)offsetof(struct obd_connect_data, ocd_maxbytes) == 64, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_maxbytes)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_maxbytes) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_maxbytes)); + LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 72, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding1)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding1)); + LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 80, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding2)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding2)); + LASSERTF((int)offsetof(struct obd_connect_data, padding3) == 88, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding3)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding3) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding3)); + LASSERTF((int)offsetof(struct obd_connect_data, padding4) == 96, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding4)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding4) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding4)); + LASSERTF((int)offsetof(struct obd_connect_data, padding5) == 104, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding5)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding5) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding5)); + LASSERTF((int)offsetof(struct obd_connect_data, padding6) == 112, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding6)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding6) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding6)); + LASSERTF((int)offsetof(struct obd_connect_data, padding7) == 120, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding7)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding7) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding7)); + LASSERTF((int)offsetof(struct obd_connect_data, padding8) == 128, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding8)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding8) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding8)); + LASSERTF((int)offsetof(struct obd_connect_data, padding9) == 136, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, padding9)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding9) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->padding9)); + LASSERTF((int)offsetof(struct obd_connect_data, paddingA) == 144, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, paddingA)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->paddingA) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->paddingA)); + LASSERTF((int)offsetof(struct obd_connect_data, paddingB) == 152, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, paddingB)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->paddingB) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->paddingB)); + LASSERTF((int)offsetof(struct obd_connect_data, paddingC) == 160, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, paddingC)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->paddingC) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->paddingC)); + LASSERTF((int)offsetof(struct obd_connect_data, paddingD) == 168, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, paddingD)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->paddingD) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->paddingD)); + LASSERTF((int)offsetof(struct obd_connect_data, paddingE) == 176, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, paddingE)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->paddingE) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->paddingE)); + LASSERTF((int)offsetof(struct obd_connect_data, paddingF) == 184, "found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, paddingF)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->paddingF) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->paddingF)); + LASSERTF(OBD_CONNECT_RDONLY == 0x1ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_RDONLY); + LASSERTF(OBD_CONNECT_INDEX == 0x2ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_INDEX); + LASSERTF(OBD_CONNECT_MDS == 0x4ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_MDS); + LASSERTF(OBD_CONNECT_GRANT == 0x8ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_GRANT); + LASSERTF(OBD_CONNECT_SRVLOCK == 0x10ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_SRVLOCK); + LASSERTF(OBD_CONNECT_VERSION == 0x20ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_VERSION); + LASSERTF(OBD_CONNECT_REQPORTAL == 0x40ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_REQPORTAL); + LASSERTF(OBD_CONNECT_ACL == 0x80ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_ACL); + LASSERTF(OBD_CONNECT_XATTR == 0x100ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_XATTR); + LASSERTF(OBD_CONNECT_CROW == 0x200ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_CROW); + LASSERTF(OBD_CONNECT_TRUNCLOCK == 0x400ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_TRUNCLOCK); + LASSERTF(OBD_CONNECT_TRANSNO == 0x800ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_TRANSNO); + LASSERTF(OBD_CONNECT_IBITS == 0x1000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_IBITS); + LASSERTF(OBD_CONNECT_JOIN == 0x2000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_JOIN); + LASSERTF(OBD_CONNECT_ATTRFID == 0x4000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_ATTRFID); + LASSERTF(OBD_CONNECT_NODEVOH == 0x8000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_NODEVOH); + LASSERTF(OBD_CONNECT_RMT_CLIENT == 0x10000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_RMT_CLIENT); + LASSERTF(OBD_CONNECT_RMT_CLIENT_FORCE == 0x20000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_RMT_CLIENT_FORCE); + LASSERTF(OBD_CONNECT_BRW_SIZE == 0x40000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_BRW_SIZE); + LASSERTF(OBD_CONNECT_QUOTA64 == 0x80000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_QUOTA64); + LASSERTF(OBD_CONNECT_MDS_CAPA == 0x100000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_MDS_CAPA); + LASSERTF(OBD_CONNECT_OSS_CAPA == 0x200000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_OSS_CAPA); + LASSERTF(OBD_CONNECT_CANCELSET == 0x400000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_CANCELSET); + LASSERTF(OBD_CONNECT_SOM == 0x800000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_SOM); + LASSERTF(OBD_CONNECT_AT == 0x1000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_AT); + LASSERTF(OBD_CONNECT_LRU_RESIZE == 0x2000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_LRU_RESIZE); + LASSERTF(OBD_CONNECT_MDS_MDS == 0x4000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_MDS_MDS); + LASSERTF(OBD_CONNECT_REAL == 0x8000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_REAL); + LASSERTF(OBD_CONNECT_CHANGE_QS == 0x10000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_CHANGE_QS); + LASSERTF(OBD_CONNECT_CKSUM == 0x20000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_CKSUM); + LASSERTF(OBD_CONNECT_FID == 0x40000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_FID); + LASSERTF(OBD_CONNECT_VBR == 0x80000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_VBR); + LASSERTF(OBD_CONNECT_LOV_V3 == 0x100000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_LOV_V3); + LASSERTF(OBD_CONNECT_GRANT_SHRINK == 0x200000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_GRANT_SHRINK); + LASSERTF(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_SKIP_ORPHAN); + LASSERTF(OBD_CONNECT_MAX_EASIZE == 0x800000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_MAX_EASIZE); + LASSERTF(OBD_CONNECT_FULL20 == 0x1000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_FULL20); + LASSERTF(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_LAYOUTLOCK); + LASSERTF(OBD_CONNECT_64BITHASH == 0x4000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_64BITHASH); + LASSERTF(OBD_CONNECT_MAXBYTES == 0x8000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_MAXBYTES); + LASSERTF(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_IMP_RECOV); + LASSERTF(OBD_CONNECT_JOBSTATS == 0x20000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_JOBSTATS); + LASSERTF(OBD_CONNECT_UMASK == 0x40000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_UMASK); + LASSERTF(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_EINPROGRESS); + LASSERTF(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_GRANT_PARAM); + LASSERTF(OBD_CONNECT_FLOCK_OWNER == 0x200000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_FLOCK_OWNER); + LASSERTF(OBD_CONNECT_LVB_TYPE == 0x400000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_LVB_TYPE); + LASSERTF(OBD_CONNECT_NANOSEC_TIME == 0x800000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_NANOSEC_TIME); + LASSERTF(OBD_CONNECT_LIGHTWEIGHT == 0x1000000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_LIGHTWEIGHT); + LASSERTF(OBD_CONNECT_SHORTIO == 0x2000000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_SHORTIO); + LASSERTF(OBD_CONNECT_PINGLESS == 0x4000000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_PINGLESS); + LASSERTF(OBD_CONNECT_FLOCK_DEAD == 0x8000000000000ULL, + "found 0x%.16llxULL\n", OBD_CONNECT_FLOCK_DEAD); + LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)OBD_CKSUM_CRC32); + LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)OBD_CKSUM_ADLER); + LASSERTF(OBD_CKSUM_CRC32C == 0x00000004UL, "found 0x%.8xUL\n", + (unsigned)OBD_CKSUM_CRC32C); + + /* Checks for struct obdo */ + LASSERTF((int)sizeof(struct obdo) == 208, "found %lld\n", + (long long)(int)sizeof(struct obdo)); + LASSERTF((int)offsetof(struct obdo, o_valid) == 0, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_valid)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_valid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_valid)); + LASSERTF((int)offsetof(struct obdo, o_oi) == 8, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_oi)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_oi) == 16, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_oi)); + LASSERTF((int)offsetof(struct obdo, o_parent_seq) == 24, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_parent_seq)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_seq) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_parent_seq)); + LASSERTF((int)offsetof(struct obdo, o_size) == 32, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_size)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_size)); + LASSERTF((int)offsetof(struct obdo, o_mtime) == 40, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_mtime)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_mtime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_mtime)); + LASSERTF((int)offsetof(struct obdo, o_atime) == 48, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_atime)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_atime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_atime)); + LASSERTF((int)offsetof(struct obdo, o_ctime) == 56, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_ctime)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_ctime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_ctime)); + LASSERTF((int)offsetof(struct obdo, o_blocks) == 64, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_blocks)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_blocks) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_blocks)); + LASSERTF((int)offsetof(struct obdo, o_grant) == 72, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_grant)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_grant) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_grant)); + LASSERTF((int)offsetof(struct obdo, o_blksize) == 80, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_blksize)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_blksize) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_blksize)); + LASSERTF((int)offsetof(struct obdo, o_mode) == 84, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_mode)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_mode)); + LASSERTF((int)offsetof(struct obdo, o_uid) == 88, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_uid)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_uid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_uid)); + LASSERTF((int)offsetof(struct obdo, o_gid) == 92, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_gid)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_gid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_gid)); + LASSERTF((int)offsetof(struct obdo, o_flags) == 96, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_flags)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_flags)); + LASSERTF((int)offsetof(struct obdo, o_nlink) == 100, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_nlink)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_nlink) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_nlink)); + LASSERTF((int)offsetof(struct obdo, o_parent_oid) == 104, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_parent_oid)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_oid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_parent_oid)); + LASSERTF((int)offsetof(struct obdo, o_misc) == 108, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_misc)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_misc) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_misc)); + LASSERTF((int)offsetof(struct obdo, o_ioepoch) == 112, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_ioepoch)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_ioepoch) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_ioepoch)); + LASSERTF((int)offsetof(struct obdo, o_stripe_idx) == 120, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_stripe_idx)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_stripe_idx) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_stripe_idx)); + LASSERTF((int)offsetof(struct obdo, o_parent_ver) == 124, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_parent_ver)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_ver) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_parent_ver)); + LASSERTF((int)offsetof(struct obdo, o_handle) == 128, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_handle)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_handle) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_handle)); + LASSERTF((int)offsetof(struct obdo, o_lcookie) == 136, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_lcookie)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_lcookie) == 32, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_lcookie)); + LASSERTF((int)offsetof(struct obdo, o_uid_h) == 168, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_uid_h)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_uid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_uid_h)); + LASSERTF((int)offsetof(struct obdo, o_gid_h) == 172, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_gid_h)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_gid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_gid_h)); + LASSERTF((int)offsetof(struct obdo, o_data_version) == 176, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_data_version)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_data_version)); + LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_padding_4)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_padding_4)); + LASSERTF((int)offsetof(struct obdo, o_padding_5) == 192, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_padding_5)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_5) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_padding_5)); + LASSERTF((int)offsetof(struct obdo, o_padding_6) == 200, "found %lld\n", + (long long)(int)offsetof(struct obdo, o_padding_6)); + LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_6) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obdo *)0)->o_padding_6)); + LASSERTF(OBD_MD_FLID == (0x00000001ULL), "found 0x%.16llxULL\n", + OBD_MD_FLID); + LASSERTF(OBD_MD_FLATIME == (0x00000002ULL), "found 0x%.16llxULL\n", + OBD_MD_FLATIME); + LASSERTF(OBD_MD_FLMTIME == (0x00000004ULL), "found 0x%.16llxULL\n", + OBD_MD_FLMTIME); + LASSERTF(OBD_MD_FLCTIME == (0x00000008ULL), "found 0x%.16llxULL\n", + OBD_MD_FLCTIME); + LASSERTF(OBD_MD_FLSIZE == (0x00000010ULL), "found 0x%.16llxULL\n", + OBD_MD_FLSIZE); + LASSERTF(OBD_MD_FLBLOCKS == (0x00000020ULL), "found 0x%.16llxULL\n", + OBD_MD_FLBLOCKS); + LASSERTF(OBD_MD_FLBLKSZ == (0x00000040ULL), "found 0x%.16llxULL\n", + OBD_MD_FLBLKSZ); + LASSERTF(OBD_MD_FLMODE == (0x00000080ULL), "found 0x%.16llxULL\n", + OBD_MD_FLMODE); + LASSERTF(OBD_MD_FLTYPE == (0x00000100ULL), "found 0x%.16llxULL\n", + OBD_MD_FLTYPE); + LASSERTF(OBD_MD_FLUID == (0x00000200ULL), "found 0x%.16llxULL\n", + OBD_MD_FLUID); + LASSERTF(OBD_MD_FLGID == (0x00000400ULL), "found 0x%.16llxULL\n", + OBD_MD_FLGID); + LASSERTF(OBD_MD_FLFLAGS == (0x00000800ULL), "found 0x%.16llxULL\n", + OBD_MD_FLFLAGS); + LASSERTF(OBD_MD_FLNLINK == (0x00002000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLNLINK); + LASSERTF(OBD_MD_FLGENER == (0x00004000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLGENER); + LASSERTF(OBD_MD_FLRDEV == (0x00010000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLRDEV); + LASSERTF(OBD_MD_FLEASIZE == (0x00020000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLEASIZE); + LASSERTF(OBD_MD_LINKNAME == (0x00040000ULL), "found 0x%.16llxULL\n", + OBD_MD_LINKNAME); + LASSERTF(OBD_MD_FLHANDLE == (0x00080000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLHANDLE); + LASSERTF(OBD_MD_FLCKSUM == (0x00100000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLCKSUM); + LASSERTF(OBD_MD_FLQOS == (0x00200000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLQOS); + LASSERTF(OBD_MD_FLCOOKIE == (0x00800000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLCOOKIE); + LASSERTF(OBD_MD_FLGROUP == (0x01000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLGROUP); + LASSERTF(OBD_MD_FLFID == (0x02000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLFID); + LASSERTF(OBD_MD_FLEPOCH == (0x04000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLEPOCH); + LASSERTF(OBD_MD_FLGRANT == (0x08000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLGRANT); + LASSERTF(OBD_MD_FLDIREA == (0x10000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLDIREA); + LASSERTF(OBD_MD_FLUSRQUOTA == (0x20000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLUSRQUOTA); + LASSERTF(OBD_MD_FLGRPQUOTA == (0x40000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLGRPQUOTA); + LASSERTF(OBD_MD_FLMODEASIZE == (0x80000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLMODEASIZE); + LASSERTF(OBD_MD_MDS == (0x0000000100000000ULL), "found 0x%.16llxULL\n", + OBD_MD_MDS); + LASSERTF(OBD_MD_REINT == (0x0000000200000000ULL), "found 0x%.16llxULL\n", + OBD_MD_REINT); + LASSERTF(OBD_MD_MEA == (0x0000000400000000ULL), "found 0x%.16llxULL\n", + OBD_MD_MEA); + LASSERTF(OBD_MD_TSTATE == (0x0000000800000000ULL), + "found 0x%.16llxULL\n", OBD_MD_TSTATE); + LASSERTF(OBD_MD_FLXATTR == (0x0000001000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLXATTR); + LASSERTF(OBD_MD_FLXATTRLS == (0x0000002000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLXATTRLS); + LASSERTF(OBD_MD_FLXATTRRM == (0x0000004000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLXATTRRM); + LASSERTF(OBD_MD_FLACL == (0x0000008000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLACL); + LASSERTF(OBD_MD_FLRMTPERM == (0x0000010000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLRMTPERM); + LASSERTF(OBD_MD_FLMDSCAPA == (0x0000020000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLMDSCAPA); + LASSERTF(OBD_MD_FLOSSCAPA == (0x0000040000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLOSSCAPA); + LASSERTF(OBD_MD_FLCKSPLIT == (0x0000080000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLCKSPLIT); + LASSERTF(OBD_MD_FLCROSSREF == (0x0000100000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLCROSSREF); + LASSERTF(OBD_MD_FLGETATTRLOCK == (0x0000200000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLGETATTRLOCK); + LASSERTF(OBD_MD_FLRMTLSETFACL == (0x0001000000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLRMTLSETFACL); + LASSERTF(OBD_MD_FLRMTLGETFACL == (0x0002000000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLRMTLGETFACL); + LASSERTF(OBD_MD_FLRMTRSETFACL == (0x0004000000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLRMTRSETFACL); + LASSERTF(OBD_MD_FLRMTRGETFACL == (0x0008000000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLRMTRGETFACL); + LASSERTF(OBD_MD_FLDATAVERSION == (0x0010000000000000ULL), "found 0x%.16llxULL\n", + OBD_MD_FLDATAVERSION); + CLASSERT(OBD_FL_INLINEDATA == 0x00000001); + CLASSERT(OBD_FL_OBDMDEXISTS == 0x00000002); + CLASSERT(OBD_FL_DELORPHAN == 0x00000004); + CLASSERT(OBD_FL_NORPC == 0x00000008); + CLASSERT(OBD_FL_IDONLY == 0x00000010); + CLASSERT(OBD_FL_RECREATE_OBJS == 0x00000020); + CLASSERT(OBD_FL_DEBUG_CHECK == 0x00000040); + CLASSERT(OBD_FL_NO_USRQUOTA == 0x00000100); + CLASSERT(OBD_FL_NO_GRPQUOTA == 0x00000200); + CLASSERT(OBD_FL_CREATE_CROW == 0x00000400); + CLASSERT(OBD_FL_SRVLOCK == 0x00000800); + CLASSERT(OBD_FL_CKSUM_CRC32 == 0x00001000); + CLASSERT(OBD_FL_CKSUM_ADLER == 0x00002000); + CLASSERT(OBD_FL_CKSUM_CRC32C == 0x00004000); + CLASSERT(OBD_FL_CKSUM_RSVD2 == 0x00008000); + CLASSERT(OBD_FL_CKSUM_RSVD3 == 0x00010000); + CLASSERT(OBD_FL_SHRINK_GRANT == 0x00020000); + CLASSERT(OBD_FL_MMAP == 0x00040000); + CLASSERT(OBD_FL_RECOV_RESEND == 0x00080000); + CLASSERT(OBD_FL_NOSPC_BLK == 0x00100000); + CLASSERT(OBD_FL_LOCAL_MASK == 0xf0000000); + + /* Checks for struct lov_ost_data_v1 */ + LASSERTF((int)sizeof(struct lov_ost_data_v1) == 24, "found %lld\n", + (long long)(int)sizeof(struct lov_ost_data_v1)); + LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_oi) == 0, "found %lld\n", + (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_oi)); + LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi) == 16, "found %lld\n", + (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi)); + LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, "found %lld\n", + (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen)); + LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen)); + LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_idx) == 20, "found %lld\n", + (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_idx)); + LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx)); + + /* Checks for struct lov_mds_md_v1 */ + LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, "found %lld\n", + (long long)(int)sizeof(struct lov_mds_md_v1)); + LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_magic) == 0, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v1, lmm_magic)); + LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic)); + LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_pattern) == 4, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v1, lmm_pattern)); + LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern)); + LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_oi) == 8, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v1, lmm_oi)); + LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_oi) == 16, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_oi)); + LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_size)); + LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size)); + LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_count) == 28, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_count)); + LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count)); + LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_layout_gen) == 30, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v1, lmm_layout_gen)); + LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_layout_gen) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_layout_gen)); + LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_objects[0]) == 32, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v1, lmm_objects[0])); + LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects[0]) == 24, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects[0])); + CLASSERT(LOV_MAGIC_V1 == 0x0BD10BD0); + + /* Checks for struct lov_mds_md_v3 */ + LASSERTF((int)sizeof(struct lov_mds_md_v3) == 48, "found %lld\n", + (long long)(int)sizeof(struct lov_mds_md_v3)); + LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_magic) == 0, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v3, lmm_magic)); + LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_magic) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_magic)); + LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_pattern) == 4, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v3, lmm_pattern)); + LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_pattern) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_pattern)); + LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_oi) == 8, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v3, lmm_oi)); + LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_oi) == 16, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_oi)); + LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_stripe_size) == 24, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v3, lmm_stripe_size)); + LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_size) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_size)); + LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_stripe_count) == 28, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v3, lmm_stripe_count)); + LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_count) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_stripe_count)); + LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_layout_gen) == 30, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v3, lmm_layout_gen)); + LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_layout_gen) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_layout_gen)); + CLASSERT(LOV_MAXPOOLNAME == 16); + LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_pool_name[16]) == 48, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v3, lmm_pool_name[16])); + LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_pool_name[16]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_pool_name[16])); + LASSERTF((int)offsetof(struct lov_mds_md_v3, lmm_objects[0]) == 48, "found %lld\n", + (long long)(int)offsetof(struct lov_mds_md_v3, lmm_objects[0])); + LASSERTF((int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_objects[0]) == 24, "found %lld\n", + (long long)(int)sizeof(((struct lov_mds_md_v3 *)0)->lmm_objects[0])); + CLASSERT(LOV_MAGIC_V3 == 0x0BD30BD0); + LASSERTF(LOV_PATTERN_RAID0 == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)LOV_PATTERN_RAID0); + LASSERTF(LOV_PATTERN_RAID1 == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)LOV_PATTERN_RAID1); + LASSERTF(LOV_PATTERN_FIRST == 0x00000100UL, "found 0x%.8xUL\n", + (unsigned)LOV_PATTERN_FIRST); + LASSERTF(LOV_PATTERN_CMOBD == 0x00000200UL, "found 0x%.8xUL\n", + (unsigned)LOV_PATTERN_CMOBD); + + /* Checks for struct obd_statfs */ + LASSERTF((int)sizeof(struct obd_statfs) == 144, "found %lld\n", + (long long)(int)sizeof(struct obd_statfs)); + LASSERTF((int)offsetof(struct obd_statfs, os_type) == 0, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_type)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_type) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_type)); + LASSERTF((int)offsetof(struct obd_statfs, os_blocks) == 8, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_blocks)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_blocks) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_blocks)); + LASSERTF((int)offsetof(struct obd_statfs, os_bfree) == 16, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_bfree)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bfree) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_bfree)); + LASSERTF((int)offsetof(struct obd_statfs, os_bavail) == 24, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_bavail)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bavail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_bavail)); + LASSERTF((int)offsetof(struct obd_statfs, os_ffree) == 40, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_ffree)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_ffree) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_ffree)); + LASSERTF((int)offsetof(struct obd_statfs, os_fsid) == 48, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_fsid)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_fsid) == 40, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_fsid)); + LASSERTF((int)offsetof(struct obd_statfs, os_bsize) == 88, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_bsize)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bsize) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_bsize)); + LASSERTF((int)offsetof(struct obd_statfs, os_namelen) == 92, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_namelen)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_namelen) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_namelen)); + LASSERTF((int)offsetof(struct obd_statfs, os_state) == 104, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_state)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_state) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_state)); + LASSERTF((int)offsetof(struct obd_statfs, os_fprecreated) == 108, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_fprecreated)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_fprecreated) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_fprecreated)); + LASSERTF((int)offsetof(struct obd_statfs, os_spare2) == 112, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_spare2)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare2)); + LASSERTF((int)offsetof(struct obd_statfs, os_spare3) == 116, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_spare3)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare3) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare3)); + LASSERTF((int)offsetof(struct obd_statfs, os_spare4) == 120, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_spare4)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare4) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare4)); + LASSERTF((int)offsetof(struct obd_statfs, os_spare5) == 124, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_spare5)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare5) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare5)); + LASSERTF((int)offsetof(struct obd_statfs, os_spare6) == 128, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_spare6)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare6) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare6)); + LASSERTF((int)offsetof(struct obd_statfs, os_spare7) == 132, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_spare7)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare7) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare7)); + LASSERTF((int)offsetof(struct obd_statfs, os_spare8) == 136, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_spare8)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare8) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare8)); + LASSERTF((int)offsetof(struct obd_statfs, os_spare9) == 140, "found %lld\n", + (long long)(int)offsetof(struct obd_statfs, os_spare9)); + LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare9) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare9)); + + /* Checks for struct obd_ioobj */ + LASSERTF((int)sizeof(struct obd_ioobj) == 24, "found %lld\n", + (long long)(int)sizeof(struct obd_ioobj)); + LASSERTF((int)offsetof(struct obd_ioobj, ioo_oid) == 0, "found %lld\n", + (long long)(int)offsetof(struct obd_ioobj, ioo_oid)); + LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_oid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_oid)); + LASSERTF((int)offsetof(struct obd_ioobj, ioo_max_brw) == 16, "found %lld\n", + (long long)(int)offsetof(struct obd_ioobj, ioo_max_brw)); + LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_max_brw) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_max_brw)); + LASSERTF((int)offsetof(struct obd_ioobj, ioo_bufcnt) == 20, "found %lld\n", + (long long)(int)offsetof(struct obd_ioobj, ioo_bufcnt)); + LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt)); + + /* Checks for union lquota_id */ + LASSERTF((int)sizeof(union lquota_id) == 16, "found %lld\n", + (long long)(int)sizeof(union lquota_id)); + + LASSERTF(QUOTABLOCK_BITS == 10, "found %lld\n", + (long long)QUOTABLOCK_BITS); + LASSERTF(QUOTABLOCK_SIZE == 1024, "found %lld\n", + (long long)QUOTABLOCK_SIZE); + + /* Checks for struct obd_quotactl */ + LASSERTF((int)sizeof(struct obd_quotactl) == 112, "found %lld\n", + (long long)(int)sizeof(struct obd_quotactl)); + LASSERTF((int)offsetof(struct obd_quotactl, qc_cmd) == 0, "found %lld\n", + (long long)(int)offsetof(struct obd_quotactl, qc_cmd)); + LASSERTF((int)sizeof(((struct obd_quotactl *)0)->qc_cmd) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_quotactl *)0)->qc_cmd)); + LASSERTF((int)offsetof(struct obd_quotactl, qc_type) == 4, "found %lld\n", + (long long)(int)offsetof(struct obd_quotactl, qc_type)); + LASSERTF((int)sizeof(((struct obd_quotactl *)0)->qc_type) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_quotactl *)0)->qc_type)); + LASSERTF((int)offsetof(struct obd_quotactl, qc_id) == 8, "found %lld\n", + (long long)(int)offsetof(struct obd_quotactl, qc_id)); + LASSERTF((int)sizeof(((struct obd_quotactl *)0)->qc_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_quotactl *)0)->qc_id)); + LASSERTF((int)offsetof(struct obd_quotactl, qc_stat) == 12, "found %lld\n", + (long long)(int)offsetof(struct obd_quotactl, qc_stat)); + LASSERTF((int)sizeof(((struct obd_quotactl *)0)->qc_stat) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_quotactl *)0)->qc_stat)); + LASSERTF((int)offsetof(struct obd_quotactl, qc_dqinfo) == 16, "found %lld\n", + (long long)(int)offsetof(struct obd_quotactl, qc_dqinfo)); + LASSERTF((int)sizeof(((struct obd_quotactl *)0)->qc_dqinfo) == 24, "found %lld\n", + (long long)(int)sizeof(((struct obd_quotactl *)0)->qc_dqinfo)); + LASSERTF((int)offsetof(struct obd_quotactl, qc_dqblk) == 40, "found %lld\n", + (long long)(int)offsetof(struct obd_quotactl, qc_dqblk)); + LASSERTF((int)sizeof(((struct obd_quotactl *)0)->qc_dqblk) == 72, "found %lld\n", + (long long)(int)sizeof(((struct obd_quotactl *)0)->qc_dqblk)); + + /* Checks for struct obd_dqinfo */ + LASSERTF((int)sizeof(struct obd_dqinfo) == 24, "found %lld\n", + (long long)(int)sizeof(struct obd_dqinfo)); + LASSERTF((int)offsetof(struct obd_dqinfo, dqi_bgrace) == 0, "found %lld\n", + (long long)(int)offsetof(struct obd_dqinfo, dqi_bgrace)); + LASSERTF((int)sizeof(((struct obd_dqinfo *)0)->dqi_bgrace) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqinfo *)0)->dqi_bgrace)); + LASSERTF((int)offsetof(struct obd_dqinfo, dqi_igrace) == 8, "found %lld\n", + (long long)(int)offsetof(struct obd_dqinfo, dqi_igrace)); + LASSERTF((int)sizeof(((struct obd_dqinfo *)0)->dqi_igrace) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqinfo *)0)->dqi_igrace)); + LASSERTF((int)offsetof(struct obd_dqinfo, dqi_flags) == 16, "found %lld\n", + (long long)(int)offsetof(struct obd_dqinfo, dqi_flags)); + LASSERTF((int)sizeof(((struct obd_dqinfo *)0)->dqi_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqinfo *)0)->dqi_flags)); + LASSERTF((int)offsetof(struct obd_dqinfo, dqi_valid) == 20, "found %lld\n", + (long long)(int)offsetof(struct obd_dqinfo, dqi_valid)); + LASSERTF((int)sizeof(((struct obd_dqinfo *)0)->dqi_valid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqinfo *)0)->dqi_valid)); + + /* Checks for struct obd_dqblk */ + LASSERTF((int)sizeof(struct obd_dqblk) == 72, "found %lld\n", + (long long)(int)sizeof(struct obd_dqblk)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_bhardlimit) == 0, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_bhardlimit)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_bhardlimit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_bhardlimit)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_bsoftlimit) == 8, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_bsoftlimit)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_bsoftlimit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_bsoftlimit)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_curspace) == 16, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_curspace)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_curspace) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_curspace)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_ihardlimit) == 24, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_ihardlimit)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_ihardlimit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_ihardlimit)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_isoftlimit) == 32, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_isoftlimit)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_isoftlimit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_isoftlimit)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_curinodes) == 40, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_curinodes)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_curinodes) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_curinodes)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_btime) == 48, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_btime)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_btime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_btime)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_itime) == 56, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_itime)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_itime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_itime)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_valid) == 64, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_valid)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_valid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_valid)); + LASSERTF((int)offsetof(struct obd_dqblk, dqb_padding) == 68, "found %lld\n", + (long long)(int)offsetof(struct obd_dqblk, dqb_padding)); + LASSERTF((int)sizeof(((struct obd_dqblk *)0)->dqb_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct obd_dqblk *)0)->dqb_padding)); + LASSERTF(Q_QUOTACHECK == 0x800100, "found 0x%.8x\n", + Q_QUOTACHECK); + LASSERTF(Q_INITQUOTA == 0x800101, "found 0x%.8x\n", + Q_INITQUOTA); + LASSERTF(Q_GETOINFO == 0x800102, "found 0x%.8x\n", + Q_GETOINFO); + LASSERTF(Q_GETOQUOTA == 0x800103, "found 0x%.8x\n", + Q_GETOQUOTA); + LASSERTF(Q_FINVALIDATE == 0x800104, "found 0x%.8x\n", + Q_FINVALIDATE); + + /* Checks for struct lquota_acct_rec */ + LASSERTF((int)sizeof(struct lquota_acct_rec) == 16, "found %lld\n", + (long long)(int)sizeof(struct lquota_acct_rec)); + LASSERTF((int)offsetof(struct lquota_acct_rec, bspace) == 0, "found %lld\n", + (long long)(int)offsetof(struct lquota_acct_rec, bspace)); + LASSERTF((int)sizeof(((struct lquota_acct_rec *)0)->bspace) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_acct_rec *)0)->bspace)); + LASSERTF((int)offsetof(struct lquota_acct_rec, ispace) == 8, "found %lld\n", + (long long)(int)offsetof(struct lquota_acct_rec, ispace)); + LASSERTF((int)sizeof(((struct lquota_acct_rec *)0)->ispace) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_acct_rec *)0)->ispace)); + + /* Checks for struct lquota_glb_rec */ + LASSERTF((int)sizeof(struct lquota_glb_rec) == 32, "found %lld\n", + (long long)(int)sizeof(struct lquota_glb_rec)); + LASSERTF((int)offsetof(struct lquota_glb_rec, qbr_hardlimit) == 0, "found %lld\n", + (long long)(int)offsetof(struct lquota_glb_rec, qbr_hardlimit)); + LASSERTF((int)sizeof(((struct lquota_glb_rec *)0)->qbr_hardlimit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_glb_rec *)0)->qbr_hardlimit)); + LASSERTF((int)offsetof(struct lquota_glb_rec, qbr_softlimit) == 8, "found %lld\n", + (long long)(int)offsetof(struct lquota_glb_rec, qbr_softlimit)); + LASSERTF((int)sizeof(((struct lquota_glb_rec *)0)->qbr_softlimit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_glb_rec *)0)->qbr_softlimit)); + LASSERTF((int)offsetof(struct lquota_glb_rec, qbr_time) == 16, "found %lld\n", + (long long)(int)offsetof(struct lquota_glb_rec, qbr_time)); + LASSERTF((int)sizeof(((struct lquota_glb_rec *)0)->qbr_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_glb_rec *)0)->qbr_time)); + LASSERTF((int)offsetof(struct lquota_glb_rec, qbr_granted) == 24, "found %lld\n", + (long long)(int)offsetof(struct lquota_glb_rec, qbr_granted)); + LASSERTF((int)sizeof(((struct lquota_glb_rec *)0)->qbr_granted) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_glb_rec *)0)->qbr_granted)); + + /* Checks for struct lquota_slv_rec */ + LASSERTF((int)sizeof(struct lquota_slv_rec) == 8, "found %lld\n", + (long long)(int)sizeof(struct lquota_slv_rec)); + LASSERTF((int)offsetof(struct lquota_slv_rec, qsr_granted) == 0, "found %lld\n", + (long long)(int)offsetof(struct lquota_slv_rec, qsr_granted)); + LASSERTF((int)sizeof(((struct lquota_slv_rec *)0)->qsr_granted) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_slv_rec *)0)->qsr_granted)); + + /* Checks for struct idx_info */ + LASSERTF((int)sizeof(struct idx_info) == 80, "found %lld\n", + (long long)(int)sizeof(struct idx_info)); + LASSERTF((int)offsetof(struct idx_info, ii_magic) == 0, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_magic)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_magic) == 4, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_magic)); + LASSERTF((int)offsetof(struct idx_info, ii_flags) == 4, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_flags)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_flags)); + LASSERTF((int)offsetof(struct idx_info, ii_count) == 8, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_count)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_count) == 2, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_count)); + LASSERTF((int)offsetof(struct idx_info, ii_pad0) == 10, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_pad0)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_pad0) == 2, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_pad0)); + LASSERTF((int)offsetof(struct idx_info, ii_attrs) == 12, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_attrs)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_attrs) == 4, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_attrs)); + LASSERTF((int)offsetof(struct idx_info, ii_fid) == 16, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_fid)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_fid)); + LASSERTF((int)offsetof(struct idx_info, ii_version) == 32, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_version)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_version) == 8, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_version)); + LASSERTF((int)offsetof(struct idx_info, ii_hash_start) == 40, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_hash_start)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_hash_start) == 8, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_hash_start)); + LASSERTF((int)offsetof(struct idx_info, ii_hash_end) == 48, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_hash_end)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_hash_end) == 8, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_hash_end)); + LASSERTF((int)offsetof(struct idx_info, ii_keysize) == 56, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_keysize)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_keysize) == 2, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_keysize)); + LASSERTF((int)offsetof(struct idx_info, ii_recsize) == 58, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_recsize)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_recsize) == 2, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_recsize)); + LASSERTF((int)offsetof(struct idx_info, ii_pad1) == 60, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_pad1)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_pad1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_pad1)); + LASSERTF((int)offsetof(struct idx_info, ii_pad2) == 64, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_pad2)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_pad2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_pad2)); + LASSERTF((int)offsetof(struct idx_info, ii_pad3) == 72, "found %lld\n", + (long long)(int)offsetof(struct idx_info, ii_pad3)); + LASSERTF((int)sizeof(((struct idx_info *)0)->ii_pad3) == 8, "found %lld\n", + (long long)(int)sizeof(((struct idx_info *)0)->ii_pad3)); + CLASSERT(IDX_INFO_MAGIC == 0x3D37CC37); + + /* Checks for struct lu_idxpage */ + LASSERTF((int)sizeof(struct lu_idxpage) == 16, "found %lld\n", + (long long)(int)sizeof(struct lu_idxpage)); + LASSERTF((int)offsetof(struct lu_idxpage, lip_magic) == 0, "found %lld\n", + (long long)(int)offsetof(struct lu_idxpage, lip_magic)); + LASSERTF((int)sizeof(((struct lu_idxpage *)0)->lip_magic) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lu_idxpage *)0)->lip_magic)); + LASSERTF((int)offsetof(struct lu_idxpage, lip_flags) == 4, "found %lld\n", + (long long)(int)offsetof(struct lu_idxpage, lip_flags)); + LASSERTF((int)sizeof(((struct lu_idxpage *)0)->lip_flags) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lu_idxpage *)0)->lip_flags)); + LASSERTF((int)offsetof(struct lu_idxpage, lip_nr) == 6, "found %lld\n", + (long long)(int)offsetof(struct lu_idxpage, lip_nr)); + LASSERTF((int)sizeof(((struct lu_idxpage *)0)->lip_nr) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lu_idxpage *)0)->lip_nr)); + LASSERTF((int)offsetof(struct lu_idxpage, lip_pad0) == 8, "found %lld\n", + (long long)(int)offsetof(struct lu_idxpage, lip_pad0)); + LASSERTF((int)sizeof(((struct lu_idxpage *)0)->lip_pad0) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lu_idxpage *)0)->lip_pad0)); + CLASSERT(LIP_MAGIC == 0x8A6D6B6C); + LASSERTF(LIP_HDR_SIZE == 16, "found %lld\n", + (long long)LIP_HDR_SIZE); + LASSERTF(II_FL_NOHASH == 1, "found %lld\n", + (long long)II_FL_NOHASH); + LASSERTF(II_FL_VARKEY == 2, "found %lld\n", + (long long)II_FL_VARKEY); + LASSERTF(II_FL_VARREC == 4, "found %lld\n", + (long long)II_FL_VARREC); + LASSERTF(II_FL_NONUNQ == 8, "found %lld\n", + (long long)II_FL_NONUNQ); + + /* Checks for struct niobuf_remote */ + LASSERTF((int)sizeof(struct niobuf_remote) == 16, "found %lld\n", + (long long)(int)sizeof(struct niobuf_remote)); + LASSERTF((int)offsetof(struct niobuf_remote, offset) == 0, "found %lld\n", + (long long)(int)offsetof(struct niobuf_remote, offset)); + LASSERTF((int)sizeof(((struct niobuf_remote *)0)->offset) == 8, "found %lld\n", + (long long)(int)sizeof(((struct niobuf_remote *)0)->offset)); + LASSERTF((int)offsetof(struct niobuf_remote, len) == 8, "found %lld\n", + (long long)(int)offsetof(struct niobuf_remote, len)); + LASSERTF((int)sizeof(((struct niobuf_remote *)0)->len) == 4, "found %lld\n", + (long long)(int)sizeof(((struct niobuf_remote *)0)->len)); + LASSERTF((int)offsetof(struct niobuf_remote, flags) == 12, "found %lld\n", + (long long)(int)offsetof(struct niobuf_remote, flags)); + LASSERTF((int)sizeof(((struct niobuf_remote *)0)->flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct niobuf_remote *)0)->flags)); + LASSERTF(OBD_BRW_READ == 0x01, "found 0x%.8x\n", + OBD_BRW_READ); + LASSERTF(OBD_BRW_WRITE == 0x02, "found 0x%.8x\n", + OBD_BRW_WRITE); + LASSERTF(OBD_BRW_SYNC == 0x08, "found 0x%.8x\n", + OBD_BRW_SYNC); + LASSERTF(OBD_BRW_CHECK == 0x10, "found 0x%.8x\n", + OBD_BRW_CHECK); + LASSERTF(OBD_BRW_FROM_GRANT == 0x20, "found 0x%.8x\n", + OBD_BRW_FROM_GRANT); + LASSERTF(OBD_BRW_GRANTED == 0x40, "found 0x%.8x\n", + OBD_BRW_GRANTED); + LASSERTF(OBD_BRW_NOCACHE == 0x80, "found 0x%.8x\n", + OBD_BRW_NOCACHE); + LASSERTF(OBD_BRW_NOQUOTA == 0x100, "found 0x%.8x\n", + OBD_BRW_NOQUOTA); + LASSERTF(OBD_BRW_SRVLOCK == 0x200, "found 0x%.8x\n", + OBD_BRW_SRVLOCK); + LASSERTF(OBD_BRW_ASYNC == 0x400, "found 0x%.8x\n", + OBD_BRW_ASYNC); + LASSERTF(OBD_BRW_MEMALLOC == 0x800, "found 0x%.8x\n", + OBD_BRW_MEMALLOC); + + /* Checks for struct ost_body */ + LASSERTF((int)sizeof(struct ost_body) == 208, "found %lld\n", + (long long)(int)sizeof(struct ost_body)); + LASSERTF((int)offsetof(struct ost_body, oa) == 0, "found %lld\n", + (long long)(int)offsetof(struct ost_body, oa)); + LASSERTF((int)sizeof(((struct ost_body *)0)->oa) == 208, "found %lld\n", + (long long)(int)sizeof(((struct ost_body *)0)->oa)); + + /* Checks for struct ll_fid */ + LASSERTF((int)sizeof(struct ll_fid) == 16, "found %lld\n", + (long long)(int)sizeof(struct ll_fid)); + LASSERTF((int)offsetof(struct ll_fid, id) == 0, "found %lld\n", + (long long)(int)offsetof(struct ll_fid, id)); + LASSERTF((int)sizeof(((struct ll_fid *)0)->id) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ll_fid *)0)->id)); + LASSERTF((int)offsetof(struct ll_fid, generation) == 8, "found %lld\n", + (long long)(int)offsetof(struct ll_fid, generation)); + LASSERTF((int)sizeof(((struct ll_fid *)0)->generation) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ll_fid *)0)->generation)); + LASSERTF((int)offsetof(struct ll_fid, f_type) == 12, "found %lld\n", + (long long)(int)offsetof(struct ll_fid, f_type)); + LASSERTF((int)sizeof(((struct ll_fid *)0)->f_type) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ll_fid *)0)->f_type)); + + /* Checks for struct mdt_body */ + LASSERTF((int)sizeof(struct mdt_body) == 216, "found %lld\n", + (long long)(int)sizeof(struct mdt_body)); + LASSERTF((int)offsetof(struct mdt_body, fid1) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, fid1)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->fid1) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->fid1)); + LASSERTF((int)offsetof(struct mdt_body, fid2) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, fid2)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->fid2) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->fid2)); + LASSERTF((int)offsetof(struct mdt_body, handle) == 32, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, handle)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->handle) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->handle)); + LASSERTF((int)offsetof(struct mdt_body, valid) == 40, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, valid)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->valid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->valid)); + LASSERTF((int)offsetof(struct mdt_body, size) == 48, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, size)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->size)); + LASSERTF((int)offsetof(struct mdt_body, mtime) == 56, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, mtime)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->mtime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->mtime)); + LASSERTF((int)offsetof(struct mdt_body, atime) == 64, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, atime)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->atime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->atime)); + LASSERTF((int)offsetof(struct mdt_body, ctime) == 72, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, ctime)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->ctime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->ctime)); + LASSERTF((int)offsetof(struct mdt_body, blocks) == 80, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, blocks)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->blocks) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->blocks)); + LASSERTF((int)offsetof(struct mdt_body, t_state) == 96, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, t_state)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->t_state) == 8, + "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->t_state)); + LASSERTF((int)offsetof(struct mdt_body, fsuid) == 104, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, fsuid)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->fsuid)); + LASSERTF((int)offsetof(struct mdt_body, fsgid) == 108, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, fsgid)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->fsgid)); + LASSERTF((int)offsetof(struct mdt_body, capability) == 112, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, capability)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->capability) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->capability)); + LASSERTF((int)offsetof(struct mdt_body, mode) == 116, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, mode)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->mode)); + LASSERTF((int)offsetof(struct mdt_body, uid) == 120, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, uid)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->uid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->uid)); + LASSERTF((int)offsetof(struct mdt_body, gid) == 124, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, gid)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->gid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->gid)); + LASSERTF((int)offsetof(struct mdt_body, flags) == 128, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, flags)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->flags)); + LASSERTF((int)offsetof(struct mdt_body, rdev) == 132, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, rdev)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->rdev) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->rdev)); + LASSERTF((int)offsetof(struct mdt_body, nlink) == 136, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, nlink)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->nlink) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->nlink)); + LASSERTF((int)offsetof(struct mdt_body, unused2) == 140, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, unused2)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->unused2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->unused2)); + LASSERTF((int)offsetof(struct mdt_body, suppgid) == 144, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, suppgid)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->suppgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->suppgid)); + LASSERTF((int)offsetof(struct mdt_body, eadatasize) == 148, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, eadatasize)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->eadatasize) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->eadatasize)); + LASSERTF((int)offsetof(struct mdt_body, aclsize) == 152, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, aclsize)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->aclsize) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->aclsize)); + LASSERTF((int)offsetof(struct mdt_body, max_mdsize) == 156, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, max_mdsize)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->max_mdsize) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->max_mdsize)); + LASSERTF((int)offsetof(struct mdt_body, max_cookiesize) == 160, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, max_cookiesize)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->max_cookiesize) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->max_cookiesize)); + LASSERTF((int)offsetof(struct mdt_body, uid_h) == 164, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, uid_h)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->uid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->uid_h)); + LASSERTF((int)offsetof(struct mdt_body, gid_h) == 168, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, gid_h)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->gid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->gid_h)); + LASSERTF((int)offsetof(struct mdt_body, padding_5) == 172, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, padding_5)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->padding_5) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->padding_5)); + LASSERTF((int)offsetof(struct mdt_body, padding_6) == 176, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, padding_6)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->padding_6) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->padding_6)); + LASSERTF((int)offsetof(struct mdt_body, padding_7) == 184, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, padding_7)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->padding_7) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->padding_7)); + LASSERTF((int)offsetof(struct mdt_body, padding_8) == 192, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, padding_8)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->padding_8) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->padding_8)); + LASSERTF((int)offsetof(struct mdt_body, padding_9) == 200, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, padding_9)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->padding_9) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->padding_9)); + LASSERTF((int)offsetof(struct mdt_body, padding_10) == 208, "found %lld\n", + (long long)(int)offsetof(struct mdt_body, padding_10)); + LASSERTF((int)sizeof(((struct mdt_body *)0)->padding_10) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_body *)0)->padding_10)); + LASSERTF(MDS_FMODE_CLOSED == 000000000000UL, "found 0%.11oUL\n", + MDS_FMODE_CLOSED); + LASSERTF(MDS_FMODE_EXEC == 000000000004UL, "found 0%.11oUL\n", + MDS_FMODE_EXEC); + LASSERTF(MDS_FMODE_EPOCH == 000001000000UL, "found 0%.11oUL\n", + MDS_FMODE_EPOCH); + LASSERTF(MDS_FMODE_TRUNC == 000002000000UL, "found 0%.11oUL\n", + MDS_FMODE_TRUNC); + LASSERTF(MDS_FMODE_SOM == 000004000000UL, "found 0%.11oUL\n", + MDS_FMODE_SOM); + LASSERTF(MDS_OPEN_CREATED == 000000000010UL, "found 0%.11oUL\n", + MDS_OPEN_CREATED); + LASSERTF(MDS_OPEN_CROSS == 000000000020UL, "found 0%.11oUL\n", + MDS_OPEN_CROSS); + LASSERTF(MDS_OPEN_CREAT == 000000000100UL, "found 0%.11oUL\n", + MDS_OPEN_CREAT); + LASSERTF(MDS_OPEN_EXCL == 000000000200UL, "found 0%.11oUL\n", + MDS_OPEN_EXCL); + LASSERTF(MDS_OPEN_TRUNC == 000000001000UL, "found 0%.11oUL\n", + MDS_OPEN_TRUNC); + LASSERTF(MDS_OPEN_APPEND == 000000002000UL, "found 0%.11oUL\n", + MDS_OPEN_APPEND); + LASSERTF(MDS_OPEN_SYNC == 000000010000UL, "found 0%.11oUL\n", + MDS_OPEN_SYNC); + LASSERTF(MDS_OPEN_DIRECTORY == 000000200000UL, "found 0%.11oUL\n", + MDS_OPEN_DIRECTORY); + LASSERTF(MDS_OPEN_BY_FID == 000040000000UL, "found 0%.11oUL\n", + MDS_OPEN_BY_FID); + LASSERTF(MDS_OPEN_DELAY_CREATE == 000100000000UL, "found 0%.11oUL\n", + MDS_OPEN_DELAY_CREATE); + LASSERTF(MDS_OPEN_OWNEROVERRIDE == 000200000000UL, "found 0%.11oUL\n", + MDS_OPEN_OWNEROVERRIDE); + LASSERTF(MDS_OPEN_JOIN_FILE == 000400000000UL, "found 0%.11oUL\n", + MDS_OPEN_JOIN_FILE); + LASSERTF(MDS_OPEN_LOCK == 004000000000UL, "found 0%.11oUL\n", + MDS_OPEN_LOCK); + LASSERTF(MDS_OPEN_HAS_EA == 010000000000UL, "found 0%.11oUL\n", + MDS_OPEN_HAS_EA); + LASSERTF(MDS_OPEN_HAS_OBJS == 020000000000UL, "found 0%.11oUL\n", + MDS_OPEN_HAS_OBJS); + LASSERTF(MDS_OPEN_NORESTORE == 00000000000100000000000ULL, "found 0%.22lloULL\n", + (long long)MDS_OPEN_NORESTORE); + LASSERTF(MDS_OPEN_NEWSTRIPE == 00000000000200000000000ULL, "found 0%.22lloULL\n", + (long long)MDS_OPEN_NEWSTRIPE); + LASSERTF(MDS_OPEN_VOLATILE == 00000000000400000000000ULL, "found 0%.22lloULL\n", + (long long)MDS_OPEN_VOLATILE); + LASSERTF(LUSTRE_SYNC_FL == 0x00000008, "found 0x%.8x\n", + LUSTRE_SYNC_FL); + LASSERTF(LUSTRE_IMMUTABLE_FL == 0x00000010, "found 0x%.8x\n", + LUSTRE_IMMUTABLE_FL); + LASSERTF(LUSTRE_APPEND_FL == 0x00000020, "found 0x%.8x\n", + LUSTRE_APPEND_FL); + LASSERTF(LUSTRE_NOATIME_FL == 0x00000080, "found 0x%.8x\n", + LUSTRE_NOATIME_FL); + LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n", + LUSTRE_DIRSYNC_FL); + LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n", + MDS_INODELOCK_LOOKUP); + LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n", + MDS_INODELOCK_UPDATE); + LASSERTF(MDS_INODELOCK_OPEN == 0x000004, "found 0x%.8x\n", + MDS_INODELOCK_OPEN); + LASSERTF(MDS_INODELOCK_LAYOUT == 0x000008, "found 0x%.8x\n", + MDS_INODELOCK_LAYOUT); + + /* Checks for struct mdt_ioepoch */ + LASSERTF((int)sizeof(struct mdt_ioepoch) == 24, "found %lld\n", + (long long)(int)sizeof(struct mdt_ioepoch)); + LASSERTF((int)offsetof(struct mdt_ioepoch, handle) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_ioepoch, handle)); + LASSERTF((int)sizeof(((struct mdt_ioepoch *)0)->handle) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_ioepoch *)0)->handle)); + LASSERTF((int)offsetof(struct mdt_ioepoch, ioepoch) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_ioepoch, ioepoch)); + LASSERTF((int)sizeof(((struct mdt_ioepoch *)0)->ioepoch) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_ioepoch *)0)->ioepoch)); + LASSERTF((int)offsetof(struct mdt_ioepoch, flags) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_ioepoch, flags)); + LASSERTF((int)sizeof(((struct mdt_ioepoch *)0)->flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_ioepoch *)0)->flags)); + LASSERTF((int)offsetof(struct mdt_ioepoch, padding) == 20, "found %lld\n", + (long long)(int)offsetof(struct mdt_ioepoch, padding)); + LASSERTF((int)sizeof(((struct mdt_ioepoch *)0)->padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_ioepoch *)0)->padding)); + + /* Checks for struct mdt_remote_perm */ + LASSERTF((int)sizeof(struct mdt_remote_perm) == 32, "found %lld\n", + (long long)(int)sizeof(struct mdt_remote_perm)); + LASSERTF((int)offsetof(struct mdt_remote_perm, rp_uid) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_remote_perm, rp_uid)); + LASSERTF((int)sizeof(((struct mdt_remote_perm *)0)->rp_uid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_remote_perm *)0)->rp_uid)); + LASSERTF((int)offsetof(struct mdt_remote_perm, rp_gid) == 4, "found %lld\n", + (long long)(int)offsetof(struct mdt_remote_perm, rp_gid)); + LASSERTF((int)sizeof(((struct mdt_remote_perm *)0)->rp_gid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_remote_perm *)0)->rp_gid)); + LASSERTF((int)offsetof(struct mdt_remote_perm, rp_fsuid) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_remote_perm, rp_fsuid)); + LASSERTF((int)sizeof(((struct mdt_remote_perm *)0)->rp_fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_remote_perm *)0)->rp_fsuid)); + LASSERTF((int)offsetof(struct mdt_remote_perm, rp_fsgid) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_remote_perm, rp_fsgid)); + LASSERTF((int)sizeof(((struct mdt_remote_perm *)0)->rp_fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_remote_perm *)0)->rp_fsgid)); + LASSERTF((int)offsetof(struct mdt_remote_perm, rp_access_perm) == 24, "found %lld\n", + (long long)(int)offsetof(struct mdt_remote_perm, rp_access_perm)); + LASSERTF((int)sizeof(((struct mdt_remote_perm *)0)->rp_access_perm) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_remote_perm *)0)->rp_access_perm)); + LASSERTF((int)offsetof(struct mdt_remote_perm, rp_padding) == 28, "found %lld\n", + (long long)(int)offsetof(struct mdt_remote_perm, rp_padding)); + LASSERTF((int)sizeof(((struct mdt_remote_perm *)0)->rp_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_remote_perm *)0)->rp_padding)); + LASSERTF(CFS_SETUID_PERM == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)CFS_SETUID_PERM); + LASSERTF(CFS_SETGID_PERM == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)CFS_SETGID_PERM); + LASSERTF(CFS_SETGRP_PERM == 0x00000004UL, "found 0x%.8xUL\n", + (unsigned)CFS_SETGRP_PERM); + LASSERTF(CFS_RMTACL_PERM == 0x00000008UL, "found 0x%.8xUL\n", + (unsigned)CFS_RMTACL_PERM); + LASSERTF(CFS_RMTOWN_PERM == 0x00000010UL, "found 0x%.8xUL\n", + (unsigned)CFS_RMTOWN_PERM); + + /* Checks for struct mdt_rec_setattr */ + LASSERTF((int)sizeof(struct mdt_rec_setattr) == 136, "found %lld\n", + (long long)(int)sizeof(struct mdt_rec_setattr)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_opcode) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_opcode)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_opcode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_opcode)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_cap) == 4, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_cap)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_cap) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_cap)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_fsuid) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_fsuid)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_fsuid)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_fsuid_h) == 12, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_fsuid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_fsuid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_fsuid_h)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_fsgid) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_fsgid)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_fsgid)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_fsgid_h) == 20, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_fsgid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_fsgid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_fsgid_h)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_suppgid) == 24, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_suppgid)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_suppgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_suppgid)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_suppgid_h) == 28, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_suppgid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_suppgid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_suppgid_h)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_1) == 32, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_1)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_1)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_1_h) == 36, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_1_h)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_1_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_1_h)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_fid) == 40, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_fid)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_fid)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_valid) == 56, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_valid)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_valid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_valid)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_uid) == 64, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_uid)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_uid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_uid)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_gid) == 68, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_gid)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_gid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_gid)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_size) == 72, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_size)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_size)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_blocks) == 80, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_blocks)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_blocks) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_blocks)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_mtime) == 88, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_mtime)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_mtime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_mtime)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_atime) == 96, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_atime)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_atime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_atime)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_ctime) == 104, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_ctime)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_ctime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_ctime)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_attr_flags) == 112, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_attr_flags)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_attr_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_attr_flags)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_mode) == 116, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_mode)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_mode)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_bias) == 120, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_bias)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_bias) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_bias)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_3) == 124, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_3)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_3) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_3)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_4) == 128, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_4)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_4) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_4)); + LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_5) == 132, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_5)); + LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_5) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_5)); + + /* Checks for struct mdt_rec_create */ + LASSERTF((int)sizeof(struct mdt_rec_create) == 136, "found %lld\n", + (long long)(int)sizeof(struct mdt_rec_create)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_opcode) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_opcode)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_opcode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_opcode)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_cap) == 4, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_cap)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_cap) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_cap)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_fsuid) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_fsuid)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_fsuid)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_fsuid_h) == 12, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_fsuid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_fsuid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_fsuid_h)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_fsgid) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_fsgid)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_fsgid)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_fsgid_h) == 20, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_fsgid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_fsgid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_fsgid_h)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_suppgid1) == 24, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_suppgid1)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_suppgid1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_suppgid1)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_suppgid1_h) == 28, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_suppgid1_h)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_suppgid1_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_suppgid1_h)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_suppgid2) == 32, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_suppgid2)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_suppgid2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_suppgid2)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_suppgid2_h) == 36, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_suppgid2_h)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_suppgid2_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_suppgid2_h)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_fid1) == 40, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_fid1)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_fid1) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_fid1)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_fid2) == 56, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_fid2)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_fid2) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_fid2)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_old_handle) == 72, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_old_handle)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_old_handle) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_old_handle)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_time) == 80, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_time)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_time)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_rdev) == 88, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_rdev)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_rdev) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_rdev)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_ioepoch) == 96, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_ioepoch)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_ioepoch) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_ioepoch)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_padding_1) == 104, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_padding_1)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_padding_1) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_padding_1)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_mode) == 112, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_mode)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_mode)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_bias) == 116, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_bias)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_bias) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_bias)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_flags_l) == 120, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_flags_l)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_flags_l) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_flags_l)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_flags_h) == 124, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_flags_h)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_flags_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_flags_h)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_umask) == 128, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_umask)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_umask) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_umask)); + LASSERTF((int)offsetof(struct mdt_rec_create, cr_padding_4) == 132, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_create, cr_padding_4)); + LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_padding_4) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_padding_4)); + + /* Checks for struct mdt_rec_link */ + LASSERTF((int)sizeof(struct mdt_rec_link) == 136, "found %lld\n", + (long long)(int)sizeof(struct mdt_rec_link)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_opcode) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_opcode)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_opcode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_opcode)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_cap) == 4, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_cap)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_cap) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_cap)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_fsuid) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_fsuid)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_fsuid)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_fsuid_h) == 12, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_fsuid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_fsuid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_fsuid_h)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_fsgid) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_fsgid)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_fsgid)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_fsgid_h) == 20, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_fsgid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_fsgid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_fsgid_h)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_suppgid1) == 24, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_suppgid1)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_suppgid1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_suppgid1)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_suppgid1_h) == 28, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_suppgid1_h)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_suppgid1_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_suppgid1_h)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_suppgid2) == 32, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_suppgid2)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_suppgid2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_suppgid2)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_suppgid2_h) == 36, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_suppgid2_h)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_suppgid2_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_suppgid2_h)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_fid1) == 40, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_fid1)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_fid1) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_fid1)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_fid2) == 56, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_fid2)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_fid2) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_fid2)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_time) == 72, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_time)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_time)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_1) == 80, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_1)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_1) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_1)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_2) == 88, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_2)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_2)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_3) == 96, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_3)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_3) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_3)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_4) == 104, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_4)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_4) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_4)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_bias) == 112, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_bias)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_bias) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_bias)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_5) == 116, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_5)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_5) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_5)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_6) == 120, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_6)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_6) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_6)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_7) == 124, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_7)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_7) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_7)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_8) == 128, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_8)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_8) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_8)); + LASSERTF((int)offsetof(struct mdt_rec_link, lk_padding_9) == 132, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_link, lk_padding_9)); + LASSERTF((int)sizeof(((struct mdt_rec_link *)0)->lk_padding_9) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_link *)0)->lk_padding_9)); + + /* Checks for struct mdt_rec_unlink */ + LASSERTF((int)sizeof(struct mdt_rec_unlink) == 136, "found %lld\n", + (long long)(int)sizeof(struct mdt_rec_unlink)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_opcode) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_opcode)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_opcode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_opcode)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_cap) == 4, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_cap)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_cap) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_cap)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_fsuid) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_fsuid)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_fsuid)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_fsuid_h) == 12, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_fsuid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_fsuid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_fsuid_h)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_fsgid) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_fsgid)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_fsgid)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_fsgid_h) == 20, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_fsgid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_fsgid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_fsgid_h)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_suppgid1) == 24, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_suppgid1)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_suppgid1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_suppgid1)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_suppgid1_h) == 28, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_suppgid1_h)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_suppgid1_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_suppgid1_h)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_suppgid2) == 32, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_suppgid2)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_suppgid2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_suppgid2)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_suppgid2_h) == 36, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_suppgid2_h)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_suppgid2_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_suppgid2_h)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_fid1) == 40, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_fid1)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_fid1) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_fid1)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_fid2) == 56, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_fid2)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_fid2) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_fid2)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_time) == 72, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_time)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_time)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_padding_2) == 80, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_padding_2)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_2)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_padding_3) == 88, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_padding_3)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_3) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_3)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_padding_4) == 96, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_padding_4)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_4) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_4)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_padding_5) == 104, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_padding_5)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_5) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_5)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_bias) == 112, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_bias)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_bias) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_bias)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_mode) == 116, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_mode)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_mode)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_padding_6) == 120, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_padding_6)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_6) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_6)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_padding_7) == 124, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_padding_7)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_7) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_7)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_padding_8) == 128, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_padding_8)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_8) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_8)); + LASSERTF((int)offsetof(struct mdt_rec_unlink, ul_padding_9) == 132, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_unlink, ul_padding_9)); + LASSERTF((int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_9) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_unlink *)0)->ul_padding_9)); + + /* Checks for struct mdt_rec_rename */ + LASSERTF((int)sizeof(struct mdt_rec_rename) == 136, "found %lld\n", + (long long)(int)sizeof(struct mdt_rec_rename)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_opcode) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_opcode)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_opcode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_opcode)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_cap) == 4, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_cap)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_cap) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_cap)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_fsuid) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_fsuid)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_fsuid)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_fsuid_h) == 12, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_fsuid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_fsuid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_fsuid_h)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_fsgid) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_fsgid)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_fsgid)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_fsgid_h) == 20, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_fsgid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_fsgid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_fsgid_h)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_suppgid1) == 24, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_suppgid1)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_suppgid1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_suppgid1)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_suppgid1_h) == 28, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_suppgid1_h)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_suppgid1_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_suppgid1_h)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_suppgid2) == 32, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_suppgid2)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_suppgid2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_suppgid2)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_suppgid2_h) == 36, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_suppgid2_h)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_suppgid2_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_suppgid2_h)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_fid1) == 40, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_fid1)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_fid1) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_fid1)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_fid2) == 56, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_fid2)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_fid2) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_fid2)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_time) == 72, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_time)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_time)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_padding_1) == 80, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_padding_1)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_1) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_1)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_padding_2) == 88, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_padding_2)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_2)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_padding_3) == 96, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_padding_3)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_3) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_3)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_padding_4) == 104, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_padding_4)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_4) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_4)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_bias) == 112, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_bias)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_bias) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_bias)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_mode) == 116, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_mode)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_mode)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_padding_5) == 120, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_padding_5)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_5) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_5)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_padding_6) == 124, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_padding_6)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_6) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_6)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_padding_7) == 128, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_padding_7)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_7) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_7)); + LASSERTF((int)offsetof(struct mdt_rec_rename, rn_padding_8) == 132, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_rename, rn_padding_8)); + LASSERTF((int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_8) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_rename *)0)->rn_padding_8)); + + /* Checks for struct mdt_rec_setxattr */ + LASSERTF((int)sizeof(struct mdt_rec_setxattr) == 136, "found %lld\n", + (long long)(int)sizeof(struct mdt_rec_setxattr)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_opcode) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_opcode)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_opcode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_opcode)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_cap) == 4, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_cap)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_cap) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_cap)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_fsuid) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_fsuid)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fsuid)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_fsuid_h) == 12, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_fsuid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fsuid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fsuid_h)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_fsgid) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_fsgid)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fsgid)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_fsgid_h) == 20, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_fsgid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fsgid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fsgid_h)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_suppgid1) == 24, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_suppgid1)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_suppgid1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_suppgid1)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_suppgid1_h) == 28, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_suppgid1_h)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_suppgid1_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_suppgid1_h)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_suppgid2) == 32, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_suppgid2)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_suppgid2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_suppgid2)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_suppgid2_h) == 36, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_suppgid2_h)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_suppgid2_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_suppgid2_h)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_fid) == 40, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_fid)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_fid)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_1) == 56, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_1)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_1) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_1)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_2) == 64, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_2)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_2)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_3) == 68, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_3)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_3) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_3)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_valid) == 72, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_valid)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_valid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_valid)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_time) == 80, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_time)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_time)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_5) == 88, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_5)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_5) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_5)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_6) == 96, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_6)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_6) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_6)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_7) == 104, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_7)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_7) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_7)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_size) == 112, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_size)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_size) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_size)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_flags) == 116, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_flags)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_flags)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_8) == 120, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_8)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_8) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_8)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_9) == 124, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_9)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_9) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_9)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_10) == 128, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_10)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_10) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_10)); + LASSERTF((int)offsetof(struct mdt_rec_setxattr, sx_padding_11) == 132, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_setxattr, sx_padding_11)); + LASSERTF((int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_11) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_setxattr *)0)->sx_padding_11)); + + /* Checks for struct mdt_rec_reint */ + LASSERTF((int)sizeof(struct mdt_rec_reint) == 136, "found %lld\n", + (long long)(int)sizeof(struct mdt_rec_reint)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_opcode) == 0, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_opcode)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_opcode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_opcode)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_cap) == 4, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_cap)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_cap) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_cap)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_fsuid) == 8, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_fsuid)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_fsuid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_fsuid)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_fsuid_h) == 12, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_fsuid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_fsuid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_fsuid_h)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_fsgid) == 16, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_fsgid)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_fsgid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_fsgid)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_fsgid_h) == 20, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_fsgid_h)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_fsgid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_fsgid_h)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_suppgid1) == 24, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_suppgid1)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_suppgid1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_suppgid1)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_suppgid1_h) == 28, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_suppgid1_h)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_suppgid1_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_suppgid1_h)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_suppgid2) == 32, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_suppgid2)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_suppgid2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_suppgid2)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_suppgid2_h) == 36, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_suppgid2_h)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_suppgid2_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_suppgid2_h)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_fid1) == 40, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_fid1)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_fid1) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_fid1)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_fid2) == 56, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_fid2)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_fid2) == 16, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_fid2)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_mtime) == 72, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_mtime)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_mtime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_mtime)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_atime) == 80, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_atime)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_atime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_atime)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_ctime) == 88, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_ctime)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_ctime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_ctime)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_size) == 96, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_size)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_size)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_blocks) == 104, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_blocks)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_blocks) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_blocks)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_bias) == 112, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_bias)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_bias) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_bias)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_mode) == 116, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_mode)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_mode)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_flags) == 120, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_flags)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_flags)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_flags_h) == 124, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_flags_h)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_flags_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_flags_h)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_umask) == 128, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_umask)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_umask) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_umask)); + LASSERTF((int)offsetof(struct mdt_rec_reint, rr_padding_4) == 132, "found %lld\n", + (long long)(int)offsetof(struct mdt_rec_reint, rr_padding_4)); + LASSERTF((int)sizeof(((struct mdt_rec_reint *)0)->rr_padding_4) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mdt_rec_reint *)0)->rr_padding_4)); + + /* Checks for struct lmv_desc */ + LASSERTF((int)sizeof(struct lmv_desc) == 88, "found %lld\n", + (long long)(int)sizeof(struct lmv_desc)); + LASSERTF((int)offsetof(struct lmv_desc, ld_tgt_count) == 0, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_tgt_count)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_tgt_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_tgt_count)); + LASSERTF((int)offsetof(struct lmv_desc, ld_active_tgt_count) == 4, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_active_tgt_count)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_active_tgt_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_active_tgt_count)); + LASSERTF((int)offsetof(struct lmv_desc, ld_default_stripe_count) == 8, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_default_stripe_count)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_default_stripe_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_default_stripe_count)); + LASSERTF((int)offsetof(struct lmv_desc, ld_pattern) == 12, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_pattern)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_pattern) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_pattern)); + LASSERTF((int)offsetof(struct lmv_desc, ld_default_hash_size) == 16, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_default_hash_size)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_default_hash_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_default_hash_size)); + LASSERTF((int)offsetof(struct lmv_desc, ld_padding_1) == 24, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_padding_1)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_padding_1) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_padding_1)); + LASSERTF((int)offsetof(struct lmv_desc, ld_padding_2) == 32, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_padding_2)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_padding_2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_padding_2)); + LASSERTF((int)offsetof(struct lmv_desc, ld_qos_maxage) == 36, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_qos_maxage)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_qos_maxage) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_qos_maxage)); + LASSERTF((int)offsetof(struct lmv_desc, ld_padding_3) == 40, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_padding_3)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_padding_3) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_padding_3)); + LASSERTF((int)offsetof(struct lmv_desc, ld_padding_4) == 44, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_padding_4)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_padding_4) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_padding_4)); + LASSERTF((int)offsetof(struct lmv_desc, ld_uuid) == 48, "found %lld\n", + (long long)(int)offsetof(struct lmv_desc, ld_uuid)); + LASSERTF((int)sizeof(((struct lmv_desc *)0)->ld_uuid) == 40, "found %lld\n", + (long long)(int)sizeof(((struct lmv_desc *)0)->ld_uuid)); + + /* Checks for struct lmv_stripe_md */ + LASSERTF((int)sizeof(struct lmv_stripe_md) == 32, "found %lld\n", + (long long)(int)sizeof(struct lmv_stripe_md)); + LASSERTF((int)offsetof(struct lmv_stripe_md, mea_magic) == 0, "found %lld\n", + (long long)(int)offsetof(struct lmv_stripe_md, mea_magic)); + LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_magic) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_magic)); + LASSERTF((int)offsetof(struct lmv_stripe_md, mea_count) == 4, "found %lld\n", + (long long)(int)offsetof(struct lmv_stripe_md, mea_count)); + LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_count)); + LASSERTF((int)offsetof(struct lmv_stripe_md, mea_master) == 8, "found %lld\n", + (long long)(int)offsetof(struct lmv_stripe_md, mea_master)); + LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_master) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_master)); + LASSERTF((int)offsetof(struct lmv_stripe_md, mea_padding) == 12, "found %lld\n", + (long long)(int)offsetof(struct lmv_stripe_md, mea_padding)); + LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_padding)); + CLASSERT(LOV_MAXPOOLNAME == 16); + LASSERTF((int)offsetof(struct lmv_stripe_md, mea_pool_name[16]) == 32, "found %lld\n", + (long long)(int)offsetof(struct lmv_stripe_md, mea_pool_name[16])); + LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_pool_name[16]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_pool_name[16])); + LASSERTF((int)offsetof(struct lmv_stripe_md, mea_ids[0]) == 32, "found %lld\n", + (long long)(int)offsetof(struct lmv_stripe_md, mea_ids[0])); + LASSERTF((int)sizeof(((struct lmv_stripe_md *)0)->mea_ids[0]) == 16, "found %lld\n", + (long long)(int)sizeof(((struct lmv_stripe_md *)0)->mea_ids[0])); + + /* Checks for struct lov_desc */ + LASSERTF((int)sizeof(struct lov_desc) == 88, "found %lld\n", + (long long)(int)sizeof(struct lov_desc)); + LASSERTF((int)offsetof(struct lov_desc, ld_tgt_count) == 0, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_tgt_count)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_tgt_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_tgt_count)); + LASSERTF((int)offsetof(struct lov_desc, ld_active_tgt_count) == 4, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_active_tgt_count)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count)); + LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_count) == 8, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_default_stripe_count)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count)); + LASSERTF((int)offsetof(struct lov_desc, ld_pattern) == 12, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_pattern)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_pattern) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_pattern)); + LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_size) == 16, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_default_stripe_size)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size)); + LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_offset) == 24, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_default_stripe_offset)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset)); + LASSERTF((int)offsetof(struct lov_desc, ld_padding_0) == 32, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_padding_0)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_padding_0) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_padding_0)); + LASSERTF((int)offsetof(struct lov_desc, ld_qos_maxage) == 36, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_qos_maxage)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_qos_maxage) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_qos_maxage)); + LASSERTF((int)offsetof(struct lov_desc, ld_padding_1) == 40, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_padding_1)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_padding_1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_padding_1)); + LASSERTF((int)offsetof(struct lov_desc, ld_padding_2) == 44, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_padding_2)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_padding_2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_padding_2)); + LASSERTF((int)offsetof(struct lov_desc, ld_uuid) == 48, "found %lld\n", + (long long)(int)offsetof(struct lov_desc, ld_uuid)); + LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_uuid) == 40, "found %lld\n", + (long long)(int)sizeof(((struct lov_desc *)0)->ld_uuid)); + CLASSERT(LOV_DESC_MAGIC == 0xB0CCDE5C); + + /* Checks for struct ldlm_res_id */ + LASSERTF((int)sizeof(struct ldlm_res_id) == 32, "found %lld\n", + (long long)(int)sizeof(struct ldlm_res_id)); + CLASSERT(RES_NAME_SIZE == 4); + LASSERTF((int)offsetof(struct ldlm_res_id, name[4]) == 32, "found %lld\n", + (long long)(int)offsetof(struct ldlm_res_id, name[4])); + LASSERTF((int)sizeof(((struct ldlm_res_id *)0)->name[4]) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_res_id *)0)->name[4])); + + /* Checks for struct ldlm_extent */ + LASSERTF((int)sizeof(struct ldlm_extent) == 24, "found %lld\n", + (long long)(int)sizeof(struct ldlm_extent)); + LASSERTF((int)offsetof(struct ldlm_extent, start) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_extent, start)); + LASSERTF((int)sizeof(((struct ldlm_extent *)0)->start) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_extent *)0)->start)); + LASSERTF((int)offsetof(struct ldlm_extent, end) == 8, "found %lld\n", + (long long)(int)offsetof(struct ldlm_extent, end)); + LASSERTF((int)sizeof(((struct ldlm_extent *)0)->end) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_extent *)0)->end)); + LASSERTF((int)offsetof(struct ldlm_extent, gid) == 16, "found %lld\n", + (long long)(int)offsetof(struct ldlm_extent, gid)); + LASSERTF((int)sizeof(((struct ldlm_extent *)0)->gid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_extent *)0)->gid)); + + /* Checks for struct ldlm_inodebits */ + LASSERTF((int)sizeof(struct ldlm_inodebits) == 8, "found %lld\n", + (long long)(int)sizeof(struct ldlm_inodebits)); + LASSERTF((int)offsetof(struct ldlm_inodebits, bits) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_inodebits, bits)); + LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->bits) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_inodebits *)0)->bits)); + + /* Checks for struct ldlm_flock_wire */ + LASSERTF((int)sizeof(struct ldlm_flock_wire) == 32, "found %lld\n", + (long long)(int)sizeof(struct ldlm_flock_wire)); + LASSERTF((int)offsetof(struct ldlm_flock_wire, lfw_start) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_flock_wire, lfw_start)); + LASSERTF((int)sizeof(((struct ldlm_flock_wire *)0)->lfw_start) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_flock_wire *)0)->lfw_start)); + LASSERTF((int)offsetof(struct ldlm_flock_wire, lfw_end) == 8, "found %lld\n", + (long long)(int)offsetof(struct ldlm_flock_wire, lfw_end)); + LASSERTF((int)sizeof(((struct ldlm_flock_wire *)0)->lfw_end) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_flock_wire *)0)->lfw_end)); + LASSERTF((int)offsetof(struct ldlm_flock_wire, lfw_owner) == 16, "found %lld\n", + (long long)(int)offsetof(struct ldlm_flock_wire, lfw_owner)); + LASSERTF((int)sizeof(((struct ldlm_flock_wire *)0)->lfw_owner) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_flock_wire *)0)->lfw_owner)); + LASSERTF((int)offsetof(struct ldlm_flock_wire, lfw_padding) == 24, "found %lld\n", + (long long)(int)offsetof(struct ldlm_flock_wire, lfw_padding)); + LASSERTF((int)sizeof(((struct ldlm_flock_wire *)0)->lfw_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_flock_wire *)0)->lfw_padding)); + LASSERTF((int)offsetof(struct ldlm_flock_wire, lfw_pid) == 28, "found %lld\n", + (long long)(int)offsetof(struct ldlm_flock_wire, lfw_pid)); + LASSERTF((int)sizeof(((struct ldlm_flock_wire *)0)->lfw_pid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_flock_wire *)0)->lfw_pid)); + + /* Checks for struct ldlm_intent */ + LASSERTF((int)sizeof(struct ldlm_intent) == 8, "found %lld\n", + (long long)(int)sizeof(struct ldlm_intent)); + LASSERTF((int)offsetof(struct ldlm_intent, opc) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_intent, opc)); + LASSERTF((int)sizeof(((struct ldlm_intent *)0)->opc) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_intent *)0)->opc)); + + /* Checks for struct ldlm_resource_desc */ + LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, "found %lld\n", + (long long)(int)sizeof(struct ldlm_resource_desc)); + LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_type) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_resource_desc, lr_type)); + LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_type) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_type)); + LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_padding) == 4, "found %lld\n", + (long long)(int)offsetof(struct ldlm_resource_desc, lr_padding)); + LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_padding)); + LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_name) == 8, "found %lld\n", + (long long)(int)offsetof(struct ldlm_resource_desc, lr_name)); + LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_name) == 32, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_name)); + + /* Checks for struct ldlm_lock_desc */ + LASSERTF((int)sizeof(struct ldlm_lock_desc) == 80, "found %lld\n", + (long long)(int)sizeof(struct ldlm_lock_desc)); + LASSERTF((int)offsetof(struct ldlm_lock_desc, l_resource) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_lock_desc, l_resource)); + LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_resource) == 40, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_resource)); + LASSERTF((int)offsetof(struct ldlm_lock_desc, l_req_mode) == 40, "found %lld\n", + (long long)(int)offsetof(struct ldlm_lock_desc, l_req_mode)); + LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode)); + LASSERTF((int)offsetof(struct ldlm_lock_desc, l_granted_mode) == 44, "found %lld\n", + (long long)(int)offsetof(struct ldlm_lock_desc, l_granted_mode)); + LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode)); + LASSERTF((int)offsetof(struct ldlm_lock_desc, l_policy_data) == 48, "found %lld\n", + (long long)(int)offsetof(struct ldlm_lock_desc, l_policy_data)); + LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data) == 32, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data)); + + /* Checks for struct ldlm_request */ + LASSERTF((int)sizeof(struct ldlm_request) == 104, "found %lld\n", + (long long)(int)sizeof(struct ldlm_request)); + LASSERTF((int)offsetof(struct ldlm_request, lock_flags) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_request, lock_flags)); + LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_request *)0)->lock_flags)); + LASSERTF((int)offsetof(struct ldlm_request, lock_count) == 4, "found %lld\n", + (long long)(int)offsetof(struct ldlm_request, lock_count)); + LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_request *)0)->lock_count)); + LASSERTF((int)offsetof(struct ldlm_request, lock_desc) == 8, "found %lld\n", + (long long)(int)offsetof(struct ldlm_request, lock_desc)); + LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_desc) == 80, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_request *)0)->lock_desc)); + LASSERTF((int)offsetof(struct ldlm_request, lock_handle) == 88, "found %lld\n", + (long long)(int)offsetof(struct ldlm_request, lock_handle)); + LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_handle) == 16, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_request *)0)->lock_handle)); + + /* Checks for struct ldlm_reply */ + LASSERTF((int)sizeof(struct ldlm_reply) == 112, "found %lld\n", + (long long)(int)sizeof(struct ldlm_reply)); + LASSERTF((int)offsetof(struct ldlm_reply, lock_flags) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_reply, lock_flags)); + LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_flags)); + LASSERTF((int)offsetof(struct ldlm_reply, lock_padding) == 4, "found %lld\n", + (long long)(int)offsetof(struct ldlm_reply, lock_padding)); + LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_padding)); + LASSERTF((int)offsetof(struct ldlm_reply, lock_desc) == 8, "found %lld\n", + (long long)(int)offsetof(struct ldlm_reply, lock_desc)); + LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_desc) == 80, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_desc)); + LASSERTF((int)offsetof(struct ldlm_reply, lock_handle) == 88, "found %lld\n", + (long long)(int)offsetof(struct ldlm_reply, lock_handle)); + LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_handle) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_handle)); + LASSERTF((int)offsetof(struct ldlm_reply, lock_policy_res1) == 96, "found %lld\n", + (long long)(int)offsetof(struct ldlm_reply, lock_policy_res1)); + LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1)); + LASSERTF((int)offsetof(struct ldlm_reply, lock_policy_res2) == 104, "found %lld\n", + (long long)(int)offsetof(struct ldlm_reply, lock_policy_res2)); + LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2)); + + /* Checks for struct ost_lvb_v1 */ + LASSERTF((int)sizeof(struct ost_lvb_v1) == 40, "found %lld\n", + (long long)(int)sizeof(struct ost_lvb_v1)); + LASSERTF((int)offsetof(struct ost_lvb_v1, lvb_size) == 0, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb_v1, lvb_size)); + LASSERTF((int)sizeof(((struct ost_lvb_v1 *)0)->lvb_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb_v1 *)0)->lvb_size)); + LASSERTF((int)offsetof(struct ost_lvb_v1, lvb_mtime) == 8, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb_v1, lvb_mtime)); + LASSERTF((int)sizeof(((struct ost_lvb_v1 *)0)->lvb_mtime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb_v1 *)0)->lvb_mtime)); + LASSERTF((int)offsetof(struct ost_lvb_v1, lvb_atime) == 16, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb_v1, lvb_atime)); + LASSERTF((int)sizeof(((struct ost_lvb_v1 *)0)->lvb_atime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb_v1 *)0)->lvb_atime)); + LASSERTF((int)offsetof(struct ost_lvb_v1, lvb_ctime) == 24, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb_v1, lvb_ctime)); + LASSERTF((int)sizeof(((struct ost_lvb_v1 *)0)->lvb_ctime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb_v1 *)0)->lvb_ctime)); + LASSERTF((int)offsetof(struct ost_lvb_v1, lvb_blocks) == 32, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb_v1, lvb_blocks)); + LASSERTF((int)sizeof(((struct ost_lvb_v1 *)0)->lvb_blocks) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb_v1 *)0)->lvb_blocks)); + + /* Checks for struct ost_lvb */ + LASSERTF((int)sizeof(struct ost_lvb) == 56, "found %lld\n", + (long long)(int)sizeof(struct ost_lvb)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_size) == 0, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_size)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_size)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_mtime) == 8, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_mtime)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_mtime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_mtime)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_atime) == 16, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_atime)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_atime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_atime)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_ctime) == 24, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_ctime)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_ctime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_ctime)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_blocks) == 32, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_blocks)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_blocks) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_blocks)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_mtime_ns) == 40, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_mtime_ns)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_mtime_ns) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_mtime_ns)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_atime_ns) == 44, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_atime_ns)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_atime_ns) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_atime_ns)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_ctime_ns) == 48, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_ctime_ns)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_ctime_ns) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_ctime_ns)); + LASSERTF((int)offsetof(struct ost_lvb, lvb_padding) == 52, "found %lld\n", + (long long)(int)offsetof(struct ost_lvb, lvb_padding)); + LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_padding)); + + /* Checks for struct lquota_lvb */ + LASSERTF((int)sizeof(struct lquota_lvb) == 40, "found %lld\n", + (long long)(int)sizeof(struct lquota_lvb)); + LASSERTF((int)offsetof(struct lquota_lvb, lvb_flags) == 0, "found %lld\n", + (long long)(int)offsetof(struct lquota_lvb, lvb_flags)); + LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_flags) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_flags)); + LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_may_rel) == 8, "found %lld\n", + (long long)(int)offsetof(struct lquota_lvb, lvb_id_may_rel)); + LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_may_rel) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_may_rel)); + LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_rel) == 16, "found %lld\n", + (long long)(int)offsetof(struct lquota_lvb, lvb_id_rel)); + LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel)); + LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_qunit) == 24, "found %lld\n", + (long long)(int)offsetof(struct lquota_lvb, lvb_id_qunit)); + LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit)); + LASSERTF((int)offsetof(struct lquota_lvb, lvb_pad1) == 32, "found %lld\n", + (long long)(int)offsetof(struct lquota_lvb, lvb_pad1)); + LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_pad1) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_pad1)); + LASSERTF(LQUOTA_FL_EDQUOT == 1, "found %lld\n", + (long long)LQUOTA_FL_EDQUOT); + + /* Checks for struct ldlm_gl_lquota_desc */ + LASSERTF((int)sizeof(struct ldlm_gl_lquota_desc) == 64, "found %lld\n", + (long long)(int)sizeof(struct ldlm_gl_lquota_desc)); + LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_id) == 0, "found %lld\n", + (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_id)); + LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_id) == 16, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_id)); + LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_flags) == 16, "found %lld\n", + (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_flags)); + LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_flags) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_flags)); + LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_ver) == 24, "found %lld\n", + (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_ver)); + LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_ver) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_ver)); + LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_hardlimit) == 32, "found %lld\n", + (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_hardlimit)); + LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_hardlimit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_hardlimit)); + LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_softlimit) == 40, "found %lld\n", + (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_softlimit)); + LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_softlimit) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_softlimit)); + LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_time) == 48, "found %lld\n", + (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_time)); + LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_time)); + LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_pad2) == 56, "found %lld\n", + (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_pad2)); + LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad2)); + + /* Checks for struct mgs_send_param */ + LASSERTF((int)sizeof(struct mgs_send_param) == 1024, "found %lld\n", + (long long)(int)sizeof(struct mgs_send_param)); + CLASSERT(MGS_PARAM_MAXLEN == 1024); + LASSERTF((int)offsetof(struct mgs_send_param, mgs_param[1024]) == 1024, "found %lld\n", + (long long)(int)offsetof(struct mgs_send_param, mgs_param[1024])); + LASSERTF((int)sizeof(((struct mgs_send_param *)0)->mgs_param[1024]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_send_param *)0)->mgs_param[1024])); + + /* Checks for struct cfg_marker */ + LASSERTF((int)sizeof(struct cfg_marker) == 160, "found %lld\n", + (long long)(int)sizeof(struct cfg_marker)); + LASSERTF((int)offsetof(struct cfg_marker, cm_step) == 0, "found %lld\n", + (long long)(int)offsetof(struct cfg_marker, cm_step)); + LASSERTF((int)sizeof(((struct cfg_marker *)0)->cm_step) == 4, "found %lld\n", + (long long)(int)sizeof(((struct cfg_marker *)0)->cm_step)); + LASSERTF((int)offsetof(struct cfg_marker, cm_flags) == 4, "found %lld\n", + (long long)(int)offsetof(struct cfg_marker, cm_flags)); + LASSERTF((int)sizeof(((struct cfg_marker *)0)->cm_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct cfg_marker *)0)->cm_flags)); + LASSERTF((int)offsetof(struct cfg_marker, cm_vers) == 8, "found %lld\n", + (long long)(int)offsetof(struct cfg_marker, cm_vers)); + LASSERTF((int)sizeof(((struct cfg_marker *)0)->cm_vers) == 4, "found %lld\n", + (long long)(int)sizeof(((struct cfg_marker *)0)->cm_vers)); + LASSERTF((int)offsetof(struct cfg_marker, cm_padding) == 12, "found %lld\n", + (long long)(int)offsetof(struct cfg_marker, cm_padding)); + LASSERTF((int)sizeof(((struct cfg_marker *)0)->cm_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct cfg_marker *)0)->cm_padding)); + LASSERTF((int)offsetof(struct cfg_marker, cm_createtime) == 16, "found %lld\n", + (long long)(int)offsetof(struct cfg_marker, cm_createtime)); + LASSERTF((int)sizeof(((struct cfg_marker *)0)->cm_createtime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct cfg_marker *)0)->cm_createtime)); + LASSERTF((int)offsetof(struct cfg_marker, cm_canceltime) == 24, "found %lld\n", + (long long)(int)offsetof(struct cfg_marker, cm_canceltime)); + LASSERTF((int)sizeof(((struct cfg_marker *)0)->cm_canceltime) == 8, "found %lld\n", + (long long)(int)sizeof(((struct cfg_marker *)0)->cm_canceltime)); + LASSERTF((int)offsetof(struct cfg_marker, cm_tgtname) == 32, "found %lld\n", + (long long)(int)offsetof(struct cfg_marker, cm_tgtname)); + LASSERTF((int)sizeof(((struct cfg_marker *)0)->cm_tgtname) == 64, "found %lld\n", + (long long)(int)sizeof(((struct cfg_marker *)0)->cm_tgtname)); + LASSERTF((int)offsetof(struct cfg_marker, cm_comment) == 96, "found %lld\n", + (long long)(int)offsetof(struct cfg_marker, cm_comment)); + LASSERTF((int)sizeof(((struct cfg_marker *)0)->cm_comment) == 64, "found %lld\n", + (long long)(int)sizeof(((struct cfg_marker *)0)->cm_comment)); + + /* Checks for struct llog_logid */ + LASSERTF((int)sizeof(struct llog_logid) == 20, "found %lld\n", + (long long)(int)sizeof(struct llog_logid)); + LASSERTF((int)offsetof(struct llog_logid, lgl_oi) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_logid, lgl_oi)); + LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oi) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oi)); + LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_logid, lgl_ogen)); + LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogen)); + CLASSERT(OST_SZ_REC == 274730752); + CLASSERT(MDS_UNLINK_REC == 274801668); + CLASSERT(MDS_UNLINK64_REC == 275325956); + CLASSERT(MDS_SETATTR64_REC == 275325953); + CLASSERT(OBD_CFG_REC == 274857984); + CLASSERT(LLOG_GEN_REC == 274989056); + CLASSERT(CHANGELOG_REC == 275120128); + CLASSERT(CHANGELOG_USER_REC == 275185664); + CLASSERT(LLOG_HDR_MAGIC == 275010873); + CLASSERT(LLOG_LOGID_MAGIC == 275010875); + + /* Checks for struct llog_catid */ + LASSERTF((int)sizeof(struct llog_catid) == 32, "found %lld\n", + (long long)(int)sizeof(struct llog_catid)); + LASSERTF((int)offsetof(struct llog_catid, lci_logid) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_catid, lci_logid)); + LASSERTF((int)sizeof(((struct llog_catid *)0)->lci_logid) == 20, "found %lld\n", + (long long)(int)sizeof(((struct llog_catid *)0)->lci_logid)); + LASSERTF((int)offsetof(struct llog_catid, lci_padding1) == 20, "found %lld\n", + (long long)(int)offsetof(struct llog_catid, lci_padding1)); + LASSERTF((int)sizeof(((struct llog_catid *)0)->lci_padding1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_catid *)0)->lci_padding1)); + LASSERTF((int)offsetof(struct llog_catid, lci_padding2) == 24, "found %lld\n", + (long long)(int)offsetof(struct llog_catid, lci_padding2)); + LASSERTF((int)sizeof(((struct llog_catid *)0)->lci_padding2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_catid *)0)->lci_padding2)); + LASSERTF((int)offsetof(struct llog_catid, lci_padding3) == 28, "found %lld\n", + (long long)(int)offsetof(struct llog_catid, lci_padding3)); + LASSERTF((int)sizeof(((struct llog_catid *)0)->lci_padding3) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_catid *)0)->lci_padding3)); + + /* Checks for struct llog_rec_hdr */ + LASSERTF((int)sizeof(struct llog_rec_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(struct llog_rec_hdr)); + LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_len) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_rec_hdr, lrh_len)); + LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_len) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_len)); + LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_index) == 4, "found %lld\n", + (long long)(int)offsetof(struct llog_rec_hdr, lrh_index)); + LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_index)); + LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_type) == 8, "found %lld\n", + (long long)(int)offsetof(struct llog_rec_hdr, lrh_type)); + LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_type) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_type)); + LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_id) == 12, "found %lld\n", + (long long)(int)offsetof(struct llog_rec_hdr, lrh_id)); + LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_id)); + + /* Checks for struct llog_rec_tail */ + LASSERTF((int)sizeof(struct llog_rec_tail) == 8, "found %lld\n", + (long long)(int)sizeof(struct llog_rec_tail)); + LASSERTF((int)offsetof(struct llog_rec_tail, lrt_len) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_rec_tail, lrt_len)); + LASSERTF((int)sizeof(((struct llog_rec_tail *)0)->lrt_len) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_rec_tail *)0)->lrt_len)); + LASSERTF((int)offsetof(struct llog_rec_tail, lrt_index) == 4, "found %lld\n", + (long long)(int)offsetof(struct llog_rec_tail, lrt_index)); + LASSERTF((int)sizeof(((struct llog_rec_tail *)0)->lrt_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_rec_tail *)0)->lrt_index)); + + /* Checks for struct llog_logid_rec */ + LASSERTF((int)sizeof(struct llog_logid_rec) == 64, "found %lld\n", + (long long)(int)sizeof(struct llog_logid_rec)); + LASSERTF((int)offsetof(struct llog_logid_rec, lid_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_logid_rec, lid_hdr)); + LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_hdr)); + LASSERTF((int)offsetof(struct llog_logid_rec, lid_id) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_logid_rec, lid_id)); + LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_id) == 20, "found %lld\n", + (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_id)); + LASSERTF((int)offsetof(struct llog_logid_rec, lid_padding1) == 36, "found %lld\n", + (long long)(int)offsetof(struct llog_logid_rec, lid_padding1)); + LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_padding1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_padding1)); + LASSERTF((int)offsetof(struct llog_logid_rec, lid_padding2) == 40, "found %lld\n", + (long long)(int)offsetof(struct llog_logid_rec, lid_padding2)); + LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_padding2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_padding2)); + LASSERTF((int)offsetof(struct llog_logid_rec, lid_padding3) == 48, "found %lld\n", + (long long)(int)offsetof(struct llog_logid_rec, lid_padding3)); + LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_padding3) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_padding3)); + LASSERTF((int)offsetof(struct llog_logid_rec, lid_tail) == 56, "found %lld\n", + (long long)(int)offsetof(struct llog_logid_rec, lid_tail)); + LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_tail)); + + /* Checks for struct llog_unlink_rec */ + LASSERTF((int)sizeof(struct llog_unlink_rec) == 40, "found %lld\n", + (long long)(int)sizeof(struct llog_unlink_rec)); + LASSERTF((int)offsetof(struct llog_unlink_rec, lur_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink_rec, lur_hdr)); + LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr)); + LASSERTF((int)offsetof(struct llog_unlink_rec, lur_oid) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink_rec, lur_oid)); + LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_oid)); + LASSERTF((int)offsetof(struct llog_unlink_rec, lur_oseq) == 24, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink_rec, lur_oseq)); + LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_oseq) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_oseq)); + LASSERTF((int)offsetof(struct llog_unlink_rec, lur_count) == 28, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink_rec, lur_count)); + LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_count)); + LASSERTF((int)offsetof(struct llog_unlink_rec, lur_tail) == 32, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink_rec, lur_tail)); + LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_tail)); + /* Checks for struct llog_unlink64_rec */ + LASSERTF((int)sizeof(struct llog_unlink64_rec) == 64, "found %lld\n", + (long long)(int)sizeof(struct llog_unlink64_rec)); + LASSERTF((int)offsetof(struct llog_unlink64_rec, lur_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink64_rec, lur_hdr)); + LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_hdr)); + LASSERTF((int)offsetof(struct llog_unlink64_rec, lur_fid) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink64_rec, lur_fid)); + LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_fid)); + LASSERTF((int)offsetof(struct llog_unlink64_rec, lur_count) == 32, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink64_rec, lur_count)); + LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_count)); + LASSERTF((int)offsetof(struct llog_unlink64_rec, lur_tail) == 56, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink64_rec, lur_tail)); + LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_tail)); + LASSERTF((int)offsetof(struct llog_unlink64_rec, lur_padding1) == 36, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink64_rec, lur_padding1)); + LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding1)); + LASSERTF((int)offsetof(struct llog_unlink64_rec, lur_padding2) == 40, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink64_rec, lur_padding2)); + LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding2)); + LASSERTF((int)offsetof(struct llog_unlink64_rec, lur_padding3) == 48, "found %lld\n", + (long long)(int)offsetof(struct llog_unlink64_rec, lur_padding3)); + LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding3) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding3)); + + /* Checks for struct llog_setattr64_rec */ + LASSERTF((int)sizeof(struct llog_setattr64_rec) == 64, "found %lld\n", + (long long)(int)sizeof(struct llog_setattr64_rec)); + LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_setattr64_rec, lsr_hdr)); + LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr)); + LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oi) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oi)); + LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oi) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oi)); + LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_uid) == 32, "found %lld\n", + (long long)(int)offsetof(struct llog_setattr64_rec, lsr_uid)); + LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid)); + LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_uid_h) == 36, "found %lld\n", + (long long)(int)offsetof(struct llog_setattr64_rec, lsr_uid_h)); + LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid_h)); + LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_gid) == 40, "found %lld\n", + (long long)(int)offsetof(struct llog_setattr64_rec, lsr_gid)); + LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_gid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_gid)); + LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_gid_h) == 44, "found %lld\n", + (long long)(int)offsetof(struct llog_setattr64_rec, lsr_gid_h)); + LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_gid_h) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_gid_h)); + LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_padding) == 48, "found %lld\n", + (long long)(int)offsetof(struct llog_setattr64_rec, lsr_padding)); + LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_padding) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_padding)); + LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_tail) == 56, "found %lld\n", + (long long)(int)offsetof(struct llog_setattr64_rec, lsr_tail)); + LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_tail)); + + /* Checks for struct llog_size_change_rec */ + LASSERTF((int)sizeof(struct llog_size_change_rec) == 64, "found %lld\n", + (long long)(int)sizeof(struct llog_size_change_rec)); + LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_size_change_rec, lsc_hdr)); + LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr)); + LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_fid) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_size_change_rec, lsc_fid)); + LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid)); + LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_ioepoch) == 32, "found %lld\n", + (long long)(int)offsetof(struct llog_size_change_rec, lsc_ioepoch)); + LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_ioepoch) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_ioepoch)); + LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_padding1) == 36, "found %lld\n", + (long long)(int)offsetof(struct llog_size_change_rec, lsc_padding1)); + LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_padding1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_padding1)); + LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_padding2) == 40, "found %lld\n", + (long long)(int)offsetof(struct llog_size_change_rec, lsc_padding2)); + LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_padding2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_padding2)); + LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_padding3) == 48, "found %lld\n", + (long long)(int)offsetof(struct llog_size_change_rec, lsc_padding3)); + LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_padding3) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_padding3)); + LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_tail) == 56, "found %lld\n", + (long long)(int)offsetof(struct llog_size_change_rec, lsc_tail)); + LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail)); + + /* Checks for struct changelog_rec */ + LASSERTF((int)sizeof(struct changelog_rec) == 64, "found %lld\n", + (long long)(int)sizeof(struct changelog_rec)); + LASSERTF((int)offsetof(struct changelog_rec, cr_namelen) == 0, "found %lld\n", + (long long)(int)offsetof(struct changelog_rec, cr_namelen)); + LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_namelen) == 2, "found %lld\n", + (long long)(int)sizeof(((struct changelog_rec *)0)->cr_namelen)); + LASSERTF((int)offsetof(struct changelog_rec, cr_flags) == 2, "found %lld\n", + (long long)(int)offsetof(struct changelog_rec, cr_flags)); + LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_flags) == 2, "found %lld\n", + (long long)(int)sizeof(((struct changelog_rec *)0)->cr_flags)); + LASSERTF((int)offsetof(struct changelog_rec, cr_type) == 4, "found %lld\n", + (long long)(int)offsetof(struct changelog_rec, cr_type)); + LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_type) == 4, "found %lld\n", + (long long)(int)sizeof(((struct changelog_rec *)0)->cr_type)); + LASSERTF((int)offsetof(struct changelog_rec, cr_index) == 8, "found %lld\n", + (long long)(int)offsetof(struct changelog_rec, cr_index)); + LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_index) == 8, "found %lld\n", + (long long)(int)sizeof(((struct changelog_rec *)0)->cr_index)); + LASSERTF((int)offsetof(struct changelog_rec, cr_prev) == 16, "found %lld\n", + (long long)(int)offsetof(struct changelog_rec, cr_prev)); + LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_prev) == 8, "found %lld\n", + (long long)(int)sizeof(((struct changelog_rec *)0)->cr_prev)); + LASSERTF((int)offsetof(struct changelog_rec, cr_time) == 24, "found %lld\n", + (long long)(int)offsetof(struct changelog_rec, cr_time)); + LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct changelog_rec *)0)->cr_time)); + LASSERTF((int)offsetof(struct changelog_rec, cr_tfid) == 32, "found %lld\n", + (long long)(int)offsetof(struct changelog_rec, cr_tfid)); + LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_tfid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct changelog_rec *)0)->cr_tfid)); + LASSERTF((int)offsetof(struct changelog_rec, cr_pfid) == 48, "found %lld\n", + (long long)(int)offsetof(struct changelog_rec, cr_pfid)); + LASSERTF((int)sizeof(((struct changelog_rec *)0)->cr_pfid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct changelog_rec *)0)->cr_pfid)); + + /* Checks for struct changelog_ext_rec */ + LASSERTF((int)sizeof(struct changelog_ext_rec) == 96, "found %lld\n", + (long long)(int)sizeof(struct changelog_ext_rec)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_namelen) == 0, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_namelen)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_namelen) == 2, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_namelen)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_flags) == 2, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_flags)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_flags) == 2, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_flags)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_type) == 4, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_type)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_type) == 4, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_type)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_index) == 8, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_index)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_index) == 8, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_index)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_prev) == 16, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_prev)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_prev) == 8, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_prev)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_time) == 24, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_time)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_time) == 8, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_time)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_tfid) == 32, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_tfid)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_tfid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_tfid)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_pfid) == 48, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_pfid)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_pfid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_pfid)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_sfid) == 64, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_sfid)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_sfid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_sfid)); + LASSERTF((int)offsetof(struct changelog_ext_rec, cr_spfid) == 80, "found %lld\n", + (long long)(int)offsetof(struct changelog_ext_rec, cr_spfid)); + LASSERTF((int)sizeof(((struct changelog_ext_rec *)0)->cr_spfid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct changelog_ext_rec *)0)->cr_spfid)); + + /* Checks for struct changelog_setinfo */ + LASSERTF((int)sizeof(struct changelog_setinfo) == 12, "found %lld\n", + (long long)(int)sizeof(struct changelog_setinfo)); + LASSERTF((int)offsetof(struct changelog_setinfo, cs_recno) == 0, "found %lld\n", + (long long)(int)offsetof(struct changelog_setinfo, cs_recno)); + LASSERTF((int)sizeof(((struct changelog_setinfo *)0)->cs_recno) == 8, "found %lld\n", + (long long)(int)sizeof(((struct changelog_setinfo *)0)->cs_recno)); + LASSERTF((int)offsetof(struct changelog_setinfo, cs_id) == 8, "found %lld\n", + (long long)(int)offsetof(struct changelog_setinfo, cs_id)); + LASSERTF((int)sizeof(((struct changelog_setinfo *)0)->cs_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct changelog_setinfo *)0)->cs_id)); + + /* Checks for struct llog_changelog_rec */ + LASSERTF((int)sizeof(struct llog_changelog_rec) == 88, "found %lld\n", + (long long)(int)sizeof(struct llog_changelog_rec)); + LASSERTF((int)offsetof(struct llog_changelog_rec, cr_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_changelog_rec, cr_hdr)); + LASSERTF((int)sizeof(((struct llog_changelog_rec *)0)->cr_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_changelog_rec *)0)->cr_hdr)); + LASSERTF((int)offsetof(struct llog_changelog_rec, cr) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_changelog_rec, cr)); + LASSERTF((int)sizeof(((struct llog_changelog_rec *)0)->cr) == 64, "found %lld\n", + (long long)(int)sizeof(((struct llog_changelog_rec *)0)->cr)); + LASSERTF((int)offsetof(struct llog_changelog_rec, cr_tail) == 80, "found %lld\n", + (long long)(int)offsetof(struct llog_changelog_rec, cr_tail)); + LASSERTF((int)sizeof(((struct llog_changelog_rec *)0)->cr_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_changelog_rec *)0)->cr_tail)); + + /* Checks for struct llog_changelog_user_rec */ + LASSERTF((int)sizeof(struct llog_changelog_user_rec) == 40, "found %lld\n", + (long long)(int)sizeof(struct llog_changelog_user_rec)); + LASSERTF((int)offsetof(struct llog_changelog_user_rec, cur_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_changelog_user_rec, cur_hdr)); + LASSERTF((int)sizeof(((struct llog_changelog_user_rec *)0)->cur_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_changelog_user_rec *)0)->cur_hdr)); + LASSERTF((int)offsetof(struct llog_changelog_user_rec, cur_id) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_changelog_user_rec, cur_id)); + LASSERTF((int)sizeof(((struct llog_changelog_user_rec *)0)->cur_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_changelog_user_rec *)0)->cur_id)); + LASSERTF((int)offsetof(struct llog_changelog_user_rec, cur_padding) == 20, "found %lld\n", + (long long)(int)offsetof(struct llog_changelog_user_rec, cur_padding)); + LASSERTF((int)sizeof(((struct llog_changelog_user_rec *)0)->cur_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_changelog_user_rec *)0)->cur_padding)); + LASSERTF((int)offsetof(struct llog_changelog_user_rec, cur_endrec) == 24, "found %lld\n", + (long long)(int)offsetof(struct llog_changelog_user_rec, cur_endrec)); + LASSERTF((int)sizeof(((struct llog_changelog_user_rec *)0)->cur_endrec) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_changelog_user_rec *)0)->cur_endrec)); + LASSERTF((int)offsetof(struct llog_changelog_user_rec, cur_tail) == 32, "found %lld\n", + (long long)(int)offsetof(struct llog_changelog_user_rec, cur_tail)); + LASSERTF((int)sizeof(((struct llog_changelog_user_rec *)0)->cur_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_changelog_user_rec *)0)->cur_tail)); + + /* Checks for struct llog_gen */ + LASSERTF((int)sizeof(struct llog_gen) == 16, "found %lld\n", + (long long)(int)sizeof(struct llog_gen)); + LASSERTF((int)offsetof(struct llog_gen, mnt_cnt) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_gen, mnt_cnt)); + LASSERTF((int)sizeof(((struct llog_gen *)0)->mnt_cnt) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_gen *)0)->mnt_cnt)); + LASSERTF((int)offsetof(struct llog_gen, conn_cnt) == 8, "found %lld\n", + (long long)(int)offsetof(struct llog_gen, conn_cnt)); + LASSERTF((int)sizeof(((struct llog_gen *)0)->conn_cnt) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_gen *)0)->conn_cnt)); + + /* Checks for struct llog_gen_rec */ + LASSERTF((int)sizeof(struct llog_gen_rec) == 64, "found %lld\n", + (long long)(int)sizeof(struct llog_gen_rec)); + LASSERTF((int)offsetof(struct llog_gen_rec, lgr_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_gen_rec, lgr_hdr)); + LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr)); + LASSERTF((int)offsetof(struct llog_gen_rec, lgr_gen) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_gen_rec, lgr_gen)); + LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_gen) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_gen)); + LASSERTF((int)offsetof(struct llog_gen_rec, lgr_tail) == 56, "found %lld\n", + (long long)(int)offsetof(struct llog_gen_rec, lgr_tail)); + LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_tail)); + + /* Checks for struct llog_log_hdr */ + LASSERTF((int)sizeof(struct llog_log_hdr) == 8192, "found %lld\n", + (long long)(int)sizeof(struct llog_log_hdr)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_hdr) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_hdr)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_hdr) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_hdr)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_timestamp) == 16, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_timestamp)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_count) == 24, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_count)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_count)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_bitmap_offset) == 28, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_bitmap_offset)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_size) == 32, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_size)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_size) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_size)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_flags) == 36, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_flags)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_flags)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_cat_idx) == 40, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_cat_idx)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_tgtuuid) == 44, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_tgtuuid)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_reserved) == 84, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_reserved)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_reserved) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_reserved)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_bitmap) == 88, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_bitmap)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 8096, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap)); + LASSERTF((int)offsetof(struct llog_log_hdr, llh_tail) == 8184, "found %lld\n", + (long long)(int)offsetof(struct llog_log_hdr, llh_tail)); + LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tail)); + + /* Checks for struct llog_cookie */ + LASSERTF((int)sizeof(struct llog_cookie) == 32, "found %lld\n", + (long long)(int)sizeof(struct llog_cookie)); + LASSERTF((int)offsetof(struct llog_cookie, lgc_lgl) == 0, "found %lld\n", + (long long)(int)offsetof(struct llog_cookie, lgc_lgl)); + LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_lgl) == 20, "found %lld\n", + (long long)(int)sizeof(((struct llog_cookie *)0)->lgc_lgl)); + LASSERTF((int)offsetof(struct llog_cookie, lgc_subsys) == 20, "found %lld\n", + (long long)(int)offsetof(struct llog_cookie, lgc_subsys)); + LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_subsys) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_cookie *)0)->lgc_subsys)); + LASSERTF((int)offsetof(struct llog_cookie, lgc_index) == 24, "found %lld\n", + (long long)(int)offsetof(struct llog_cookie, lgc_index)); + LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_cookie *)0)->lgc_index)); + LASSERTF((int)offsetof(struct llog_cookie, lgc_padding) == 28, "found %lld\n", + (long long)(int)offsetof(struct llog_cookie, lgc_padding)); + LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llog_cookie *)0)->lgc_padding)); + + /* Checks for struct llogd_body */ + LASSERTF((int)sizeof(struct llogd_body) == 48, "found %lld\n", + (long long)(int)sizeof(struct llogd_body)); + LASSERTF((int)offsetof(struct llogd_body, lgd_logid) == 0, "found %lld\n", + (long long)(int)offsetof(struct llogd_body, lgd_logid)); + LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_logid) == 20, "found %lld\n", + (long long)(int)sizeof(((struct llogd_body *)0)->lgd_logid)); + LASSERTF((int)offsetof(struct llogd_body, lgd_ctxt_idx) == 20, "found %lld\n", + (long long)(int)offsetof(struct llogd_body, lgd_ctxt_idx)); + LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx)); + LASSERTF((int)offsetof(struct llogd_body, lgd_llh_flags) == 24, "found %lld\n", + (long long)(int)offsetof(struct llogd_body, lgd_llh_flags)); + LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_llh_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llogd_body *)0)->lgd_llh_flags)); + LASSERTF((int)offsetof(struct llogd_body, lgd_index) == 28, "found %lld\n", + (long long)(int)offsetof(struct llogd_body, lgd_index)); + LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llogd_body *)0)->lgd_index)); + LASSERTF((int)offsetof(struct llogd_body, lgd_saved_index) == 32, "found %lld\n", + (long long)(int)offsetof(struct llogd_body, lgd_saved_index)); + LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_saved_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llogd_body *)0)->lgd_saved_index)); + LASSERTF((int)offsetof(struct llogd_body, lgd_len) == 36, "found %lld\n", + (long long)(int)offsetof(struct llogd_body, lgd_len)); + LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_len) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llogd_body *)0)->lgd_len)); + LASSERTF((int)offsetof(struct llogd_body, lgd_cur_offset) == 40, "found %lld\n", + (long long)(int)offsetof(struct llogd_body, lgd_cur_offset)); + LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_cur_offset) == 8, "found %lld\n", + (long long)(int)sizeof(((struct llogd_body *)0)->lgd_cur_offset)); + CLASSERT(LLOG_ORIGIN_HANDLE_CREATE == 501); + CLASSERT(LLOG_ORIGIN_HANDLE_NEXT_BLOCK == 502); + CLASSERT(LLOG_ORIGIN_HANDLE_READ_HEADER == 503); + CLASSERT(LLOG_ORIGIN_HANDLE_WRITE_REC == 504); + CLASSERT(LLOG_ORIGIN_HANDLE_CLOSE == 505); + CLASSERT(LLOG_ORIGIN_CONNECT == 506); + CLASSERT(LLOG_CATINFO == 507); + CLASSERT(LLOG_ORIGIN_HANDLE_PREV_BLOCK == 508); + CLASSERT(LLOG_ORIGIN_HANDLE_DESTROY == 509); + CLASSERT(LLOG_FIRST_OPC == 501); + CLASSERT(LLOG_LAST_OPC == 510); + + /* Checks for struct llogd_conn_body */ + LASSERTF((int)sizeof(struct llogd_conn_body) == 40, "found %lld\n", + (long long)(int)sizeof(struct llogd_conn_body)); + LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_gen) == 0, "found %lld\n", + (long long)(int)offsetof(struct llogd_conn_body, lgdc_gen)); + LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen) == 16, "found %lld\n", + (long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen)); + LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_logid) == 16, "found %lld\n", + (long long)(int)offsetof(struct llogd_conn_body, lgdc_logid)); + LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid) == 20, "found %lld\n", + (long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid)); + LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_ctxt_idx) == 36, "found %lld\n", + (long long)(int)offsetof(struct llogd_conn_body, lgdc_ctxt_idx)); + LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx) == 4, "found %lld\n", + (long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx)); + + /* Checks for struct ll_fiemap_info_key */ + LASSERTF((int)sizeof(struct ll_fiemap_info_key) == 248, "found %lld\n", + (long long)(int)sizeof(struct ll_fiemap_info_key)); + LASSERTF((int)offsetof(struct ll_fiemap_info_key, name[8]) == 8, "found %lld\n", + (long long)(int)offsetof(struct ll_fiemap_info_key, name[8])); + LASSERTF((int)sizeof(((struct ll_fiemap_info_key *)0)->name[8]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct ll_fiemap_info_key *)0)->name[8])); + LASSERTF((int)offsetof(struct ll_fiemap_info_key, oa) == 8, "found %lld\n", + (long long)(int)offsetof(struct ll_fiemap_info_key, oa)); + LASSERTF((int)sizeof(((struct ll_fiemap_info_key *)0)->oa) == 208, "found %lld\n", + (long long)(int)sizeof(((struct ll_fiemap_info_key *)0)->oa)); + LASSERTF((int)offsetof(struct ll_fiemap_info_key, fiemap) == 216, "found %lld\n", + (long long)(int)offsetof(struct ll_fiemap_info_key, fiemap)); + LASSERTF((int)sizeof(((struct ll_fiemap_info_key *)0)->fiemap) == 32, "found %lld\n", + (long long)(int)sizeof(((struct ll_fiemap_info_key *)0)->fiemap)); + + /* Checks for struct quota_body */ + LASSERTF((int)sizeof(struct quota_body) == 112, "found %lld\n", + (long long)(int)sizeof(struct quota_body)); + LASSERTF((int)offsetof(struct quota_body, qb_fid) == 0, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_fid)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_fid)); + LASSERTF((int)offsetof(struct quota_body, qb_id) == 16, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_id)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_id) == 16, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_id)); + LASSERTF((int)offsetof(struct quota_body, qb_flags) == 32, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_flags)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_flags)); + LASSERTF((int)offsetof(struct quota_body, qb_padding) == 36, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_padding)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_padding)); + LASSERTF((int)offsetof(struct quota_body, qb_count) == 40, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_count)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_count) == 8, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_count)); + LASSERTF((int)offsetof(struct quota_body, qb_usage) == 48, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_usage)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_usage) == 8, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_usage)); + LASSERTF((int)offsetof(struct quota_body, qb_slv_ver) == 56, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_slv_ver)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_slv_ver) == 8, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_slv_ver)); + LASSERTF((int)offsetof(struct quota_body, qb_lockh) == 64, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_lockh)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_lockh) == 8, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_lockh)); + LASSERTF((int)offsetof(struct quota_body, qb_glb_lockh) == 72, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_glb_lockh)); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_glb_lockh) == 8, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_glb_lockh)); + LASSERTF((int)offsetof(struct quota_body, qb_padding1[4]) == 112, "found %lld\n", + (long long)(int)offsetof(struct quota_body, qb_padding1[4])); + LASSERTF((int)sizeof(((struct quota_body *)0)->qb_padding1[4]) == 8, "found %lld\n", + (long long)(int)sizeof(((struct quota_body *)0)->qb_padding1[4])); + + /* Checks for struct mgs_target_info */ + LASSERTF((int)sizeof(struct mgs_target_info) == 4544, "found %lld\n", + (long long)(int)sizeof(struct mgs_target_info)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_lustre_ver) == 0, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_lustre_ver)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_lustre_ver) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_lustre_ver)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_stripe_index) == 4, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_stripe_index)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_stripe_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_stripe_index)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_config_ver) == 8, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_config_ver)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_config_ver) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_config_ver)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_flags) == 12, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_flags)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_flags)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_nid_count) == 16, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_nid_count)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_nid_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_nid_count)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_instance) == 20, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_instance)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_instance) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_instance)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_fsname) == 24, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_fsname)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_fsname) == 64, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_fsname)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_svname) == 88, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_svname)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_svname) == 64, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_svname)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_uuid) == 152, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_uuid)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_uuid) == 40, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_uuid)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_nids) == 192, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_nids)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_nids) == 256, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_nids)); + LASSERTF((int)offsetof(struct mgs_target_info, mti_params) == 448, "found %lld\n", + (long long)(int)offsetof(struct mgs_target_info, mti_params)); + LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_params) == 4096, "found %lld\n", + (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_params)); + + /* Checks for struct lustre_capa */ + LASSERTF((int)sizeof(struct lustre_capa) == 120, "found %lld\n", + (long long)(int)sizeof(struct lustre_capa)); + LASSERTF((int)offsetof(struct lustre_capa, lc_fid) == 0, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_fid)); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_fid)); + LASSERTF((int)offsetof(struct lustre_capa, lc_opc) == 16, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_opc)); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_opc) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_opc)); + LASSERTF((int)offsetof(struct lustre_capa, lc_uid) == 24, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_uid)); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_uid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_uid)); + LASSERTF((int)offsetof(struct lustre_capa, lc_gid) == 32, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_gid)); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_gid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_gid)); + LASSERTF((int)offsetof(struct lustre_capa, lc_flags) == 40, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_flags)); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_flags)); + LASSERTF((int)offsetof(struct lustre_capa, lc_keyid) == 44, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_keyid)); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_keyid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_keyid)); + LASSERTF((int)offsetof(struct lustre_capa, lc_timeout) == 48, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_timeout)); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_timeout) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_timeout)); + LASSERTF((int)offsetof(struct lustre_capa, lc_expiry) == 52, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_expiry)); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_expiry) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_expiry)); + CLASSERT(CAPA_HMAC_MAX_LEN == 64); + LASSERTF((int)offsetof(struct lustre_capa, lc_hmac[64]) == 120, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa, lc_hmac[64])); + LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_hmac[64]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa *)0)->lc_hmac[64])); + + /* Checks for struct lustre_capa_key */ + LASSERTF((int)sizeof(struct lustre_capa_key) == 72, "found %lld\n", + (long long)(int)sizeof(struct lustre_capa_key)); + LASSERTF((int)offsetof(struct lustre_capa_key, lk_seq) == 0, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa_key, lk_seq)); + LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_seq) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_seq)); + LASSERTF((int)offsetof(struct lustre_capa_key, lk_keyid) == 8, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa_key, lk_keyid)); + LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_keyid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_keyid)); + LASSERTF((int)offsetof(struct lustre_capa_key, lk_padding) == 12, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa_key, lk_padding)); + LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_padding)); + CLASSERT(CAPA_HMAC_KEY_MAX_LEN == 56); + LASSERTF((int)offsetof(struct lustre_capa_key, lk_key[56]) == 72, "found %lld\n", + (long long)(int)offsetof(struct lustre_capa_key, lk_key[56])); + LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_key[56]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_key[56])); + + /* Checks for struct getinfo_fid2path */ + LASSERTF((int)sizeof(struct getinfo_fid2path) == 32, "found %lld\n", + (long long)(int)sizeof(struct getinfo_fid2path)); + LASSERTF((int)offsetof(struct getinfo_fid2path, gf_fid) == 0, "found %lld\n", + (long long)(int)offsetof(struct getinfo_fid2path, gf_fid)); + LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_fid)); + LASSERTF((int)offsetof(struct getinfo_fid2path, gf_recno) == 16, "found %lld\n", + (long long)(int)offsetof(struct getinfo_fid2path, gf_recno)); + LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_recno) == 8, "found %lld\n", + (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_recno)); + LASSERTF((int)offsetof(struct getinfo_fid2path, gf_linkno) == 24, "found %lld\n", + (long long)(int)offsetof(struct getinfo_fid2path, gf_linkno)); + LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_linkno) == 4, "found %lld\n", + (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_linkno)); + LASSERTF((int)offsetof(struct getinfo_fid2path, gf_pathlen) == 28, "found %lld\n", + (long long)(int)offsetof(struct getinfo_fid2path, gf_pathlen)); + LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_pathlen) == 4, "found %lld\n", + (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_pathlen)); + LASSERTF((int)offsetof(struct getinfo_fid2path, gf_path[0]) == 32, "found %lld\n", + (long long)(int)offsetof(struct getinfo_fid2path, gf_path[0])); + LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_path[0]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_path[0])); + + /* Checks for struct ll_user_fiemap */ + LASSERTF((int)sizeof(struct ll_user_fiemap) == 32, "found %lld\n", + (long long)(int)sizeof(struct ll_user_fiemap)); + LASSERTF((int)offsetof(struct ll_user_fiemap, fm_start) == 0, "found %lld\n", + (long long)(int)offsetof(struct ll_user_fiemap, fm_start)); + LASSERTF((int)sizeof(((struct ll_user_fiemap *)0)->fm_start) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ll_user_fiemap *)0)->fm_start)); + LASSERTF((int)offsetof(struct ll_user_fiemap, fm_length) == 8, "found %lld\n", + (long long)(int)offsetof(struct ll_user_fiemap, fm_length)); + LASSERTF((int)sizeof(((struct ll_user_fiemap *)0)->fm_length) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ll_user_fiemap *)0)->fm_length)); + LASSERTF((int)offsetof(struct ll_user_fiemap, fm_flags) == 16, "found %lld\n", + (long long)(int)offsetof(struct ll_user_fiemap, fm_flags)); + LASSERTF((int)sizeof(((struct ll_user_fiemap *)0)->fm_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ll_user_fiemap *)0)->fm_flags)); + LASSERTF((int)offsetof(struct ll_user_fiemap, fm_mapped_extents) == 20, "found %lld\n", + (long long)(int)offsetof(struct ll_user_fiemap, fm_mapped_extents)); + LASSERTF((int)sizeof(((struct ll_user_fiemap *)0)->fm_mapped_extents) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ll_user_fiemap *)0)->fm_mapped_extents)); + LASSERTF((int)offsetof(struct ll_user_fiemap, fm_extent_count) == 24, "found %lld\n", + (long long)(int)offsetof(struct ll_user_fiemap, fm_extent_count)); + LASSERTF((int)sizeof(((struct ll_user_fiemap *)0)->fm_extent_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ll_user_fiemap *)0)->fm_extent_count)); + LASSERTF((int)offsetof(struct ll_user_fiemap, fm_reserved) == 28, "found %lld\n", + (long long)(int)offsetof(struct ll_user_fiemap, fm_reserved)); + LASSERTF((int)sizeof(((struct ll_user_fiemap *)0)->fm_reserved) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ll_user_fiemap *)0)->fm_reserved)); + LASSERTF((int)offsetof(struct ll_user_fiemap, fm_extents) == 32, "found %lld\n", + (long long)(int)offsetof(struct ll_user_fiemap, fm_extents)); + LASSERTF((int)sizeof(((struct ll_user_fiemap *)0)->fm_extents) == 0, "found %lld\n", + (long long)(int)sizeof(((struct ll_user_fiemap *)0)->fm_extents)); + CLASSERT(FIEMAP_FLAG_SYNC == 0x00000001); + CLASSERT(FIEMAP_FLAG_XATTR == 0x00000002); + CLASSERT(FIEMAP_FLAG_DEVICE_ORDER == 0x40000000); + + /* Checks for struct ll_fiemap_extent */ + LASSERTF((int)sizeof(struct ll_fiemap_extent) == 56, "found %lld\n", + (long long)(int)sizeof(struct ll_fiemap_extent)); + LASSERTF((int)offsetof(struct ll_fiemap_extent, fe_logical) == 0, "found %lld\n", + (long long)(int)offsetof(struct ll_fiemap_extent, fe_logical)); + LASSERTF((int)sizeof(((struct ll_fiemap_extent *)0)->fe_logical) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ll_fiemap_extent *)0)->fe_logical)); + LASSERTF((int)offsetof(struct ll_fiemap_extent, fe_physical) == 8, "found %lld\n", + (long long)(int)offsetof(struct ll_fiemap_extent, fe_physical)); + LASSERTF((int)sizeof(((struct ll_fiemap_extent *)0)->fe_physical) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ll_fiemap_extent *)0)->fe_physical)); + LASSERTF((int)offsetof(struct ll_fiemap_extent, fe_length) == 16, "found %lld\n", + (long long)(int)offsetof(struct ll_fiemap_extent, fe_length)); + LASSERTF((int)sizeof(((struct ll_fiemap_extent *)0)->fe_length) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ll_fiemap_extent *)0)->fe_length)); + LASSERTF((int)offsetof(struct ll_fiemap_extent, fe_flags) == 40, "found %lld\n", + (long long)(int)offsetof(struct ll_fiemap_extent, fe_flags)); + LASSERTF((int)sizeof(((struct ll_fiemap_extent *)0)->fe_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ll_fiemap_extent *)0)->fe_flags)); + LASSERTF((int)offsetof(struct ll_fiemap_extent, fe_device) == 44, "found %lld\n", + (long long)(int)offsetof(struct ll_fiemap_extent, fe_device)); + LASSERTF((int)sizeof(((struct ll_fiemap_extent *)0)->fe_device) == 4, "found %lld\n", + (long long)(int)sizeof(((struct ll_fiemap_extent *)0)->fe_device)); + CLASSERT(FIEMAP_EXTENT_LAST == 0x00000001); + CLASSERT(FIEMAP_EXTENT_UNKNOWN == 0x00000002); + CLASSERT(FIEMAP_EXTENT_DELALLOC == 0x00000004); + CLASSERT(FIEMAP_EXTENT_ENCODED == 0x00000008); + CLASSERT(FIEMAP_EXTENT_DATA_ENCRYPTED == 0x00000080); + CLASSERT(FIEMAP_EXTENT_NOT_ALIGNED == 0x00000100); + CLASSERT(FIEMAP_EXTENT_DATA_INLINE == 0x00000200); + CLASSERT(FIEMAP_EXTENT_DATA_TAIL == 0x00000400); + CLASSERT(FIEMAP_EXTENT_UNWRITTEN == 0x00000800); + CLASSERT(FIEMAP_EXTENT_MERGED == 0x00001000); + CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000); + CLASSERT(FIEMAP_EXTENT_NET == 0x80000000); + + /* Checks for type posix_acl_xattr_entry */ + LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n", + (long long)(int)sizeof(posix_acl_xattr_entry)); + LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, "found %lld\n", + (long long)(int)offsetof(posix_acl_xattr_entry, e_tag)); + LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2, "found %lld\n", + (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag)); + LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, "found %lld\n", + (long long)(int)offsetof(posix_acl_xattr_entry, e_perm)); + LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2, "found %lld\n", + (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm)); + LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, "found %lld\n", + (long long)(int)offsetof(posix_acl_xattr_entry, e_id)); + LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4, "found %lld\n", + (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id)); + + /* Checks for type posix_acl_xattr_header */ + LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, "found %lld\n", + (long long)(int)sizeof(posix_acl_xattr_header)); + LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, "found %lld\n", + (long long)(int)offsetof(posix_acl_xattr_header, a_version)); + LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4, "found %lld\n", + (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version)); + LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, "found %lld\n", + (long long)(int)offsetof(posix_acl_xattr_header, a_entries)); + LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, "found %lld\n", + (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries)); + + /* Checks for struct link_ea_header */ + LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n", + (long long)(int)sizeof(struct link_ea_header)); + LASSERTF((int)offsetof(struct link_ea_header, leh_magic) == 0, "found %lld\n", + (long long)(int)offsetof(struct link_ea_header, leh_magic)); + LASSERTF((int)sizeof(((struct link_ea_header *)0)->leh_magic) == 4, "found %lld\n", + (long long)(int)sizeof(((struct link_ea_header *)0)->leh_magic)); + LASSERTF((int)offsetof(struct link_ea_header, leh_reccount) == 4, "found %lld\n", + (long long)(int)offsetof(struct link_ea_header, leh_reccount)); + LASSERTF((int)sizeof(((struct link_ea_header *)0)->leh_reccount) == 4, "found %lld\n", + (long long)(int)sizeof(((struct link_ea_header *)0)->leh_reccount)); + LASSERTF((int)offsetof(struct link_ea_header, leh_len) == 8, "found %lld\n", + (long long)(int)offsetof(struct link_ea_header, leh_len)); + LASSERTF((int)sizeof(((struct link_ea_header *)0)->leh_len) == 8, "found %lld\n", + (long long)(int)sizeof(((struct link_ea_header *)0)->leh_len)); + LASSERTF((int)offsetof(struct link_ea_header, padding1) == 16, "found %lld\n", + (long long)(int)offsetof(struct link_ea_header, padding1)); + LASSERTF((int)sizeof(((struct link_ea_header *)0)->padding1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct link_ea_header *)0)->padding1)); + LASSERTF((int)offsetof(struct link_ea_header, padding2) == 20, "found %lld\n", + (long long)(int)offsetof(struct link_ea_header, padding2)); + LASSERTF((int)sizeof(((struct link_ea_header *)0)->padding2) == 4, "found %lld\n", + (long long)(int)sizeof(((struct link_ea_header *)0)->padding2)); + CLASSERT(LINK_EA_MAGIC == 0x11EAF1DFUL); + + /* Checks for struct link_ea_entry */ + LASSERTF((int)sizeof(struct link_ea_entry) == 18, "found %lld\n", + (long long)(int)sizeof(struct link_ea_entry)); + LASSERTF((int)offsetof(struct link_ea_entry, lee_reclen) == 0, "found %lld\n", + (long long)(int)offsetof(struct link_ea_entry, lee_reclen)); + LASSERTF((int)sizeof(((struct link_ea_entry *)0)->lee_reclen) == 2, "found %lld\n", + (long long)(int)sizeof(((struct link_ea_entry *)0)->lee_reclen)); + LASSERTF((int)offsetof(struct link_ea_entry, lee_parent_fid) == 2, "found %lld\n", + (long long)(int)offsetof(struct link_ea_entry, lee_parent_fid)); + LASSERTF((int)sizeof(((struct link_ea_entry *)0)->lee_parent_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct link_ea_entry *)0)->lee_parent_fid)); + LASSERTF((int)offsetof(struct link_ea_entry, lee_name) == 18, "found %lld\n", + (long long)(int)offsetof(struct link_ea_entry, lee_name)); + LASSERTF((int)sizeof(((struct link_ea_entry *)0)->lee_name) == 0, "found %lld\n", + (long long)(int)sizeof(((struct link_ea_entry *)0)->lee_name)); + + /* Checks for struct layout_intent */ + LASSERTF((int)sizeof(struct layout_intent) == 24, "found %lld\n", + (long long)(int)sizeof(struct layout_intent)); + LASSERTF((int)offsetof(struct layout_intent, li_opc) == 0, "found %lld\n", + (long long)(int)offsetof(struct layout_intent, li_opc)); + LASSERTF((int)sizeof(((struct layout_intent *)0)->li_opc) == 4, "found %lld\n", + (long long)(int)sizeof(((struct layout_intent *)0)->li_opc)); + LASSERTF((int)offsetof(struct layout_intent, li_flags) == 4, "found %lld\n", + (long long)(int)offsetof(struct layout_intent, li_flags)); + LASSERTF((int)sizeof(((struct layout_intent *)0)->li_flags) == 4, "found %lld\n", + (long long)(int)sizeof(((struct layout_intent *)0)->li_flags)); + LASSERTF((int)offsetof(struct layout_intent, li_start) == 8, "found %lld\n", + (long long)(int)offsetof(struct layout_intent, li_start)); + LASSERTF((int)sizeof(((struct layout_intent *)0)->li_start) == 8, "found %lld\n", + (long long)(int)sizeof(((struct layout_intent *)0)->li_start)); + LASSERTF((int)offsetof(struct layout_intent, li_end) == 16, "found %lld\n", + (long long)(int)offsetof(struct layout_intent, li_end)); + LASSERTF((int)sizeof(((struct layout_intent *)0)->li_end) == 8, "found %lld\n", + (long long)(int)sizeof(((struct layout_intent *)0)->li_end)); + LASSERTF(LAYOUT_INTENT_ACCESS == 0, "found %lld\n", + (long long)LAYOUT_INTENT_ACCESS); + LASSERTF(LAYOUT_INTENT_READ == 1, "found %lld\n", + (long long)LAYOUT_INTENT_READ); + LASSERTF(LAYOUT_INTENT_WRITE == 2, "found %lld\n", + (long long)LAYOUT_INTENT_WRITE); + LASSERTF(LAYOUT_INTENT_GLIMPSE == 3, "found %lld\n", + (long long)LAYOUT_INTENT_GLIMPSE); + LASSERTF(LAYOUT_INTENT_TRUNC == 4, "found %lld\n", + (long long)LAYOUT_INTENT_TRUNC); + LASSERTF(LAYOUT_INTENT_RELEASE == 5, "found %lld\n", + (long long)LAYOUT_INTENT_RELEASE); + LASSERTF(LAYOUT_INTENT_RESTORE == 6, "found %lld\n", + (long long)LAYOUT_INTENT_RESTORE); + + /* Checks for struct hsm_action_item */ + LASSERTF((int)sizeof(struct hsm_action_item) == 72, "found %lld\n", + (long long)(int)sizeof(struct hsm_action_item)); + LASSERTF((int)offsetof(struct hsm_action_item, hai_len) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_item, hai_len)); + LASSERTF((int)sizeof(((struct hsm_action_item *)0)->hai_len) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_item *)0)->hai_len)); + LASSERTF((int)offsetof(struct hsm_action_item, hai_action) == 4, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_item, hai_action)); + LASSERTF((int)sizeof(((struct hsm_action_item *)0)->hai_action) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_item *)0)->hai_action)); + LASSERTF((int)offsetof(struct hsm_action_item, hai_fid) == 8, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_item, hai_fid)); + LASSERTF((int)sizeof(((struct hsm_action_item *)0)->hai_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_item *)0)->hai_fid)); + LASSERTF((int)offsetof(struct hsm_action_item, hai_dfid) == 24, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_item, hai_dfid)); + LASSERTF((int)sizeof(((struct hsm_action_item *)0)->hai_dfid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_item *)0)->hai_dfid)); + LASSERTF((int)offsetof(struct hsm_action_item, hai_extent) == 40, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_item, hai_extent)); + LASSERTF((int)sizeof(((struct hsm_action_item *)0)->hai_extent) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_item *)0)->hai_extent)); + LASSERTF((int)offsetof(struct hsm_action_item, hai_cookie) == 56, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_item, hai_cookie)); + LASSERTF((int)sizeof(((struct hsm_action_item *)0)->hai_cookie) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_item *)0)->hai_cookie)); + LASSERTF((int)offsetof(struct hsm_action_item, hai_gid) == 64, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_item, hai_gid)); + LASSERTF((int)sizeof(((struct hsm_action_item *)0)->hai_gid) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_item *)0)->hai_gid)); + LASSERTF((int)offsetof(struct hsm_action_item, hai_data) == 72, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_item, hai_data)); + LASSERTF((int)sizeof(((struct hsm_action_item *)0)->hai_data) == 0, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_item *)0)->hai_data)); + + /* Checks for struct hsm_action_list */ + LASSERTF((int)sizeof(struct hsm_action_list) == 32, "found %lld\n", + (long long)(int)sizeof(struct hsm_action_list)); + LASSERTF((int)offsetof(struct hsm_action_list, hal_version) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_list, hal_version)); + LASSERTF((int)sizeof(((struct hsm_action_list *)0)->hal_version) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_list *)0)->hal_version)); + LASSERTF((int)offsetof(struct hsm_action_list, hal_count) == 4, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_list, hal_count)); + LASSERTF((int)sizeof(((struct hsm_action_list *)0)->hal_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_list *)0)->hal_count)); + LASSERTF((int)offsetof(struct hsm_action_list, hal_compound_id) == 8, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_list, hal_compound_id)); + LASSERTF((int)sizeof(((struct hsm_action_list *)0)->hal_compound_id) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_list *)0)->hal_compound_id)); + LASSERTF((int)offsetof(struct hsm_action_list, hal_flags) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_list, hal_flags)); + LASSERTF((int)sizeof(((struct hsm_action_list *)0)->hal_flags) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_list *)0)->hal_flags)); + LASSERTF((int)offsetof(struct hsm_action_list, hal_archive_id) == 24, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_list, hal_archive_id)); + LASSERTF((int)sizeof(((struct hsm_action_list *)0)->hal_archive_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_list *)0)->hal_archive_id)); + LASSERTF((int)offsetof(struct hsm_action_list, padding1) == 28, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_list, padding1)); + LASSERTF((int)sizeof(((struct hsm_action_list *)0)->padding1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_list *)0)->padding1)); + LASSERTF((int)offsetof(struct hsm_action_list, hal_fsname) == 32, "found %lld\n", + (long long)(int)offsetof(struct hsm_action_list, hal_fsname)); + LASSERTF((int)sizeof(((struct hsm_action_list *)0)->hal_fsname) == 0, "found %lld\n", + (long long)(int)sizeof(((struct hsm_action_list *)0)->hal_fsname)); + + /* Checks for struct hsm_progress */ + LASSERTF((int)sizeof(struct hsm_progress) == 48, "found %lld\n", + (long long)(int)sizeof(struct hsm_progress)); + LASSERTF((int)offsetof(struct hsm_progress, hp_fid) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress, hp_fid)); + LASSERTF((int)sizeof(((struct hsm_progress *)0)->hp_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress *)0)->hp_fid)); + LASSERTF((int)offsetof(struct hsm_progress, hp_cookie) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress, hp_cookie)); + LASSERTF((int)sizeof(((struct hsm_progress *)0)->hp_cookie) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress *)0)->hp_cookie)); + LASSERTF((int)offsetof(struct hsm_progress, hp_extent) == 24, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress, hp_extent)); + LASSERTF((int)sizeof(((struct hsm_progress *)0)->hp_extent) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress *)0)->hp_extent)); + LASSERTF((int)offsetof(struct hsm_progress, hp_flags) == 40, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress, hp_flags)); + LASSERTF((int)sizeof(((struct hsm_progress *)0)->hp_flags) == 2, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress *)0)->hp_flags)); + LASSERTF((int)offsetof(struct hsm_progress, hp_errval) == 42, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress, hp_errval)); + LASSERTF((int)sizeof(((struct hsm_progress *)0)->hp_errval) == 2, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress *)0)->hp_errval)); + LASSERTF((int)offsetof(struct hsm_progress, padding) == 44, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress, padding)); + LASSERTF((int)sizeof(((struct hsm_progress *)0)->padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress *)0)->padding)); + LASSERTF(HP_FLAG_COMPLETED == 0x01, "found 0x%.8x\n", + HP_FLAG_COMPLETED); + LASSERTF(HP_FLAG_RETRY == 0x02, "found 0x%.8x\n", + HP_FLAG_RETRY); + + LASSERTF((int)offsetof(struct hsm_copy, hc_data_version) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_copy, hc_data_version)); + LASSERTF((int)sizeof(((struct hsm_copy *)0)->hc_data_version) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_copy *)0)->hc_data_version)); + LASSERTF((int)offsetof(struct hsm_copy, hc_flags) == 8, "found %lld\n", + (long long)(int)offsetof(struct hsm_copy, hc_flags)); + LASSERTF((int)sizeof(((struct hsm_copy *)0)->hc_flags) == 2, "found %lld\n", + (long long)(int)sizeof(((struct hsm_copy *)0)->hc_flags)); + LASSERTF((int)offsetof(struct hsm_copy, hc_errval) == 10, "found %lld\n", + (long long)(int)offsetof(struct hsm_copy, hc_errval)); + LASSERTF((int)sizeof(((struct hsm_copy *)0)->hc_errval) == 2, "found %lld\n", + (long long)(int)sizeof(((struct hsm_copy *)0)->hc_errval)); + LASSERTF((int)offsetof(struct hsm_copy, padding) == 12, "found %lld\n", + (long long)(int)offsetof(struct hsm_copy, padding)); + LASSERTF((int)sizeof(((struct hsm_copy *)0)->padding) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_copy *)0)->padding)); + LASSERTF((int)offsetof(struct hsm_copy, hc_hai) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_copy, hc_hai)); + LASSERTF((int)sizeof(((struct hsm_copy *)0)->hc_hai) == 72, "found %lld\n", + (long long)(int)sizeof(((struct hsm_copy *)0)->hc_hai)); + + /* Checks for struct hsm_progress_kernel */ + LASSERTF((int)sizeof(struct hsm_progress_kernel) == 64, "found %lld\n", + (long long)(int)sizeof(struct hsm_progress_kernel)); + LASSERTF((int)offsetof(struct hsm_progress_kernel, hpk_fid) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress_kernel, hpk_fid)); + LASSERTF((int)sizeof(((struct hsm_progress_kernel *)0)->hpk_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress_kernel *)0)->hpk_fid)); + LASSERTF((int)offsetof(struct hsm_progress_kernel, hpk_cookie) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress_kernel, hpk_cookie)); + LASSERTF((int)sizeof(((struct hsm_progress_kernel *)0)->hpk_cookie) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress_kernel *)0)->hpk_cookie)); + LASSERTF((int)offsetof(struct hsm_progress_kernel, hpk_extent) == 24, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress_kernel, hpk_extent)); + LASSERTF((int)sizeof(((struct hsm_progress_kernel *)0)->hpk_extent) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress_kernel *)0)->hpk_extent)); + LASSERTF((int)offsetof(struct hsm_progress_kernel, hpk_flags) == 40, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress_kernel, hpk_flags)); + LASSERTF((int)sizeof(((struct hsm_progress_kernel *)0)->hpk_flags) == 2, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress_kernel *)0)->hpk_flags)); + LASSERTF((int)offsetof(struct hsm_progress_kernel, hpk_errval) == 42, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress_kernel, hpk_errval)); + LASSERTF((int)sizeof(((struct hsm_progress_kernel *)0)->hpk_errval) == 2, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress_kernel *)0)->hpk_errval)); + LASSERTF((int)offsetof(struct hsm_progress_kernel, hpk_padding1) == 44, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress_kernel, hpk_padding1)); + LASSERTF((int)sizeof(((struct hsm_progress_kernel *)0)->hpk_padding1) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress_kernel *)0)->hpk_padding1)); + LASSERTF((int)offsetof(struct hsm_progress_kernel, hpk_data_version) == 48, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress_kernel, hpk_data_version)); + LASSERTF((int)sizeof(((struct hsm_progress_kernel *)0)->hpk_data_version) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress_kernel *)0)->hpk_data_version)); + LASSERTF((int)offsetof(struct hsm_progress_kernel, hpk_padding2) == 56, "found %lld\n", + (long long)(int)offsetof(struct hsm_progress_kernel, hpk_padding2)); + LASSERTF((int)sizeof(((struct hsm_progress_kernel *)0)->hpk_padding2) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_progress_kernel *)0)->hpk_padding2)); + + /* Checks for struct hsm_user_item */ + LASSERTF((int)sizeof(struct hsm_user_item) == 32, "found %lld\n", + (long long)(int)sizeof(struct hsm_user_item)); + LASSERTF((int)offsetof(struct hsm_user_item, hui_fid) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_item, hui_fid)); + LASSERTF((int)sizeof(((struct hsm_user_item *)0)->hui_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_item *)0)->hui_fid)); + LASSERTF((int)offsetof(struct hsm_user_item, hui_extent) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_item, hui_extent)); + LASSERTF((int)sizeof(((struct hsm_user_item *)0)->hui_extent) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_item *)0)->hui_extent)); + + /* Checks for struct hsm_user_state */ + LASSERTF((int)sizeof(struct hsm_user_state) == 32, "found %lld\n", + (long long)(int)sizeof(struct hsm_user_state)); + LASSERTF((int)offsetof(struct hsm_user_state, hus_states) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_state, hus_states)); + LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_states) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_states)); + LASSERTF((int)offsetof(struct hsm_user_state, hus_archive_id) == 4, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_state, hus_archive_id)); + LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_archive_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_archive_id)); + LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_state) == 8, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_state)); + LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_state) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_state)); + LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_action) == 12, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_action)); + LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_action) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_action)); + LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_location) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_location)); + LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_location) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_location)); + + /* Checks for struct hsm_state_set */ + LASSERTF((int)sizeof(struct hsm_state_set) == 24, "found %lld\n", + (long long)(int)sizeof(struct hsm_state_set)); + LASSERTF((int)offsetof(struct hsm_state_set, hss_valid) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_state_set, hss_valid)); + LASSERTF((int)sizeof(((struct hsm_state_set *)0)->hss_valid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_state_set *)0)->hss_valid)); + LASSERTF((int)offsetof(struct hsm_state_set, hss_archive_id) == 4, "found %lld\n", + (long long)(int)offsetof(struct hsm_state_set, hss_archive_id)); + LASSERTF((int)sizeof(((struct hsm_state_set *)0)->hss_archive_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_state_set *)0)->hss_archive_id)); + LASSERTF((int)offsetof(struct hsm_state_set, hss_setmask) == 8, "found %lld\n", + (long long)(int)offsetof(struct hsm_state_set, hss_setmask)); + LASSERTF((int)sizeof(((struct hsm_state_set *)0)->hss_setmask) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_state_set *)0)->hss_setmask)); + LASSERTF((int)offsetof(struct hsm_state_set, hss_clearmask) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_state_set, hss_clearmask)); + LASSERTF((int)sizeof(((struct hsm_state_set *)0)->hss_clearmask) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_state_set *)0)->hss_clearmask)); + + /* Checks for struct hsm_current_action */ + LASSERTF((int)sizeof(struct hsm_current_action) == 24, "found %lld\n", + (long long)(int)sizeof(struct hsm_current_action)); + LASSERTF((int)offsetof(struct hsm_current_action, hca_state) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_current_action, hca_state)); + LASSERTF((int)sizeof(((struct hsm_current_action *)0)->hca_state) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_current_action *)0)->hca_state)); + LASSERTF((int)offsetof(struct hsm_current_action, hca_action) == 4, "found %lld\n", + (long long)(int)offsetof(struct hsm_current_action, hca_action)); + LASSERTF((int)sizeof(((struct hsm_current_action *)0)->hca_action) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_current_action *)0)->hca_action)); + LASSERTF((int)offsetof(struct hsm_current_action, hca_location) == 8, "found %lld\n", + (long long)(int)offsetof(struct hsm_current_action, hca_location)); + LASSERTF((int)sizeof(((struct hsm_current_action *)0)->hca_location) == 16, "found %lld\n", + (long long)(int)sizeof(((struct hsm_current_action *)0)->hca_location)); + + /* Checks for struct hsm_request */ + LASSERTF((int)sizeof(struct hsm_request) == 24, "found %lld\n", + (long long)(int)sizeof(struct hsm_request)); + LASSERTF((int)offsetof(struct hsm_request, hr_action) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_request, hr_action)); + LASSERTF((int)sizeof(((struct hsm_request *)0)->hr_action) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_request *)0)->hr_action)); + LASSERTF((int)offsetof(struct hsm_request, hr_archive_id) == 4, "found %lld\n", + (long long)(int)offsetof(struct hsm_request, hr_archive_id)); + LASSERTF((int)sizeof(((struct hsm_request *)0)->hr_archive_id) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_request *)0)->hr_archive_id)); + LASSERTF((int)offsetof(struct hsm_request, hr_flags) == 8, "found %lld\n", + (long long)(int)offsetof(struct hsm_request, hr_flags)); + LASSERTF((int)sizeof(((struct hsm_request *)0)->hr_flags) == 8, "found %lld\n", + (long long)(int)sizeof(((struct hsm_request *)0)->hr_flags)); + LASSERTF((int)offsetof(struct hsm_request, hr_itemcount) == 16, "found %lld\n", + (long long)(int)offsetof(struct hsm_request, hr_itemcount)); + LASSERTF((int)sizeof(((struct hsm_request *)0)->hr_itemcount) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_request *)0)->hr_itemcount)); + LASSERTF((int)offsetof(struct hsm_request, hr_data_len) == 20, "found %lld\n", + (long long)(int)offsetof(struct hsm_request, hr_data_len)); + LASSERTF((int)sizeof(((struct hsm_request *)0)->hr_data_len) == 4, "found %lld\n", + (long long)(int)sizeof(((struct hsm_request *)0)->hr_data_len)); + LASSERTF(HSM_FORCE_ACTION == 0x00000001UL, "found 0x%.8xUL\n", + (unsigned)HSM_FORCE_ACTION); + LASSERTF(HSM_GHOST_COPY == 0x00000002UL, "found 0x%.8xUL\n", + (unsigned)HSM_GHOST_COPY); + + /* Checks for struct hsm_user_request */ + LASSERTF((int)sizeof(struct hsm_user_request) == 24, "found %lld\n", + (long long)(int)sizeof(struct hsm_user_request)); + LASSERTF((int)offsetof(struct hsm_user_request, hur_request) == 0, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_request, hur_request)); + LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_request) == 24, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_request)); + LASSERTF((int)offsetof(struct hsm_user_request, hur_user_item) == 24, "found %lld\n", + (long long)(int)offsetof(struct hsm_user_request, hur_user_item)); + LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_user_item) == 0, "found %lld\n", + (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_user_item)); + + /* Checks for struct hsm_user_import */ + LASSERTF(sizeof(struct hsm_user_import) == 48, "found %lld\n", + (long long)sizeof(struct hsm_user_import)); + LASSERTF(offsetof(struct hsm_user_import, hui_size) == 0, + "found %lld\n", + (long long)offsetof(struct hsm_user_import, hui_size)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_size) == 8, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_size)); + LASSERTF(offsetof(struct hsm_user_import, hui_uid) == 32, + "found %lld\n", + (long long)offsetof(struct hsm_user_import, hui_uid)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_uid) == 4, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_uid)); + LASSERTF(offsetof(struct hsm_user_import, hui_gid) == 36, + "found %lld\n", + (long long)offsetof(struct hsm_user_import, hui_gid)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_gid) == 4, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_gid)); + LASSERTF(offsetof(struct hsm_user_import, hui_mode) == 40, + "found %lld\n", + (long long)offsetof(struct hsm_user_import, hui_mode)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_mode) == 4, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_mode)); + LASSERTF(offsetof(struct hsm_user_import, hui_atime) == 8, + "found %lld\n", + (long long)offsetof(struct hsm_user_import, hui_atime)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_atime) == 8, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_atime)); + LASSERTF(offsetof(struct hsm_user_import, hui_atime_ns) == 24, + "found %lld\n", + (long long)(int)offsetof(struct hsm_user_import, hui_atime_ns)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_atime_ns) == 4, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_atime_ns)); + LASSERTF(offsetof(struct hsm_user_import, hui_mtime) == 16, + "found %lld\n", + (long long)offsetof(struct hsm_user_import, hui_mtime)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_mtime) == 8, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_mtime)); + LASSERTF(offsetof(struct hsm_user_import, hui_mtime_ns) == 28, + "found %lld\n", + (long long)offsetof(struct hsm_user_import, hui_mtime_ns)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_mtime_ns) == 4, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_mtime_ns)); + LASSERTF(offsetof(struct hsm_user_import, hui_archive_id) == 44, + "found %lld\n", + (long long)offsetof(struct hsm_user_import, hui_archive_id)); + LASSERTF(sizeof(((struct hsm_user_import *)0)->hui_archive_id) == 4, + "found %lld\n", + (long long)sizeof(((struct hsm_user_import *)0)->hui_archive_id)); + + /* Checks for struct update_buf */ + LASSERTF((int)sizeof(struct update_buf) == 8, "found %lld\n", + (long long)(int)sizeof(struct update_buf)); + LASSERTF((int)offsetof(struct update_buf, ub_magic) == 0, "found %lld\n", + (long long)(int)offsetof(struct update_buf, ub_magic)); + LASSERTF((int)sizeof(((struct update_buf *)0)->ub_magic) == 4, "found %lld\n", + (long long)(int)sizeof(((struct update_buf *)0)->ub_magic)); + LASSERTF((int)offsetof(struct update_buf, ub_count) == 4, "found %lld\n", + (long long)(int)offsetof(struct update_buf, ub_count)); + LASSERTF((int)sizeof(((struct update_buf *)0)->ub_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct update_buf *)0)->ub_count)); + LASSERTF((int)offsetof(struct update_buf, ub_bufs) == 8, "found %lld\n", + (long long)(int)offsetof(struct update_buf, ub_bufs)); + LASSERTF((int)sizeof(((struct update_buf *)0)->ub_bufs) == 0, "found %lld\n", + (long long)(int)sizeof(((struct update_buf *)0)->ub_bufs)); + + /* Checks for struct update_reply */ + LASSERTF((int)sizeof(struct update_reply) == 8, "found %lld\n", + (long long)(int)sizeof(struct update_reply)); + LASSERTF((int)offsetof(struct update_reply, ur_version) == 0, "found %lld\n", + (long long)(int)offsetof(struct update_reply, ur_version)); + LASSERTF((int)sizeof(((struct update_reply *)0)->ur_version) == 4, "found %lld\n", + (long long)(int)sizeof(((struct update_reply *)0)->ur_version)); + LASSERTF((int)offsetof(struct update_reply, ur_count) == 4, "found %lld\n", + (long long)(int)offsetof(struct update_reply, ur_count)); + LASSERTF((int)sizeof(((struct update_reply *)0)->ur_count) == 4, "found %lld\n", + (long long)(int)sizeof(((struct update_reply *)0)->ur_count)); + LASSERTF((int)offsetof(struct update_reply, ur_lens) == 8, "found %lld\n", + (long long)(int)offsetof(struct update_reply, ur_lens)); + LASSERTF((int)sizeof(((struct update_reply *)0)->ur_lens) == 0, "found %lld\n", + (long long)(int)sizeof(((struct update_reply *)0)->ur_lens)); + + /* Checks for struct update */ + LASSERTF((int)sizeof(struct update) == 56, "found %lld\n", + (long long)(int)sizeof(struct update)); + LASSERTF((int)offsetof(struct update, u_type) == 0, "found %lld\n", + (long long)(int)offsetof(struct update, u_type)); + LASSERTF((int)sizeof(((struct update *)0)->u_type) == 4, "found %lld\n", + (long long)(int)sizeof(((struct update *)0)->u_type)); + LASSERTF((int)offsetof(struct update, u_batchid) == 4, "found %lld\n", + (long long)(int)offsetof(struct update, u_batchid)); + LASSERTF((int)sizeof(((struct update *)0)->u_batchid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct update *)0)->u_batchid)); + LASSERTF((int)offsetof(struct update, u_fid) == 8, "found %lld\n", + (long long)(int)offsetof(struct update, u_fid)); + LASSERTF((int)sizeof(((struct update *)0)->u_fid) == 16, "found %lld\n", + (long long)(int)sizeof(((struct update *)0)->u_fid)); + LASSERTF((int)offsetof(struct update, u_lens) == 24, "found %lld\n", + (long long)(int)offsetof(struct update, u_lens)); + LASSERTF((int)sizeof(((struct update *)0)->u_lens) == 32, "found %lld\n", + (long long)(int)sizeof(((struct update *)0)->u_lens)); + LASSERTF((int)offsetof(struct update, u_bufs) == 56, "found %lld\n", + (long long)(int)offsetof(struct update, u_bufs)); + LASSERTF((int)sizeof(((struct update *)0)->u_bufs) == 0, "found %lld\n", + (long long)(int)sizeof(((struct update *)0)->u_bufs)); +} From 633e3ec89cfe21d7a16cb134c45e90510ca94d1f Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Sat, 18 Sep 2021 13:27:59 -0600 Subject: [PATCH 02/49] Update configs --- config/nvim/init.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index fb32132..89b3d00 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -525,8 +525,8 @@ EOF nnoremap bgl :set bg=light nnoremap bgd :set bg=dark - " Remove vertical split pipe - set fillchars= + " controls vertical split pipe, end of buffer + set fillchars=fold:\ ,vert:\│,eob:\.,msgsep:‾ " Goyo {{{ let g:goyo_height = "100%" @@ -1015,6 +1015,9 @@ let g:completion_chain_complete_list = [ nnoremap tgb Telescope git_branches nnoremap tts Telescope treesitter + nnoremap \ Telescope live_grep + nnoremap * Telescope grep_string + " :lua require'telescope.builtin'.planets{} " :nnoremap pp :lua require'telescope.builtin'.planets{} @@ -1214,8 +1217,9 @@ nnoremap yr :YRShow if executable('ag') let g:ackprg = 'ag --vimgrep --hidden' endif - nnoremap \ :Ack! - nnoremap * :Ack! + " use telescope instead + " nnoremap \ :Ack! + " nnoremap * :Ack! " }}} " This plugin no longer exists From 8cf7352cbf0f98ccbfc6a1390dfe532b61bf60b4 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Sat, 18 Sep 2021 14:02:55 -0600 Subject: [PATCH 03/49] Add terraform and terminal --- config/nvim/init.vim | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 89b3d00..06cec67 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -77,6 +77,7 @@ " Plug 'jparise/vim-graphql', {'for': 'graphql'} Plug 'delphinus/vim-firestore' " firestore highlighting " Plug 'pangloss/vim-javascript', {'for': 'javascript'} + Plug 'hashivim/vim-terraform' Plug 'mattn/emmet-vim' " expanding abbreviations (HTML mostly) @@ -119,7 +120,7 @@ " Plug 'vimlab/split-term.vim' " Terminal utils " Plug 'christianrondeau/vim-base64' " Plug 'mhinz/vim-signify' - " Plug 'kassio/neoterm' " Terminal utils + Plug 'kassio/neoterm' " Terminal utils " Plug 'vim-scripts/regreplop.vim' " replace! Plug 'svermeulen/vim-subversive' " Replace stuff @@ -371,7 +372,8 @@ highlight TermCursor ctermfg=red guifg=red " tbone replacement using neoterm plugin - " nmap twl :TREPLSendLine + nmap twl :TREPLSendLine + nmap gxx :TREPLSendLine " vmap twl :TREPLSendLine " neoterm configuration @@ -381,17 +383,19 @@ let g:neoterm_default_mod = 'vertical' let g:neoterm_term_per_tab = 1 + nmap gxt :Ttoggle + " Use gx{text-object} in normal mode - nmap gx (neoterm-repl-send) + " nmap gx (neoterm-repl-send) " Send selected contents in visual mode. - xmap gx (neoterm-repl-send) + " xmap gx (neoterm-repl-send) " Send line - can use 2gxx to send 2 lines - nmap gxx (neoterm-repl-send-line) + " nmap gxx (neoterm-repl-send-line) " Toggle term visibility - nmap gxt :Ttoggle= + " nmap gxt :Ttoggle= From 193518982c00b6464896599d10992d84965d2500 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Sat, 2 Oct 2021 09:29:12 -0600 Subject: [PATCH 04/49] Re-enable fugitive --- config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 06cec67..98a976f 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -29,7 +29,7 @@ " Plug 'tpope/vim-eunuch' " Git - " Plug 'tpope/vim-fugitive' + Plug 'tpope/vim-fugitive' " Plug 'tpope/vim-rhubarb' " GH Enterprise support " Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive " Plug 'idanarye/vim-merginal' " branch mgmt for fugitive From 29602e24bc9df4824d921b31e8a32cccf8b26905 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Sat, 2 Oct 2021 09:31:04 -0600 Subject: [PATCH 05/49] Re-enable tpope/vim-rhubarb --- config/nvim/init.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 98a976f..9226ff8 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -30,7 +30,7 @@ " Git Plug 'tpope/vim-fugitive' - " Plug 'tpope/vim-rhubarb' " GH Enterprise support + Plug 'tpope/vim-rhubarb' " GBrowse and GH enterprise " Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive " Plug 'idanarye/vim-merginal' " branch mgmt for fugitive " Plug 'lambdalisue/gina.vim' @@ -898,7 +898,7 @@ let g:completion_chain_complete_list = [ " git {{{ map gb :Git blame - map gh :Gbrowse + map gh :GBrowse map ge :Gedit map gl :Glog map gw :Gwrite From c9a1d723243a8e46363ab079df2c1914ed47c319 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 5 Oct 2021 10:33:30 -0600 Subject: [PATCH 06/49] Enable blame --- config/nvim/init.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 9226ff8..ed46529 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -31,6 +31,7 @@ " Git Plug 'tpope/vim-fugitive' Plug 'tpope/vim-rhubarb' " GBrowse and GH enterprise + Plug 'APZelos/blamer.nvim' " Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive " Plug 'idanarye/vim-merginal' " branch mgmt for fugitive " Plug 'lambdalisue/gina.vim' @@ -897,6 +898,7 @@ let g:completion_chain_complete_list = [ " }}} " git {{{ + let g:blamer_enabled = 1 map gb :Git blame map gh :GBrowse map ge :Gedit From d3a0df7925559768713d16331dd1546f4b687f45 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 5 Oct 2021 10:37:16 -0600 Subject: [PATCH 07/49] Configure nvim tree --- config/nvim/init.vim | 69 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index ed46529..98e0acb 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -857,10 +857,79 @@ let g:completion_chain_complete_list = [ " let NERDTreeShowHidden=1 " NvimTree + +lua << EOF + +-- following options are the default +require'nvim-tree'.setup { + -- disables netrw completely + disable_netrw = false, + -- hijack netrw window on startup + hijack_netrw = true, + -- open the tree when running this setup function + open_on_setup = false, + -- will not open on setup if the filetype is in this list + ignore_ft_on_setup = {}, + -- closes neovim automatically when the tree is the last **WINDOW** in the view + auto_close = false, + -- opens the tree when changing/opening a new tab if the tree wasn't previously opened + open_on_tab = false, + -- hijacks new directory buffers when they are opened. + update_to_buf_dir = { + -- enable the feature + enable = true, + -- allow to open the tree if it was previously closed + auto_open = true, + }, + -- hijack the cursor in the tree to put it at the start of the filename + hijack_cursor = false, + -- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually) + update_cwd = false, + -- show lsp diagnostics in the signcolumn + lsp_diagnostics = false, + -- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file + update_focused_file = { + -- enables the feature + enable = false, + -- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory + -- only relevant when `update_focused_file.enable` is true + update_cwd = false, + -- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory + -- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true + ignore_list = {} + }, + -- configuration options for the system open command (`s` in the tree by default) + system_open = { + -- the command to run this, leaving nil should work in most cases + cmd = nil, + -- the command arguments as a list + args = {} + }, + + view = { + -- width of the window, can be either a number (columns) or a string in `%` + width = 30, + -- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom' + side = 'left', + -- if true the tree will resize itself after opening a file + auto_resize = false, + mappings = { + -- custom only false will merge the list with the default mappings + -- if true, it will only use your list to set the mappings + custom_only = false, + -- list of mappings to set on the tree manually + list = {} + } + } +} + +EOF + nnoremap tt :NvimTreeToggle nnoremap tr :NvimTreeRefresh nnoremap tf :NvimTreeFindFile + " }}} " tbone {{{ From 95ab0efd4587df5744fb4e48e04cf8fe0556db87 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 12 Oct 2021 06:36:57 -0600 Subject: [PATCH 08/49] Configure file explorer --- config/nvim/init.vim | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 98e0acb..5510c6a 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -32,7 +32,7 @@ Plug 'tpope/vim-fugitive' Plug 'tpope/vim-rhubarb' " GBrowse and GH enterprise Plug 'APZelos/blamer.nvim' - " Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive + Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive " Plug 'idanarye/vim-merginal' " branch mgmt for fugitive " Plug 'lambdalisue/gina.vim' Plug 'tpope/vim-git' @@ -845,21 +845,8 @@ let g:completion_chain_complete_list = [ " File explorer {{{ - " NERDTree - " map nt :NERDTreeFocus - " map ntf :NERDTreeFind - " map ntc :NERDTreeClose - " " Stay in sync with current working directory - " let NERDTreeChDirMode=2 - " let NERDTreeQuitOnOpen=0 - " let NERDTreeMapToggleHidden=1 - " let NERDTreeCascadeSingleChildDir=0 " do not collapse - " let NERDTreeShowHidden=1 - - " NvimTree - -lua << EOF +lua <nt :NERDTreeFocus + " map ntf :NERDTreeFind + " map ntc :NERDTreeClose + " " Stay in sync with current working directory + " let NERDTreeChDirMode=2 + " let NERDTreeQuitOnOpen=0 + " let NERDTreeMapToggleHidden=1 + " let NERDTreeCascadeSingleChildDir=0 " do not collapse + " let NERDTreeShowHidden=1 + + " NvimTree + + nnoremap tt :NvimTreeToggle nnoremap tr :NvimTreeRefresh nnoremap tf :NvimTreeFindFile From a7cb574c746b8bc0c5a1098bb7a412845d2ee6a4 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Thu, 21 Oct 2021 09:29:02 -0600 Subject: [PATCH 09/49] Configure nvim tree --- config/nvim/init.vim | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 5510c6a..2d1ff23 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -229,6 +229,7 @@ set wildmode=list:longest set visualbell set shortmess=I " hide the startup message + set shortmess+=F " don't show file info when editing set ic " case insensitive search set gdefault set incsearch @@ -854,13 +855,13 @@ require'nvim-tree'.setup { -- hijack netrw window on startup hijack_netrw = true, -- open the tree when running this setup function - open_on_setup = false, + open_on_setup = true, -- will not open on setup if the filetype is in this list ignore_ft_on_setup = {}, -- closes neovim automatically when the tree is the last **WINDOW** in the view auto_close = false, -- opens the tree when changing/opening a new tab if the tree wasn't previously opened - open_on_tab = false, + open_on_tab = true, -- hijacks new directory buffers when they are opened. update_to_buf_dir = { -- enable the feature @@ -913,22 +914,7 @@ require'nvim-tree'.setup { } EOF - - " NERDTree - " map nt :NERDTreeFocus - " map ntf :NERDTreeFind - " map ntc :NERDTreeClose - " " Stay in sync with current working directory - " let NERDTreeChDirMode=2 - " let NERDTreeQuitOnOpen=0 - " let NERDTreeMapToggleHidden=1 - " let NERDTreeCascadeSingleChildDir=0 " do not collapse - " let NERDTreeShowHidden=1 - - " NvimTree - - - nnoremap tt :NvimTreeToggle + nnoremap nt :NvimTreeToggle nnoremap tr :NvimTreeRefresh nnoremap tf :NvimTreeFindFile @@ -1088,6 +1074,8 @@ EOF nnoremap p Telescope git_files nnoremap fg Telescope live_grep nnoremap fb Telescope buffers + nnoremap fd Telescope lsp_definitions + nnoremap fa Telescope lsp_code_actions nnoremap fh Telescope help_tags nnoremap fl Telescope git_files nnoremap tgb Telescope git_branches From 8a0c6403bb26b92d2da9ac7343ca428b67457dda Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Thu, 21 Oct 2021 09:29:24 -0600 Subject: [PATCH 10/49] Configure Clojure --- config/nvim/init.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 2d1ff23..d9ef407 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -90,11 +90,11 @@ " Plug 'clojure-vim/async-clj-omni', {'for': 'clojure'} " clj completion " " needed for edn and the latest clojure syntax " Plug 'guns/vim-clojure-static', {'for': 'clojure'} - " Plug 'guns/vim-sexp', {'for': 'clojure'} " Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'} " " Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'dev'} - " Plug 'liquidz/vim-iced', {'for': 'clojure'} - " Plug 'liquidz/vim-iced-project-namespaces', {'for': 'clojure'} + Plug 'liquidz/vim-iced', {'for': 'clojure'} + Plug 'liquidz/vim-iced-project-namespaces', {'for': 'clojure'} + Plug 'guns/vim-sexp', {'for': 'clojure'} " NOTE: required for vim-iced " Plug 'liquidz/vim-iced-kaocha' " " Plug 'matthias-margush/vim-iced', {'for': 'clojure', 'branch': 'piggieback' } " " Note: Doesn't work with .cljc files yet: @@ -376,6 +376,9 @@ " tbone replacement using neoterm plugin nmap twl :TREPLSendLine nmap gxx :TREPLSendLine + vmap gx :TREPLSendSelection + + " vmap twl :TREPLSendLine " neoterm configuration @@ -957,6 +960,7 @@ EOF " git {{{ let g:blamer_enabled = 1 + let g:blamer_date_format = '%y/%m/%d' map gb :Git blame map gh :GBrowse map ge :Gedit From c9f46111cca867273679e7787ca7f04095f1228e Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 29 Oct 2021 09:31:35 -0600 Subject: [PATCH 11/49] Add yoink --- config/nvim/init.vim | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index d9ef407..f73eb71 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -133,6 +133,7 @@ " CoC.nvim " Plug 'dense-analysis/ale' " Async Lint Engine " Plug 'vim-scripts/YankRing.vim' " (SLOW) Keep track of past yanked values + Plug 'svermeulen/vim-yoink' " Plug 'vim-scripts/tComment' " Comment stuff " Plug 'junegunn/goyo.vim' " Writing mode " Plug 'preservim/tagbar' " ctags! @@ -1276,6 +1277,41 @@ EOF " Start interactive EasyAlign for a motion/text object (e.g. gaip) nmap ga (EasyAlign) " }}} +" + +" yoink {{{ +nmap (YoinkPostPasteSwapBack) +nmap (YoinkPostPasteSwapForward) + +nmap p (YoinkPaste_p) +nmap P (YoinkPaste_P) + +" Also replace the default gp with yoink paste so we can toggle paste in this +" case too +nmap gp (YoinkPaste_gp) +nmap gP (YoinkPaste_gP) + +" Now when you hit [y/]y the current yank will change and you will see a preview +" of it in the status bar +nmap [y (YoinkRotateBack) +nmap ]y (YoinkRotateForward) + +" You might also want to add a map for toggling whether the current paste is +" formatted or not: +nmap (YoinkPostPasteToggleFormat) +" Now, hitting after a paste will toggle between formatted and unformatted +" (equivalent to using the = key). + +" Finally, you can also optionally add the following map: +nmap y (YoinkYankPreserveCursorPosition) +xmap y (YoinkYankPreserveCursorPosition) + +" After adding this map, yank will function exactly the same as previously with +" the one difference being that the cursor position will not change after +" performing a yank. This can be more useful especially when yanking a large +" text object such as a paragraph. + +" }}} " YankRing {{{ let yankring_persist = 1 From af224239815abbf9825db3b3b73ae651ca9827ed Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 3 Nov 2021 16:33:24 -0400 Subject: [PATCH 12/49] Add kcert --- infra-aliases.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/infra-aliases.sh b/infra-aliases.sh index 451a464..355c61f 100644 --- a/infra-aliases.sh +++ b/infra-aliases.sh @@ -107,6 +107,10 @@ ksecret() { kubectl get secret $1 -o json | jq -r '.data | map_values(@base64d)' } +kcert() { + kubectl get secret $1 -o json | jq -r --arg KEY "$2" '.data[$KEY]' | base64 -D | openssl x509 -noout -text +} + # kroles() { # # from https://stackoverflow.com/questions/55646821/how-to-find-which-role-or-clusterrole-binded-to-a-service-account-in-kubernetes # kubectl get rolebindings,clusterrolebindings \ From e4cda2c2e8cc99799df80b15a69a838c4ebbd552 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 10 Nov 2021 08:30:37 -0700 Subject: [PATCH 13/49] Quit nvim tree on open --- config/nvim/init.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index f73eb71..396af09 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -918,6 +918,11 @@ require'nvim-tree'.setup { } EOF + " Can be `0` or `1`. When `1`, will close the tree when a file is opened. + " Applies to: `edit`, `vsplit`, `split`, `tabnew`. + " Default is 0 + let g:nvim_tree_quit_on_open = 1 + nnoremap nt :NvimTreeToggle nnoremap tr :NvimTreeRefresh nnoremap tf :NvimTreeFindFile From eb6fc69155fba7e5fb180a48c1870351b132694e Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 10 Nov 2021 08:31:03 -0700 Subject: [PATCH 14/49] Add copilot --- config/nvim/init.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 396af09..8666201 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -48,6 +48,7 @@ " Completion Plug 'nvim-lua/completion-nvim' + Plug 'github/copilot.vim' " Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' } " nvim-cmp " Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' } " Install the buffer completion source From a53ccb18aa2c77608176e868348e4c5410f13acd Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 21 Jan 2022 08:27:19 -0700 Subject: [PATCH 15/49] Add updates --- .apps.sh | 21 ++++++++++----------- config/nvim/init.vim | 6 ++++-- hushlogin | 0 infra-aliases.sh | 45 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 hushlogin diff --git a/.apps.sh b/.apps.sh index 55e42d9..12fce0e 100755 --- a/.apps.sh +++ b/.apps.sh @@ -18,13 +18,20 @@ echo "NOTE: Install Dropbox and let it sync before running this" # Foundations {{{ brew install zsh - brew install vim --with-override-system-vi - brew install tmux - brew install reattach-to-user-namespace + # use neovim instead (see below) + # brew install vim --with-override-system-vi brew install git + # brew install tmux + # brew install reattach-to-user-namespace # }}} +# neovim {{{ + brew install neovim --HEAD || brew reinstall neovim --HEAD + pip3 install neovim --upgrade + pip2 install neovim --upgrade +# }}} + # Utils {{{ brew install watch # brew install ctags # this is outdated, use below instead for @@ -135,14 +142,6 @@ brew services start postgresql brew tap johanhaleby/kubetail brew install kubetail - # brew tap neovim/neovim - # brew untap neovim/neovim - # brew install neovim - # need this commit so until it's released, install neovim from master - # https://github.com/neovim/neovim/pull/5758/commits/af2e629be4d20dda334a7c6ca817f5599956e4ff - brew install neovim --HEAD || brew reinstall neovim --HEAD - pip3 install neovim --upgrade - pip2 install neovim --upgrade brew tap thoughtbot/formulae brew install rcm diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 8666201..a845247 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -80,6 +80,7 @@ Plug 'delphinus/vim-firestore' " firestore highlighting " Plug 'pangloss/vim-javascript', {'for': 'javascript'} Plug 'hashivim/vim-terraform' + Plug 'unisonweb/unison', { 'branch': 'trunk', 'rtp': 'editor-support/vim' } Plug 'mattn/emmet-vim' " expanding abbreviations (HTML mostly) @@ -93,7 +94,7 @@ " Plug 'guns/vim-clojure-static', {'for': 'clojure'} " Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'} " " Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'dev'} - Plug 'liquidz/vim-iced', {'for': 'clojure'} + Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'main'} Plug 'liquidz/vim-iced-project-namespaces', {'for': 'clojure'} Plug 'guns/vim-sexp', {'for': 'clojure'} " NOTE: required for vim-iced " Plug 'liquidz/vim-iced-kaocha' @@ -759,6 +760,7 @@ local formatFiletypes = { typescript = "prettier", typescriptreact = "prettier" } + nvim_lsp.diagnosticls.setup { on_attach = on_attach, filetypes = vim.tbl_keys(filetypes), @@ -1191,7 +1193,7 @@ EOF " vim-fireplace / clojure " autocmd FileType clojure nmap cpP :Eval " autocmd FileType clojure nmap l :Last - " autocmd FileType clojure nmap ctt :Require:Eval (run-tests) + autocmd FileType clojure nmap ctt :IcedTestUnderCursor " autocmd FileType clojure nmap ctm :Eval (require 'midje.repl)(midje.repl/load-facts *ns*) " autocmd FileType clojure nmap cpR :Require! diff --git a/hushlogin b/hushlogin new file mode 100644 index 0000000..e69de29 diff --git a/infra-aliases.sh b/infra-aliases.sh index 355c61f..ec0e10c 100644 --- a/infra-aliases.sh +++ b/infra-aliases.sh @@ -3,6 +3,14 @@ # Setup kubectl and gcloud aliases {{{ +alias knonrunning="watch 'kubectl get pods --all-namespaces | grep -v Running'" +alias knodecounts="k get node --no-headers | awk '{print \$2}' | sort | uniq -c" + +alias k="kubectl" +alias kx="kubectx" +alias kn="kubens" +kt() { kubetail --namespace $KUBE_NAMESPACE } + # Set default KUBE_NAMESPACE: # export KUBE_NAMESPACE="${KUBE_NAMESPACE:-staging}" # @@ -139,4 +147,41 @@ kperms() { } +kversions() { + alias copyver="k version -ojson | jq -r '.serverVersion.gitVersion' | pbcopy" + alias printver="k version -ojson | jq -r '.serverVersion.gitVersion'" + + for k in $(kx | grep carta); do + kx $k + v=$(printver) + echo $v + echo + done +} + +kimages() { + echo -n "Prod: " + kubectl get deployment -nprod $1 -o jsonpath='{.spec.template.spec.containers[0].image}' + echo + echo -n "Dev: " + kubectl get deployment -ndev $1 -o jsonpath='{.spec.template.spec.containers[0].image}' + echo + echo -n "Test: " + kubectl get deployment -ntest $1 -o jsonpath='{.spec.template.spec.containers[0].image}' + echo +} + +# secret manager pod +alias smpod="k get po -l app.kubernetes.io/name=secret-manager -oname" + +clusterdnsperf() { + # kc exec -it $(kc get pods -l app=cluster-utils -o jsonpath="{.items[*].metadata.name}") sh + kubectl run --namespace $KUBE_NAMESPACE -i --tty --rm dnsperf --image mrlesmithjr/dnsperf --command sh +} + +alias nodeports="kc get svc -o json | jq -r '.items[] | \ + .np = .spec.ports[0].nodePort | select(.np != null) | \ + .metadata.name + \": \" + (.np | tostring)'" + # }}} + From 25dbdcfd48ef7d5b66b02a69a379ed1940c34cdb Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 21 Jan 2022 08:28:22 -0700 Subject: [PATCH 16/49] Redo lsp config --- .apps.sh | 8 ++ config/nvim/init.vim | 192 +++++++++++++++---------------------------- 2 files changed, 75 insertions(+), 125 deletions(-) diff --git a/.apps.sh b/.apps.sh index 12fce0e..dc9a583 100755 --- a/.apps.sh +++ b/.apps.sh @@ -142,6 +142,14 @@ brew services start postgresql brew tap johanhaleby/kubetail brew install kubetail + # brew tap neovim/neovim + # brew untap neovim/neovim + # brew install neovim + # need this commit so until it's released, install neovim from master + # https://github.com/neovim/neovim/pull/5758/commits/af2e629be4d20dda334a7c6ca817f5599956e4ff + brew install neovim --HEAD || brew reinstall neovim + pip3 install neovim --upgrade + pip2 install neovim --upgrade brew tap thoughtbot/formulae brew install rcm diff --git a/config/nvim/init.vim b/config/nvim/init.vim index a845247..04928d5 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -42,6 +42,7 @@ Plug 'jose-elias-alvarez/null-ls.nvim', { 'branch': 'main' } Plug 'jose-elias-alvarez/nvim-lsp-ts-utils', { 'branch': 'main' } Plug 'folke/trouble.nvim', { 'branch': 'main' } + Plug 'RRethy/vim-illuminate' " highlight words under cursor " Snippets Plug 'hrsh7th/vim-vsnip' " snippet engine @@ -94,7 +95,7 @@ " Plug 'guns/vim-clojure-static', {'for': 'clojure'} " Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'} " " Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'dev'} - Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'main'} + Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'main' } Plug 'liquidz/vim-iced-project-namespaces', {'for': 'clojure'} Plug 'guns/vim-sexp', {'for': 'clojure'} " NOTE: required for vim-iced " Plug 'liquidz/vim-iced-kaocha' @@ -441,7 +442,6 @@ " Lualine {{{ - lua << EOF require'lualine'.setup{ options = { theme = 'solarized_light' }, @@ -498,7 +498,8 @@ EOF set termguicolors " https://github.com/overcache/NeoSolarized set colorcolumn=80 set guioptions=egmt - set bg=dark + " default background color - can be toggled + set bg=light let g:airline_powerline_fonts = 1 " Only load the Airline extensions we want @@ -590,11 +591,11 @@ set foldexpr=nvim_treesitter#foldexpr() " Trouble {{{ lua << EOF -require("trouble").setup { +-- require("trouble").setup { -- your configuration comes here -- or leave it empty to use the default settings -- refer to the configuration section below -} +-- } EOF nnoremap xx TroubleToggle @@ -608,128 +609,67 @@ nnoremap gR TroubleToggle lsp_references " LSP {{{ lua << EOF -local nvim_lsp = require('lspconfig') - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer - --- local on_attach = function(client, bufnr) --- local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end --- local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end --- --- -- Enable completion triggered by --- buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') --- --- -- Mappings. --- local opts = { noremap=true, silent=true } --- --- -- See `:help vim.lsp.*` for documentation on any of the below functions --- buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) --- buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) --- buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) --- buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) --- buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) --- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) --- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) --- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) --- buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) --- buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) --- buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) --- buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) --- buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) --- buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) --- buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) --- buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) --- buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) --- --- end --- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches --- local servers = { 'tsserver' } --- for _, lsp in ipairs(servers) do --- nvim_lsp[lsp].setup { --- on_attach = on_attach, --- flags = { --- debounce_text_changes = 150, --- } --- } --- end - - --- https://jose-elias-alvarez.medium.com/configuring-neovims-lsp-client-for-typescript-development-5789d58ea9c - -local nvim_lsp = require("lspconfig") -local format_async = function(err, _, result, _, bufnr) - if err ~= nil or result == nil then return end - if not vim.api.nvim_buf_get_option(bufnr, "modified") then - local view = vim.fn.winsaveview() - vim.lsp.util.apply_text_edits(result, bufnr) - vim.fn.winrestview(view) - if bufnr == vim.api.nvim_get_current_buf() then - vim.api.nvim_command("noautocmd :update") - end - end -end -vim.lsp.handlers["textDocument/formatting"] = format_async -_G.lsp_organize_imports = function() - local params = { - command = "_typescript.organizeImports", - arguments = {vim.api.nvim_buf_get_name(0)}, - title = "" - } - vim.lsp.buf.execute_command(params) -end -local on_attach = function(client, bufnr) - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - require'completion'.on_attach(client, bufnr) - -- Enable completion triggered by - buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') - local buf_map = vim.api.nvim_buf_set_keymap +-- from https://jose-elias-alvarez.medium.com/configuring-neovims-lsp-client-for-typescript-development-5789d58ea9c +-- updated 1/15/2022 + +local lspconfig = require("lspconfig") +local null_ls = require("null-ls") +local buf_map = function(bufnr, mode, lhs, rhs, opts) + vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts or { + silent = true, + }) +end +local on_attach = function(client, bufnr) vim.cmd("command! LspDef lua vim.lsp.buf.definition()") vim.cmd("command! LspFormatting lua vim.lsp.buf.formatting()") vim.cmd("command! LspCodeAction lua vim.lsp.buf.code_action()") vim.cmd("command! LspHover lua vim.lsp.buf.hover()") vim.cmd("command! LspRename lua vim.lsp.buf.rename()") - vim.cmd("command! LspOrganize lua lsp_organize_imports()") vim.cmd("command! LspRefs lua vim.lsp.buf.references()") vim.cmd("command! LspTypeDef lua vim.lsp.buf.type_definition()") vim.cmd("command! LspImplementation lua vim.lsp.buf.implementation()") - vim.cmd("command! LspDiagPrev lua vim.lsp.diagnostic.goto_prev()") - vim.cmd("command! LspDiagNext lua vim.lsp.diagnostic.goto_next()") - vim.cmd( - "command! LspDiagLine lua vim.lsp.diagnostic.show_line_diagnostics()") + vim.cmd("command! LspDiagPrev lua vim.diagnostic.goto_prev()") + vim.cmd("command! LspDiagNext lua vim.diagnostic.goto_next()") + vim.cmd("command! LspDiagLine lua vim.diagnostic.open_float()") vim.cmd("command! LspSignatureHelp lua vim.lsp.buf.signature_help()") -buf_map(bufnr, "n", "gd", ":LspDef", {silent = true}) - buf_map(bufnr, "n", "gr", ":LspRename", {silent = true}) - buf_map(bufnr, "n", "gR", ":LspRefs", {silent = true}) - buf_map(bufnr, "n", "gy", ":LspTypeDef", {silent = true}) - buf_map(bufnr, "n", "K", ":LspHover", {silent = true}) - buf_map(bufnr, "n", "gs", ":LspOrganize", {silent = true}) - buf_map(bufnr, "n", "[a", ":LspDiagPrev", {silent = true}) - buf_map(bufnr, "n", "]a", ":LspDiagNext", {silent = true}) - buf_map(bufnr, "n", "ga", ":LspCodeAction", {silent = true}) - buf_map(bufnr, "n", "a", ":LspDiagLine", {silent = true}) - buf_map(bufnr, "i", "", " LspSignatureHelp", - {silent = true}) -if client.resolved_capabilities.document_formatting then - vim.api.nvim_exec([[ - augroup LspAutocommands - autocmd! * - autocmd BufWritePost LspFormatting - augroup END - ]], true) + buf_map(bufnr, "n", "gd", ":LspDef") + buf_map(bufnr, "n", "gr", ":LspRename") + buf_map(bufnr, "n", "gy", ":LspTypeDef") + buf_map(bufnr, "n", "K", ":LspHover") + buf_map(bufnr, "n", "[a", ":LspDiagPrev") + buf_map(bufnr, "n", "]a", ":LspDiagNext") + buf_map(bufnr, "n", "ga", ":LspCodeAction") + buf_map(bufnr, "n", "a", ":LspDiagLine") + buf_map(bufnr, "i", "", " LspSignatureHelp") + if client.resolved_capabilities.document_formatting then + vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 5000)") end end - - -nvim_lsp.tsserver.setup { - on_attach = function(client) +lspconfig.tsserver.setup({ + on_attach = function(client, bufnr) client.resolved_capabilities.document_formatting = false - on_attach(client) - end -} + client.resolved_capabilities.document_range_formatting = false + local ts_utils = require("nvim-lsp-ts-utils") + ts_utils.setup({}) + ts_utils.setup_client(client) + buf_map(bufnr, "n", "gs", ":TSLspOrganize") + buf_map(bufnr, "n", "gi", ":TSLspRenameFile") + buf_map(bufnr, "n", "go", ":TSLspImportAll") + on_attach(client, bufnr) + end, +}) +null_ls.setup({ + sources = { + null_ls.builtins.diagnostics.eslint, + null_ls.builtins.code_actions.eslint, + null_ls.builtins.formatting.prettier, + }, + on_attach = on_attach, +}) +-- + local filetypes = { typescript = "eslint", typescriptreact = "eslint", @@ -761,17 +701,16 @@ local formatFiletypes = { typescriptreact = "prettier" } -nvim_lsp.diagnosticls.setup { - on_attach = on_attach, - filetypes = vim.tbl_keys(filetypes), - init_options = { - filetypes = filetypes, - linters = linters, - formatters = formatters, - formatFiletypes = formatFiletypes - } -} - +-- nvim_lsp.diagnosticls.setup { +-- on_attach = on_attach, +-- filetypes = vim.tbl_keys(filetypes), +-- init_options = { +-- filetypes = filetypes, +-- linters = linters, +-- formatters = formatters, +-- formatFiletypes = formatFiletypes +-- } +--} EOF @@ -881,7 +820,9 @@ require'nvim-tree'.setup { -- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually) update_cwd = false, -- show lsp diagnostics in the signcolumn - lsp_diagnostics = false, + diagnostics = { + enable = false, + }, -- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file update_focused_file = { -- enables the feature @@ -1089,6 +1030,7 @@ EOF nnoremap fb Telescope buffers nnoremap fd Telescope lsp_definitions nnoremap fa Telescope lsp_code_actions + nnoremap fs Telescope lsp_document_symbols nnoremap fh Telescope help_tags nnoremap fl Telescope git_files nnoremap tgb Telescope git_branches From a792f501d1ff3895baf7e74eb1afad51c424071b Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Sat, 12 Feb 2022 08:42:39 -0700 Subject: [PATCH 17/49] Add support for helm templates --- config/nvim/ftdetect/gotmpl.vim | 3 + config/nvim/init.vim | 33 +++++++-- config/nvim/queries/gotmpl/highlights.scm | 84 +++++++++++++++++++++++ 3 files changed, 113 insertions(+), 7 deletions(-) create mode 100644 config/nvim/ftdetect/gotmpl.vim create mode 100644 config/nvim/queries/gotmpl/highlights.scm diff --git a/config/nvim/ftdetect/gotmpl.vim b/config/nvim/ftdetect/gotmpl.vim new file mode 100644 index 0000000..694ef03 --- /dev/null +++ b/config/nvim/ftdetect/gotmpl.vim @@ -0,0 +1,3 @@ + +" https://github.com/ngalaiko/tree-sitter-go-template +autocmd BufNewFile,BufRead * if search('{{.\+}}', 'nw') | setlocal filetype=gotmpl | endif diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 04928d5..5b96916 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -31,7 +31,8 @@ " Git Plug 'tpope/vim-fugitive' Plug 'tpope/vim-rhubarb' " GBrowse and GH enterprise - Plug 'APZelos/blamer.nvim' + " this is buggy and causes lots of errors - TODO find alternative: + " Plug 'APZelos/blamer.nvim' Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive " Plug 'idanarye/vim-merginal' " branch mgmt for fugitive " Plug 'lambdalisue/gina.vim' @@ -165,7 +166,7 @@ " Plug 'Vigemus/nvimux' " Tmux-like key bindings for NeoVim " Status line - Plug 'hoob3rt/lualine.nvim' + Plug 'nvim-lualine/lualine.nvim' " " Powerline alternatives " Plug 'vim-airline/vim-airline' @@ -445,6 +446,8 @@ lua << EOF require'lualine'.setup{ options = { theme = 'solarized_light' }, + extensions = {'quickfix', 'nvim-tree'}, + sections = { lualine_c = {'nvim_treesitter#statusline(90)'} } } EOF @@ -581,6 +584,17 @@ require'nvim-treesitter.configs'.setup { enable = true }, } + +local parser_config = require'nvim-treesitter.parsers'.get_parser_configs() +parser_config.gotmpl = { + install_info = { + url = "https://github.com/ngalaiko/tree-sitter-go-template", + files = {"src/parser.c"} + }, + filetype = "gotmpl", + used_by = {"gohtmltmpl", "gotexttmpl", "gotmpl", "yaml"} +} + EOF set foldmethod=expr @@ -790,7 +804,7 @@ let g:completion_chain_complete_list = [ " }}} -" File explorer {{{ +" File explorer (nvim-tree) {{{ lua <nt :NvimTreeToggle nnoremap tr :NvimTreeRefresh @@ -909,8 +927,9 @@ EOF " }}} " git {{{ - let g:blamer_enabled = 1 - let g:blamer_date_format = '%y/%m/%d' + + " let g:blamer_enabled = 1 + " let g:blamer_date_format = '%y/%m/%d' map gb :Git blame map gh :GBrowse map ge :Gedit diff --git a/config/nvim/queries/gotmpl/highlights.scm b/config/nvim/queries/gotmpl/highlights.scm new file mode 100644 index 0000000..6f55737 --- /dev/null +++ b/config/nvim/queries/gotmpl/highlights.scm @@ -0,0 +1,84 @@ +; Identifiers + +[ + (field) + (field_identifier) +] @property + +(variable) @variable + +; Function calls + +(function_call + function: (identifier) @function) + +(method_call + method: (selector_expression + field: (field_identifier) @method)) + +; Operators + +"|" @operator +":=" @operator + +; Builtin functions + +((identifier) @function.builtin + (#match? @function.builtin "^(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|ge|gt|ge)$")) + +; Delimiters + +"." @punctuation.delimiter +"," @punctuation.delimiter + +"{{" @punctuation.bracket +"}}" @punctuation.bracket +"{{-" @punctuation.bracket +"-}}" @punctuation.bracket +")" @punctuation.bracket +"(" @punctuation.bracket + +; Keywords + +[ + "else" + "else if" + "if" + "with" +] @conditional + +[ + "range" + "end" + "template" + "define" + "block" +] @keyword + +; Literals + +[ + (interpreted_string_literal) + (raw_string_literal) + (rune_literal) +] @string + +(escape_sequence) @string.special + +[ + (int_literal) + (float_literal) + (imaginary_literal) +] @number + +[ + (true) + (false) +] @boolean + +[ + (nil) +] @constant.builtin + +(comment) @comment +(ERROR) @error From 10f6111e330fcf04dea109ad7ff9f30c48bf1330 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Sat, 12 Feb 2022 08:43:05 -0700 Subject: [PATCH 18/49] Switch color schemes --- config/nvim/init.vim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 5b96916..6e88106 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -50,7 +50,7 @@ " Completion Plug 'nvim-lua/completion-nvim' - Plug 'github/copilot.vim' + Plug 'github/copilot.vim', { 'branch': 'main' } " Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' } " nvim-cmp " Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' } " Install the buffer completion source @@ -65,7 +65,9 @@ " Colors - some plugins rely on this " Plug 'devth/vim-colors-solarized' " Note: devth-fork - Plug 'overcache/NeoSolarized' + " Plug 'overcache/NeoSolarized' + Plug 'ishan9299/nvim-solarized-lua' + " Use TreeSitter for language highlighting instead Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} @@ -496,7 +498,7 @@ EOF \ syn cluster vimCommentGroup contains=fmrkr " colorscheme solarized - colorscheme NeoSolarized + colorscheme solarized set termguicolors " https://github.com/overcache/NeoSolarized set colorcolumn=80 @@ -661,7 +663,11 @@ local on_attach = function(client, bufnr) vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 5000)") end end + lspconfig.tsserver.setup({ + flags = { + debounce_text_changes = 500, + }, on_attach = function(client, bufnr) client.resolved_capabilities.document_formatting = false client.resolved_capabilities.document_range_formatting = false @@ -693,7 +699,7 @@ local linters = { sourceName = "eslint", command = "eslint_d", rootPatterns = {".eslintrc.js", "package.json"}, - debounce = 100, + debounce = 500, args = {"--stdin", "--stdin-filename", "%filepath", "--format", "json"}, parseJson = { errorsRoot = "[0].messages", From ea5b75326c5b964d1365c0033b1c5b8ae178a676 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 25 Feb 2022 08:02:39 -0700 Subject: [PATCH 19/49] Fix copilot again --- config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 6e88106..1192ff4 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -50,7 +50,7 @@ " Completion Plug 'nvim-lua/completion-nvim' - Plug 'github/copilot.vim', { 'branch': 'main' } + Plug 'github/copilot.vim', { 'branch': 'release' } " Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' } " nvim-cmp " Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' } " Install the buffer completion source From af4eb815a0b043ca0fe53a9682844fdc6149f6a2 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 2 Mar 2022 14:00:53 -0700 Subject: [PATCH 20/49] Fix git add alias in vim --- config/nvim/init.vim | 2 +- gitconfig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 1192ff4..3cb82ef 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -947,7 +947,7 @@ EOF map gP :Git push map gp :Git pull --rebase map gc :Git commit - map ga :Dispatch! git add % + map ga :Git add % " }}} " Dispatch {{{ diff --git a/gitconfig b/gitconfig index 6fe619d..475c150 100644 --- a/gitconfig +++ b/gitconfig @@ -91,3 +91,5 @@ user = devth [ghi] token = !security find-internet-password -a devth -s github.com -l 'ghi token' -w +[remote "origin"] + fetch = +refs/pull/*:refs/remotes/origin/pull/* From 18cc8c68f60dc91a2f4606c8be04e346046662da Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 2 Mar 2022 15:19:15 -0700 Subject: [PATCH 21/49] Remove unused apps and fix cask syntax --- .apps.sh | 91 +++++++++++++++++--------------------------------------- 1 file changed, 28 insertions(+), 63 deletions(-) diff --git a/.apps.sh b/.apps.sh index dc9a583..4b80c78 100755 --- a/.apps.sh +++ b/.apps.sh @@ -114,9 +114,7 @@ brew services start postgresql # Clojure {{{ # Drip requires java 8 :( brew cask install homebrew/cask-versions/java8 - brew install drip brew install leiningen - brew install boot-clj # brew install datomic brew install borkdude/brew/clj-kondo # }}} @@ -158,69 +156,54 @@ brew services start postgresql brew tap caskroom/fonts brew cask install font-hack-nerd-font - brew tap unisonweb/unison - brew install unison-language + # brew tap unisonweb/unison + # brew install unison-language # }}} # Brew Cask {{{ - brew tap caskroom/cask - brew tap caskroom/versions + # brew tap caskroom/cask + # brew tap caskroom/versions # brew cask install zooom # WTF why is this dead # we'll obtain it from dropbox instead - brew cask install java + # brew cask install java + # brew cask install vimr + # brew cask install backblaze - brew cask install vimr - - brew cask install backblaze - - brew cask install selfcontrol + brew install selfcontrol # brew install docker # brew install docker-machine - brew cask install docker - - brew cask install google-chrome - - brew tap caskroom/versions - brew cask install google-chrome-canary - - brew cask install iterm2 + brew install docker + brew install iterm2 # brew cask install divvy - brew cask install spectacle - - brew cask install spotify - - brew cask install alfred - - brew cask install slack - - brew cask install istat-menus + # brew cask install spectacle + # brew cask install spotify + # brew cask install alfred + # brew cask install slack + # brew cask install istat-menus # get license from gmail - brew cask install airfoil + # brew cask install airfoil - brew cask install dash + brew install dash --cask open ~/Dropbox/Licenses/license-dash4.dash-license - brew cask install virtualbox - brew cask install vagrant + # brew cask install virtualbox + # brew cask install vagrant - brew cask install gitter + # brew cask install gitter - brew cask install gpg-suite - - brew cask install keybase + # brew cask install gpg-suite # rest client - brew cask install insomnia # kubernetes IDE - brew cask install lens + brew install lens --cask # alacritty dependencies # NOTE: no longer using alacritty. using kitty instead @@ -231,10 +214,8 @@ brew services start postgresql # brew tap mscharley/homebrew # # brew install alacritty - brew cask install macvim - # Powerline fonts! - brew cask install \ + brew install --cask \ font-fira-code \ font-droid-sans-mono-for-powerline \ font-meslo-lg font-input \ @@ -249,28 +230,17 @@ brew services start postgresql font-source-sans-pro \ # quicklook - brew cask install \ - qlcolorcode qlmarkdown qlprettypatch qlstephen \ - qlimagesize \ - quicklook-csv quicklook-json epubquicklook - - brew cask install sharemouse - - # toggl time tracking - brew cask install toggl-beta + brew install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize suspicious-package apparency quicklookase qlvideo + xattr -d -r com.apple.quarantine ~/Library/QuickLook # choosy allows configuring which browser to open a URL in - brew cask install choosy + brew install choosy --cask # kitty gpu accelerated terminal - brew cask install kitty + brew install kitty --cask # keep mac awake - brew cask install caffeine - - brew cask install graphql-playground - - brew cask install keybase + brew install caffeine --cask # }}} @@ -301,17 +271,12 @@ brew services start postgresql brew install kubernetes-helm brew install terraform brew install ngrep - - brew tap drone/drone - brew install drone # --HEAD - brew install awscli # }}} # Low priority {{{ -brew install gource # }}} From 0507a8a99be3972d6c92158c974be2c828aaaf5c Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 2 Mar 2022 15:20:44 -0700 Subject: [PATCH 22/49] Remove mac apps --- .macapps.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.macapps.sh b/.macapps.sh index 85e4e6c..7a98f69 100755 --- a/.macapps.sh +++ b/.macapps.sh @@ -1,15 +1,10 @@ # App store {{{ brew install mas -mas install 918858936 # Airmail 3 -mas install 413857545 # Divvy (1.5) -mas install 414030210 # LimeChat -mas install 443987910 # 1Password - Password Manager and Secure Wallet -mas install 406056744 # Evernote - stay organized -mas install 416581096 # QuickCal -mas install 417602904 # CloudApp: Capture&Share, GIFs, Videos, Screencasts -mas install 497799835 # Xcode -mas install 409183694 # Keynote +# mas install 443987910 # 1Password - Password Manager and Secure Wallet +# mas install 417602904 # CloudApp: Capture&Share, GIFs, Videos, Screencasts +# mas install 497799835 # Xcode +# mas install 409183694 # Keynote mas outdated From 5ef477af9cb11a5e2ffa7efccde4d9769d57a9bb Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Thu, 3 Mar 2022 13:06:47 -0700 Subject: [PATCH 23/49] Update font and apps --- .apps.sh | 15 +++++++++++---- config/kitty/fira.code.conf | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.apps.sh b/.apps.sh index 4b80c78..41fe0a5 100755 --- a/.apps.sh +++ b/.apps.sh @@ -180,6 +180,7 @@ brew services start postgresql brew install docker brew install iterm2 + brew install --cask rectangle # brew cask install divvy # brew cask install spectacle # brew cask install spotify @@ -188,7 +189,7 @@ brew services start postgresql # brew cask install istat-menus # get license from gmail - # brew cask install airfoil + brew --cask install airfoil brew install dash --cask open ~/Dropbox/Licenses/license-dash4.dash-license @@ -214,10 +215,11 @@ brew services start postgresql # brew tap mscharley/homebrew # # brew install alacritty + brew tap homebrew/cask-fonts # Powerline fonts! brew install --cask \ font-fira-code \ - font-droid-sans-mono-for-powerline \ + font-fira-code-nerd-font \ font-meslo-lg font-input \ font-menlo-for-powerline \ font-inconsolata font-inconsolata-for-powerline \ @@ -227,7 +229,7 @@ brew services start postgresql font-pt-mono \ font-raleway font-roboto \ font-source-code-pro font-source-code-pro-for-powerline \ - font-source-sans-pro \ + font-source-sans-pro # quicklook brew install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize suspicious-package apparency quicklookase qlvideo @@ -236,6 +238,8 @@ brew services start postgresql # choosy allows configuring which browser to open a URL in brew install choosy --cask + brew --cask install discord + # kitty gpu accelerated terminal brew install kitty --cask @@ -244,7 +248,10 @@ brew services start postgresql # }}} -# gcloud / kubectl {{{ +# gcloud and kubernetes tools {{{ + + brew install kubectx + brew install kubens # brew cask install google-cloud-sdk # brew cask uninstall google-cloud-sdk diff --git a/config/kitty/fira.code.conf b/config/kitty/fira.code.conf index 3c8a31d..8871a7a 100644 --- a/config/kitty/fira.code.conf +++ b/config/kitty/fira.code.conf @@ -1,5 +1,5 @@ -font_family Fira Code Retina +font_family FiraCode Nerd Font Mono Retina # italic_font Fira Code Italic # bold_font Source Code Pro Bold for Powerline From eedb3b58c9c11f0294b95940b7ac360885dabc1e Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 12 Apr 2022 17:56:32 -0600 Subject: [PATCH 24/49] Add delta for git diffs --- .apps.sh | 20 ++-- .macos.sh | 18 +++- config/kitty/kitty.conf | 8 +- config/nvim/init.vim | 158 +++++++++++++++++++++++++++++--- config/nvim/lua/debugHelper.lua | 50 ++++++++++ gitconfig | 28 +++++- 6 files changed, 246 insertions(+), 36 deletions(-) create mode 100644 config/nvim/lua/debugHelper.lua diff --git a/.apps.sh b/.apps.sh index 41fe0a5..f97776b 100755 --- a/.apps.sh +++ b/.apps.sh @@ -50,6 +50,10 @@ echo "NOTE: Install Dropbox and let it sync before running this" # minio - S3-compatible interface client # https://github.com/minio/mc brew install minio-mc + + # git diff + brew install git-delta + brew install less # }}} # Languages {{{ @@ -76,6 +80,10 @@ echo "NOTE: Install Dropbox and let it sync before running this" brew install golang # }}} +# TypeScript {{{ + yarn global add typescript-language-server +# }}} + # Database {{{ brew install postgres @@ -181,15 +189,13 @@ brew services start postgresql brew install iterm2 brew install --cask rectangle - # brew cask install divvy - # brew cask install spectacle - # brew cask install spotify - # brew cask install alfred + brew install --cask spotify + brew install --cask alfred # brew cask install slack - # brew cask install istat-menus + brew install --cask istat-menus # get license from gmail - brew --cask install airfoil + brew install --cask airfoil brew install dash --cask open ~/Dropbox/Licenses/license-dash4.dash-license @@ -238,7 +244,7 @@ brew services start postgresql # choosy allows configuring which browser to open a URL in brew install choosy --cask - brew --cask install discord + brew install --cask discord # kitty gpu accelerated terminal brew install kitty --cask diff --git a/.macos.sh b/.macos.sh index 805f245..8d268a1 100755 --- a/.macos.sh +++ b/.macos.sh @@ -84,11 +84,19 @@ # Disable press-and-hold for keys in favor of key repeat defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false - # Set a blazingly fast keyboard repeat rate - defaults write NSGlobalDomain KeyRepeat -int 1 - defaults write NSGlobalDomain InitialKeyRepeat -int 10 - defaults write -g KeyRepeat -int 1 - defaults write -g InitialKeyRepeat -int 1 + # normal minimum is 15 (225 ms) + defaults write -g InitialKeyRepeat -int 10 + # normal minimum is 2 (30 ms) + defaults write -g KeyRepeat -int 2 + + # # Set a blazingly fast keyboard repeat rate + # defaults write NSGlobalDomain KeyRepeat -int 10 + # defaults write NSGlobalDomain InitialKeyRepeat -int 10 + # defaults write -g InitialKeyRepeat -int 2 + # defaults write -g KeyRepeat -int 2 + + # defaults write -g KeyRepeat -int 1 + # defaults write -g InitialKeyRepeat -int 1 # Dark UI defaults write NSGlobalDomain AppleInterfaceStyle -string "Dark" diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index aef0225..f7e4e7a 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -25,7 +25,7 @@ include fira.code.conf # solarized dark -include solarized.dark.conf +include solarized.light.conf #: Font size (in pts) font_size 14.0 @@ -779,9 +779,9 @@ map kitty_mod+enter new_window_with_cwd # map kitty_mod+left previous_tab # map kitty_mod+t new_tab map kitty_mod+x close_tab -# map kitty_mod+. move_tab_forward -# map kitty_mod+, move_tab_backward -# map kitty_mod+alt+t set_tab_title +map kitty_mod+. move_tab_forward +map kitty_mod+, move_tab_backward +map kitty_mod+alt+t set_tab_title #: You can also create shortcuts to go to specific tabs, with 1 being #: the first tab, 2 the second tab and -1 being the previously active diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 3cb82ef..65c64d9 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -45,6 +45,15 @@ Plug 'folke/trouble.nvim', { 'branch': 'main' } Plug 'RRethy/vim-illuminate' " highlight words under cursor + " Debug Adapter Protocol + Plug 'mfussenegger/nvim-dap' + Plug 'nvim-telescope/telescope-dap.nvim' + Plug 'theHamsta/nvim-dap-virtual-text' + + " Jest tests + Plug 'David-Kunz/jester' + Plug 'vim-test/vim-test' + " Snippets Plug 'hrsh7th/vim-vsnip' " snippet engine @@ -446,11 +455,35 @@ " Lualine {{{ lua << EOF -require'lualine'.setup{ - options = { theme = 'solarized_light' }, - extensions = {'quickfix', 'nvim-tree'}, - sections = { lualine_c = {'nvim_treesitter#statusline(90)'} } +require('lualine').setup { + options = { + icons_enabled = true, + theme = 'solarized_light', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = {}, + always_divide_middle = true, + }, + sections = { + lualine_a = {'filename'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'mode', 'nvim_treesitter#statusline(90)'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + extensions = {'quickfix', 'nvim-tree'} } + EOF " }}} @@ -622,6 +655,109 @@ nnoremap xl TroubleToggle loclist nnoremap gR TroubleToggle lsp_references " }}} +" DAP {{{ + +lua << EOF + +-- https://github.com/David-Kunz/vim/blob/master/init.lua +local function map(mode, lhs, rhs, opts) + local options = {noremap = true} + if opts then options = vim.tbl_extend('force', options, opts) end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + +-- dap node +local dap = require('dap') +dap.adapters.node2 = { + type = 'executable', + command = 'node', + args = {os.getenv('HOME') .. '/oss/vscode-node-debug2/out/src/nodeDebug.js'}, +} +dap.configurations.javascript = { + { + name = 'Launch', + type = 'node2', + request = 'launch', + program = '${file}', + cwd = vim.fn.getcwd(), + sourceMaps = true, + protocol = 'inspector', + console = 'integratedTerminal', + }, + { + -- For this to work you need to make sure the node process is started with the `--inspect` flag. + name = 'Attach to process', + type = 'node2', + request = 'attach', + processId = require'dap.utils'.pick_process, + }, +} + +dap.defaults.fallback.terminal_win_cmd = '80vsplit new' +vim.fn.sign_define('DapBreakpoint', {text='🟥', texthl='', linehl='', numhl=''}) +vim.fn.sign_define('DapBreakpointRejected', {text='🟦', texthl='', linehl='', numhl=''}) +vim.fn.sign_define('DapStopped', {text='⭐️', texthl='', linehl='', numhl=''}) + +-- _G.shutDownDapSession = function() +-- local dap = require'dap' +-- dap.terminate() +-- dap.disconnect( { terminateDebuggee = true }) +-- dap.close() +-- end + +map('n', 'dh', ':lua require"dap".toggle_breakpoint()') +map('n', 'dH', ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))") +map('n', 'k', ':lua require"dap".step_out()') +map('n', "l", ':lua require"dap".step_into()') +map('n', 'j', ':lua require"dap".step_over()') +map('n', 'h', ':lua require"dap".continue()') +map('n', 'dn', ':lua require"dap".run_to_cursor()') +map('n', 'dk', ':lua require"dap".up()zz') +map('n', 'dj', ':lua require"dap".down()zz') +-- map('n', 'dc', ':lua require"dap".terminate()') +map('n', 'dr', ':lua require"dap".repl.toggle({}, "vsplit")l') +map('n', 'dR', ':lua require"dap".clear_breakpoints()') +map('n', 'de', ':lua require"dap".set_exception_breakpoints({"all"})') +map('n', 'da', ':lua require"debugHelper".attach()') +map('n', 'dA', ':lua require"debugHelper".attachToRemote()') +map('n', 'di', ':lua require"dap.ui.widgets".hover()') +map('n', 'd?', ':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)') + +-- nvim-telescope/telescope-dap.nvim +require('telescope').load_extension('dap') +map('n', 'ds', ':Telescope dap frames') +map('n', 'dc', ':Telescope dap commands') +map('n', 'dv', ':Telescope dap variables') +map('n', 'db', ':Telescope dap list_breakpoints') + +-- nvim-telescope/telescope-file-browser.nvim +-- require('telescope').load_extension('file_browser') +-- theHamsta/nvim-dap-virtual-text and mfussenegger/nvim-dap +require('nvim-dap-virtual-text').setup() +-- g.dap_virtual_text = true + + +-- David-Kunz/jester +map('n', 'tt', ':lua require"jester".run({ path_to_jest = "/opt/homebrew/bin/jest" })') +map('n', 't_', ':lua require"jester".run_last({ path_to_jest = "/opt/homebrew/bin/jest" })') +map('n', 'tf', ':lua require"jester".run_file({ path_to_jest = "/opt/homebrew/bin/jest" })') +-- map('n', 'dd', ':lua require"jester".debug({ path_to_jest = "/opt/homebrew/bin/jest" })') +map('n', 'd_', ':lua require"jester".debug_last({ path_to_jest = "/opt/homebrew/bin/jest" })') +-- map('n', 'df', ':lua require"jester".debug_file({ path_to_jest = "/opt/homebrew/bin/jest" })') +map('n', 'dq', ':lua require"jester".terminate()') + +EOF + +" }}} + +" vim-test {{{ +nmap t :TestNearest +nmap T :TestFile +nmap a :TestSuite +nmap l :TestLast +nmap g :TestVisit +" }}} + " LSP {{{ lua << EOF @@ -652,6 +788,7 @@ local on_attach = function(client, bufnr) vim.cmd("command! LspSignatureHelp lua vim.lsp.buf.signature_help()") buf_map(bufnr, "n", "gd", ":LspDef") buf_map(bufnr, "n", "gr", ":LspRename") + buf_map(bufnr, "n", "gl", ":LspRefs") buf_map(bufnr, "n", "gy", ":LspTypeDef") buf_map(bufnr, "n", "K", ":LspHover") buf_map(bufnr, "n", "[a", ":LspDiagPrev") @@ -951,21 +1088,12 @@ EOF " }}} " Dispatch {{{ - map dr :Dispatch - map dl :execute 'Dispatch ' . getline('.') + " map dr :Dispatch + " map dl :execute 'Dispatch ' . getline('.') " cmap =getline('.') " }}} -" dein mappings & config {{{ - nnoremap du :call dein#update() - nnoremap di :call dein#install() - - " Try this out temporarily - let g:dein#enable_notification = 1 - -" }}} - " Linting {{{ " Enable Neomake on save on expected file types " autocmd! BufWritePost sh,markdown Neomake diff --git a/config/nvim/lua/debugHelper.lua b/config/nvim/lua/debugHelper.lua new file mode 100644 index 0000000..2f3e1ab --- /dev/null +++ b/config/nvim/lua/debugHelper.lua @@ -0,0 +1,50 @@ + +local dap = require('dap') + +local function debugJest(testName, filename) + print("starting " .. testName .. " in " .. filename) + dap.run({ + type = 'node2', + request = 'launch', + cwd = vim.fn.getcwd(), + runtimeArgs = {'--inspect-brk', '/usr/local/bin/jest', '--no-coverage', '-t', testName, '--', filename}, + sourceMaps = true, + protocol = 'inspector', + skipFiles = {'/**/*.js'}, + console = 'integratedTerminal', + port = 9229, + }) +end + +local function attach() + print("attaching") + dap.run({ + type = 'node2', + request = 'attach', + cwd = vim.fn.getcwd(), + sourceMaps = true, + protocol = 'inspector', + skipFiles = {'/**/*.js'}, + }) +end + +local function attachToRemote() + print("attaching") + dap.run({ + type = 'node2', + request = 'attach', + address = "127.0.0.1", + port = 9229, + localRoot = vim.fn.getcwd(), + remoteRoot = "/home/vcap/app", + sourceMaps = true, + protocol = 'inspector', + skipFiles = {'/**/*.js'}, + }) +end + +return { + debugJest = debugJest, + attach = attach, + attachToRemote = attachToRemote, +} diff --git a/gitconfig b/gitconfig index 475c150..2552049 100644 --- a/gitconfig +++ b/gitconfig @@ -1,8 +1,25 @@ -[merge] - tool = opendiff [core] excludesfile = ~/.gitignore_global editor = nvim + pager = delta +[interactive] + diffFilter = delta --color-only --features=interactive +[delta] + features = decorations + navigate = true + syntax-theme = Solarized (light) +[delta "interactive"] + keep-plus-minus-markers = false +[delta "decorations"] + commit-decoration-style = blue ol + commit-style = raw + file-style = omit + hunk-header-decoration-style = blue box + hunk-header-file-style = red + hunk-header-line-number-style = "#067a00" + hunk-header-style = file line-number syntax +[merge] + tool = opendiff [alias] st = status -sb ci = commit @@ -83,13 +100,14 @@ [difftool] prompt = false [push] - default = current + default = current followTags = true [grep] lineNumber = true [github] user = devth [ghi] - token = !security find-internet-password -a devth -s github.com -l 'ghi token' -w + token = !security find-internet-password -a devth -s github.com -l 'ghi token' -w [remote "origin"] - fetch = +refs/pull/*:refs/remotes/origin/pull/* + # enable this if you want to be able to check out pull requests too + # fetch = +refs/pull/*:refs/remotes/origin/pull/* From f6992368edd54155e279226aed389a5972c13fb6 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Sat, 23 Apr 2022 09:08:19 -0600 Subject: [PATCH 25/49] Setup completion --- config/nvim/init.vim | 151 ++++++++++++++++++++++++------------------- 1 file changed, 84 insertions(+), 67 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 65c64d9..586ff87 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -43,7 +43,15 @@ Plug 'jose-elias-alvarez/null-ls.nvim', { 'branch': 'main' } Plug 'jose-elias-alvarez/nvim-lsp-ts-utils', { 'branch': 'main' } Plug 'folke/trouble.nvim', { 'branch': 'main' } - Plug 'RRethy/vim-illuminate' " highlight words under cursor + + " Completion + Plug 'github/copilot.vim', { 'branch': 'release' } + Plug 'hrsh7th/cmp-nvim-lsp' + Plug 'hrsh7th/cmp-buffer' + Plug 'hrsh7th/cmp-path' + Plug 'hrsh7th/cmp-cmdline' + Plug 'hrsh7th/nvim-cmp' + Plug 'hrsh7th/cmp-vsnip' " Debug Adapter Protocol Plug 'mfussenegger/nvim-dap' @@ -54,16 +62,8 @@ Plug 'David-Kunz/jester' Plug 'vim-test/vim-test' - " Snippets - Plug 'hrsh7th/vim-vsnip' " snippet engine - - " Completion - Plug 'nvim-lua/completion-nvim' - Plug 'github/copilot.vim', { 'branch': 'release' } - " Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' } " nvim-cmp - " Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' } " Install the buffer completion source - " Generally usefull stuff + Plug 'RRethy/vim-illuminate' " highlight words under cursor Plug 'tpope/vim-repeat' " Plug 'tpope/vim-rhubarb' " TODO find replacement or re-enable Plug 'tpope/vim-speeddating' " increment stuff @@ -878,73 +878,90 @@ EOF " Completion {{{ " Use and to navigate through popup menu -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" -" Set completeopt to have a better completion experience -set completeopt=menuone,noinsert,noselect +" inoremap pumvisible() ? "\" : "\" +" inoremap pumvisible() ? "\" : "\" + +" " Set completeopt to have a better completion experience +" set completeopt=menuone,noinsert,noselect + +" " Avoid showing message extra message when using completion +" set shortmess+=c -" Avoid showing message extra message when using completion -set shortmess+=c +set completeopt=menu,menuone,noselect lua <'] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, -- For vsnip users. + -- { name = 'luasnip' }, -- For luasnip users. + -- { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, { + { name = 'buffer' }, + }) + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) -vim.g.completion_enable_snippet = 'vim-vsnip' -vim.g.completion_matching_strategy_list = {'exact', 'substring', 'fuzzy'} -vim.g.completion_matching_ignore_case = 1 -vim.g.completion_auto_change_source = 1 - - --- Use (s-)tab to: ---- move to prev/next item in completion menuone ---- jump to prev/next snippet's placeholder -_G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - elseif vim.fn.call("vsnip#available", {1}) == 1 then - return t "(vsnip-expand-or-jump)" - else - return t "" - end -end -_G.s_tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then - return t "(vsnip-jump-prev)" - else - return t "" - end -end + -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline('/', { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) -vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) - --- Chain completion list -vim.g.completion_chain_complete_list = { - default = { - default = {{complete_items = {'lsp', 'snippet', 'buffers'}}, {mode = ''}, {mode = ''}}, - comment = {}, - string = {{complete_items = {'path'}}} + -- Setup lspconfig. + local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) + -- Replace with each lsp server you've enabled. + require('lspconfig')['tsserver'].setup { + capabilities = capabilities } -} - --- use .ts snippets in .tsx files -vim.g.vsnip_filetypes = { - typescriptreact = {"typescript"} -} EOF -let g:completion_chain_complete_list = [ - \{'complete_items': ['lsp', 'snippet']}, - \{'mode': ''}, - \{'mode': ''} -\] - - " }}} " File explorer (nvim-tree) {{{ From fa612cf621523d6b864bfe2b46d4a80721adaae6 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Mon, 25 Apr 2022 11:40:02 -0600 Subject: [PATCH 26/49] Fix lsp config --- config/nvim/init.vim | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 586ff87..96af2f5 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -801,21 +801,25 @@ local on_attach = function(client, bufnr) end end +-- Setup lspconfig. +local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) +-- Replace with each lsp server you've enabled. lspconfig.tsserver.setup({ - flags = { - debounce_text_changes = 500, - }, - on_attach = function(client, bufnr) - client.resolved_capabilities.document_formatting = false - client.resolved_capabilities.document_range_formatting = false - local ts_utils = require("nvim-lsp-ts-utils") - ts_utils.setup({}) - ts_utils.setup_client(client) - buf_map(bufnr, "n", "gs", ":TSLspOrganize") - buf_map(bufnr, "n", "gi", ":TSLspRenameFile") - buf_map(bufnr, "n", "go", ":TSLspImportAll") - on_attach(client, bufnr) - end, + flags = { + debounce_text_changes = 500, + }, + capabilities = capabilities, + on_attach = function(client, bufnr) + client.resolved_capabilities.document_formatting = false + client.resolved_capabilities.document_range_formatting = false + local ts_utils = require("nvim-lsp-ts-utils") + ts_utils.setup({}) + ts_utils.setup_client(client) + buf_map(bufnr, "n", "gs", ":TSLspOrganize") + buf_map(bufnr, "n", "gi", ":TSLspRenameFile") + buf_map(bufnr, "n", "go", ":TSLspImportAll") + on_attach(client, bufnr) + end, }) null_ls.setup({ sources = { @@ -953,12 +957,6 @@ lua < with each lsp server you've enabled. - require('lspconfig')['tsserver'].setup { - capabilities = capabilities - } EOF From 951166e847ea2bcc6380cfde1a5467d1d38e0c25 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 4 May 2022 08:46:43 -0600 Subject: [PATCH 27/49] Allow tsx commenting and setup native sorter for telescope --- .apps.sh | 3 +- config/kitty/kitty.conf | 2 +- config/nvim/init.vim | 95 +++++++++-------------------------------- 3 files changed, 24 insertions(+), 76 deletions(-) diff --git a/.apps.sh b/.apps.sh index f97776b..2c740a9 100755 --- a/.apps.sh +++ b/.apps.sh @@ -27,7 +27,8 @@ echo "NOTE: Install Dropbox and let it sync before running this" # }}} # neovim {{{ - brew install neovim --HEAD || brew reinstall neovim --HEAD + # brew install neovim --HEAD || brew reinstall neovim --HEAD + brew install neovim pip3 install neovim --upgrade pip2 install neovim --upgrade # }}} diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index f7e4e7a..27b60dd 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -25,7 +25,7 @@ include fira.code.conf # solarized dark -include solarized.light.conf +include solarized.dark.conf #: Font size (in pts) font_size 14.0 diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 96af2f5..f707b15 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -141,6 +141,7 @@ Plug 'svermeulen/vim-subversive' " Replace stuff Plug 'tpope/vim-commentary' " commenting + Plug 'JoosepAlviste/nvim-ts-context-commentstring' " tsx support @@ -165,6 +166,8 @@ Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' + " native sorter for telescope + Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } " Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " Plug '/usr/local/opt/fzf' " installed via Homebrew @@ -452,6 +455,16 @@ set fdo-=search " }}} +" comments {{{ +lua << EOF +require'nvim-treesitter.configs'.setup { + context_commentstring = { + enable = true + } +} +EOF +" }}} + " Lualine {{{ lua << EOF @@ -648,8 +661,8 @@ lua << EOF EOF nnoremap xx TroubleToggle -nnoremap xw TroubleToggle lsp_workspace_diagnostics -nnoremap xd TroubleToggle lsp_document_diagnostics +nnoremap xw TroubleToggle workspace_diagnostics +nnoremap xd TroubleToggle document_diagnostics nnoremap xq TroubleToggle quickfix nnoremap xl TroubleToggle loclist nnoremap gR TroubleToggle lsp_references @@ -736,6 +749,8 @@ map('n', 'db', ':Telescope dap list_breakpoints') require('nvim-dap-virtual-text').setup() -- g.dap_virtual_text = true +-- https://github.com/nvim-telescope/telescope-fzf-native.nvim +require('telescope').load_extension('fzf') -- David-Kunz/jester map('n', 'tt', ':lua require"jester".run({ path_to_jest = "/opt/homebrew/bin/jest" })') @@ -796,9 +811,9 @@ local on_attach = function(client, bufnr) buf_map(bufnr, "n", "ga", ":LspCodeAction") buf_map(bufnr, "n", "a", ":LspDiagLine") buf_map(bufnr, "i", "", " LspSignatureHelp") - if client.resolved_capabilities.document_formatting then - vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 5000)") - end + -- if client.resolved_capabilities.document_formatting then + -- vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 5000)") + -- end end -- Setup lspconfig. @@ -967,75 +982,7 @@ EOF lua < Date: Wed, 4 May 2022 10:51:25 -0600 Subject: [PATCH 28/49] Update trouble and other lsp configs --- config/nvim/init.vim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index f707b15..47fdc6f 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -141,8 +141,7 @@ Plug 'svermeulen/vim-subversive' " Replace stuff Plug 'tpope/vim-commentary' " commenting - Plug 'JoosepAlviste/nvim-ts-context-commentstring' " tsx support - + Plug 'JoosepAlviste/nvim-ts-context-commentstring' " embedded language comment support " TODO possibly re-enable this but figure out how to make it not conflict with @@ -811,9 +810,9 @@ local on_attach = function(client, bufnr) buf_map(bufnr, "n", "ga", ":LspCodeAction") buf_map(bufnr, "n", "a", ":LspDiagLine") buf_map(bufnr, "i", "", " LspSignatureHelp") - -- if client.resolved_capabilities.document_formatting then - -- vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 5000)") - -- end + if client.resolved_capabilities.document_formatting then + vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 5000)") + end end -- Setup lspconfig. From 7f38f3b9347a8cfa909e662ad045f9869608c964 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Mon, 23 May 2022 08:52:06 -0600 Subject: [PATCH 29/49] Use solarized high contrast --- config/kitty/kitty.conf | 2 +- config/kitty/solarized.dark.highcontrast.conf | 21 +++++++++++++++++++ config/nvim/init.vim | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 config/kitty/solarized.dark.highcontrast.conf diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 27b60dd..25d0f10 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -25,7 +25,7 @@ include fira.code.conf # solarized dark -include solarized.dark.conf +include solarized.dark.highcontrast.conf #: Font size (in pts) font_size 14.0 diff --git a/config/kitty/solarized.dark.highcontrast.conf b/config/kitty/solarized.dark.highcontrast.conf new file mode 100644 index 0000000..8477ea1 --- /dev/null +++ b/config/kitty/solarized.dark.highcontrast.conf @@ -0,0 +1,21 @@ +background #001e26 +foreground #9bc1c2 +cursor #f34a00 +selection_background #003747 +color0 #002731 +color8 #006388 +color1 #d01b24 +color9 #f4153b +color2 #6bbe6c +color10 #50ee84 +color3 #a57705 +color11 #b17e28 +color4 #2075c7 +color12 #178dc7 +color5 #c61b6e +color13 #e14d8e +color6 #259185 +color14 #00b29e +color7 #e9e2cb +color15 #fcf4dc +selection_foreground #001e26 diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 47fdc6f..fa10e90 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -389,6 +389,7 @@ " NeoVim Terminal Mode tnoremap + tnoremap kj highlight TermCursor ctermfg=red guifg=red " tbone replacement using neoterm plugin From 00397dfe37b6ce857f2c6ef8e8b364a6db9853c8 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Mon, 23 May 2022 08:52:36 -0600 Subject: [PATCH 30/49] Use eslint_d --- config/nvim/init.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index fa10e90..10f9556 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -838,8 +838,8 @@ lspconfig.tsserver.setup({ }) null_ls.setup({ sources = { - null_ls.builtins.diagnostics.eslint, - null_ls.builtins.code_actions.eslint, + null_ls.builtins.diagnostics.eslint_d, + null_ls.builtins.code_actions.eslint_d, null_ls.builtins.formatting.prettier, }, on_attach = on_attach, From f9bc3daaa92a84a404bf4bd77464473b5599464f Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 22 Jun 2022 13:20:53 -0600 Subject: [PATCH 31/49] Switch colorschemes again --- config/kitty/kitty.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 25d0f10..27b60dd 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -25,7 +25,7 @@ include fira.code.conf # solarized dark -include solarized.dark.highcontrast.conf +include solarized.dark.conf #: Font size (in pts) font_size 14.0 From 02f7f71b9c9d914ebe84995cf5eb0b88a53586e2 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Thu, 23 Jun 2022 10:17:46 -0600 Subject: [PATCH 32/49] Use jj for esc --- config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 10f9556..2d13d2f 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -225,7 +225,7 @@ set undolevels=1000 set nocursorline nocursorcolumn " vim is slow with these on :/ - imap kj + imap jj " don't auto resize window on splitting " set noequalalways From 11717e27af3e1e1683e9eb8203e2db1499d57437 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Sat, 25 Jun 2022 09:40:08 -0600 Subject: [PATCH 33/49] Add vim-vsnip --- config/nvim/init.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 2d13d2f..2d7f787 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -51,6 +51,7 @@ Plug 'hrsh7th/cmp-path' Plug 'hrsh7th/cmp-cmdline' Plug 'hrsh7th/nvim-cmp' + Plug 'hrsh7th/vim-vsnip' Plug 'hrsh7th/cmp-vsnip' " Debug Adapter Protocol From 311b30c61f0174b99c9d33d63ab2b49ba1360fc0 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 24 Aug 2022 08:07:38 -0600 Subject: [PATCH 34/49] Add colorizer and nvim treesitter context --- config/nvim/init.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 2d7f787..8f9cd50 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -72,6 +72,7 @@ " Plug 'tpope/vim-tbone' Plug 'tpope/vim-unimpaired' " bracket mappings " Plug 'tpope/vim-obsession' + Plug 'norcalli/nvim-colorizer.lua' " Colors - some plugins rely on this " Plug 'devth/vim-colors-solarized' " Note: devth-fork @@ -81,6 +82,8 @@ " Use TreeSitter for language highlighting instead Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + Plug 'nvim-treesitter/nvim-treesitter-context' + " General Syntax - these shouldn't slow things down " Plug 'tpope/vim-markdown', {'for': 'markdown'} @@ -226,6 +229,7 @@ set undolevels=1000 set nocursorline nocursorcolumn " vim is slow with these on :/ + set termguicolors imap jj " don't auto resize window on splitting @@ -502,9 +506,11 @@ EOF " }}} - " Aesthetics {{{ + " https://github.com/norcalli/nvim-colorizer.lua + lua require'colorizer'.setup() + let g:neosolarized_vertSplitBgTrans = 1 " This must be defined before activating colorscheme From 23f44bee7376a89a93114a642c87e312e11cbe60 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 24 Aug 2022 08:07:57 -0600 Subject: [PATCH 35/49] Config xmap subversive subst --- config/nvim/init.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 8f9cd50..b890737 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -629,6 +629,11 @@ EOF nmap s (SubversiveSubstitute) nmap ss (SubversiveSubstituteLine) nmap S (SubversiveSubstituteToEndOfLine) + + " https://github.com/svermeulen/vim-subversive + xmap s (SubversiveSubstitute) + xmap p (SubversiveSubstitute) + xmap P (SubversiveSubstitute) " }}} " TreeSitter {{{ From 461029ee6cd0cfb453bbfea3d3e73d5cd273eb7b Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 4 Jan 2023 07:36:40 -0700 Subject: [PATCH 36/49] Update lsp --- config/nvim/init.vim | 131 +++++++++++++++++++++++++------------------ 1 file changed, 75 insertions(+), 56 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index b890737..1dd1839 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -794,7 +794,6 @@ lua << EOF -- updated 1/15/2022 local lspconfig = require("lspconfig") -local null_ls = require("null-ls") local buf_map = function(bufnr, mode, lhs, rhs, opts) vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts or { silent = true, @@ -802,7 +801,7 @@ local buf_map = function(bufnr, mode, lhs, rhs, opts) end local on_attach = function(client, bufnr) vim.cmd("command! LspDef lua vim.lsp.buf.definition()") - vim.cmd("command! LspFormatting lua vim.lsp.buf.formatting()") + vim.cmd("command! LspFormatting lua vim.lsp.buf.format { timeout_ms = 5000 }") vim.cmd("command! LspCodeAction lua vim.lsp.buf.code_action()") vim.cmd("command! LspHover lua vim.lsp.buf.hover()") vim.cmd("command! LspRename lua vim.lsp.buf.rename()") @@ -821,15 +820,30 @@ local on_attach = function(client, bufnr) buf_map(bufnr, "n", "[a", ":LspDiagPrev") buf_map(bufnr, "n", "]a", ":LspDiagNext") buf_map(bufnr, "n", "ga", ":LspCodeAction") + buf_map(bufnr, "n", "fo", ":LspFormatting") buf_map(bufnr, "n", "a", ":LspDiagLine") buf_map(bufnr, "i", "", " LspSignatureHelp") - if client.resolved_capabilities.document_formatting then - vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync(nil, 5000)") + if client.server_capabilities.documentFormattingProvider then + -- this is super slow, so format manually instead + -- vim.cmd("autocmd BufWritePre lua vim.lsp.buf.format { timeout_ms = 5000 }") end + + -- if client.server_capabilities.documentFormattingProvider then - + -- vim.cmd( + -- [[ + -- augroup LspFormatting + -- autocmd! * + -- autocmd BufWritePre lua vim.lsp.buf.format() + -- augroup END + -- ]] + -- ) + -- end + + end -- Setup lspconfig. -local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) +local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Replace with each lsp server you've enabled. lspconfig.tsserver.setup({ flags = { @@ -837,8 +851,8 @@ lspconfig.tsserver.setup({ }, capabilities = capabilities, on_attach = function(client, bufnr) - client.resolved_capabilities.document_formatting = false - client.resolved_capabilities.document_range_formatting = false + client.server_capabilities.document_formatting = false + client.server_capabilities.document_range_formatting = false local ts_utils = require("nvim-lsp-ts-utils") ts_utils.setup({}) ts_utils.setup_client(client) @@ -848,47 +862,52 @@ lspconfig.tsserver.setup({ on_attach(client, bufnr) end, }) + +local null_ls = require("null-ls") null_ls.setup({ sources = { - null_ls.builtins.diagnostics.eslint_d, - null_ls.builtins.code_actions.eslint_d, - null_ls.builtins.formatting.prettier, + null_ls.builtins.diagnostics.eslint, + -- this is faster but it seems broken with latest eslint /shrug + -- null_ls.builtins.diagnostics.eslint_d, + null_ls.builtins.code_actions.eslint, + null_ls.builtins.formatting.prettierd, + -- try using eslint for formatting instead of prettier + -- null_ls.builtins.formatting.eslint_d, }, on_attach = on_attach, }) -- -local filetypes = { - typescript = "eslint", - typescriptreact = "eslint", -} -local linters = { - eslint = { - sourceName = "eslint", - command = "eslint_d", - rootPatterns = {".eslintrc.js", "package.json"}, - debounce = 500, - args = {"--stdin", "--stdin-filename", "%filepath", "--format", "json"}, - parseJson = { - errorsRoot = "[0].messages", - line = "line", - column = "column", - endLine = "endLine", - endColumn = "endColumn", - message = "${message} [${ruleId}]", - security = "severity" - }, - securities = {[2] = "error", [1] = "warning"} - } -} -local formatters = { - prettier = {command = "eslint_d", args = {"--fix-to-stdout", "--stdin", "--stdin-filename", "%filepath"}} -} -local formatFiletypes = { - typescript = "prettier", - typescriptreact = "prettier" -} - +-- local filetypes = { +-- typescript = "eslint", +-- typescriptreact = "eslint", +-- } +-- local linters = { +-- eslint = { +-- sourceName = "eslint", +-- command = "eslint_d", +-- rootPatterns = {".eslintrc.js", "package.json"}, +-- debounce = 500, +-- args = {"--stdin", "--stdin-filename", "%filepath", "--format", "json"}, +-- parseJson = { +-- errorsRoot = "[0].messages", +-- line = "line", +-- column = "column", +-- endLine = "endLine", +-- endColumn = "endColumn", +-- message = "${message} [${ruleId}]", +-- security = "severity" +-- }, +-- securities = {[2] = "error", [1] = "warning"} +-- } +-- } +-- local formatters = { +-- prettier = {command = "eslint_d", args = {"--fix-to-stdout", "--stdin", "--stdin-filename", "%filepath"}} +-- } +-- local formatFiletypes = { +-- typescript = "prettier", +-- typescriptreact = "prettier" +-- } -- nvim_lsp.diagnosticls.setup { -- on_attach = on_attach, -- filetypes = vim.tbl_keys(filetypes), @@ -1076,20 +1095,20 @@ EOF " let g:neomake_warning_sign = {'text': '⚠', 'texthl': 'NeomakeWarningSign'} " let g:neomake_error_sign = {'text': '•', 'texthl': 'NeomakeErrorSign'} - let g:ale_sign_error = '⚠' - let g:ale_sign_warning = '•' - " Disabling trailing whitespace warnings doesn't affect Markdown because - " markdownlint checks that too - let g:ale_warn_about_trailing_whitespace = 0 - let g:ale_lint_delay = 1000 - - let g:ale_fixers = { - \ 'javascript': ['prettier', 'eslint'], - \ 'typescript': ['prettier'], - \ 'css': ['prettier'], - \} + " let g:ale_sign_error = '⚠' + " let g:ale_sign_warning = '•' + " " Disabling trailing whitespace warnings doesn't affect Markdown because + " " markdownlint checks that too + " let g:ale_warn_about_trailing_whitespace = 0 + " let g:ale_lint_delay = 1000 + + " let g:ale_fixers = { + " \ 'javascript': ['prettier', 'eslint'], + " \ 'typescript': ['prettier'], + " \ 'css': ['prettier'], + " \} - let g:ale_fix_on_save = 1 + " let g:ale_fix_on_save = 1 " let b:ale_fixers = {} " let b:ale_fixers['javascript'] = ['prettier'] @@ -1098,8 +1117,8 @@ EOF " let g:ale_fixers['*'] = ['remove_trailing_lines', 'trim_whitespace'] " Prettier - let g:prettier#config#parser = 'babylon' - let g:ale_javascript_prettier_use_local_config = 1 + " let g:prettier#config#parser = 'babylon' + " let g:ale_javascript_prettier_use_local_config = 1 nnoremap af :ALEFix From 6ac708f2e51e5349e4ade9404fdbed6b534ba550 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 4 Jan 2023 07:37:33 -0700 Subject: [PATCH 37/49] Update lsp configs for latest --- config/nvim/init.vim | 79 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 1dd1839..f01b51d 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -43,6 +43,8 @@ Plug 'jose-elias-alvarez/null-ls.nvim', { 'branch': 'main' } Plug 'jose-elias-alvarez/nvim-lsp-ts-utils', { 'branch': 'main' } Plug 'folke/trouble.nvim', { 'branch': 'main' } + " Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' } + " Plug 'ray-x/navigator.lua' " Completion Plug 'github/copilot.vim', { 'branch': 'release' } @@ -143,6 +145,9 @@ Plug 'kassio/neoterm' " Terminal utils " Plug 'vim-scripts/regreplop.vim' " replace! + " Mermaid diagrams / live markdown preview + Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } + Plug 'svermeulen/vim-subversive' " Replace stuff Plug 'tpope/vim-commentary' " commenting Plug 'JoosepAlviste/nvim-ts-context-commentstring' " embedded language comment support @@ -154,7 +159,7 @@ " Plug 'vim-scripts/YankRing.vim' " (SLOW) Keep track of past yanked values Plug 'svermeulen/vim-yoink' " Plug 'vim-scripts/tComment' " Comment stuff - " Plug 'junegunn/goyo.vim' " Writing mode + Plug 'junegunn/goyo.vim' " Writing mode " Plug 'preservim/tagbar' " ctags! " Plug 'lvht/tagbar-markdown' " tagbar for md files " Plug 'liuchengxu/vista.vim' @@ -166,7 +171,7 @@ " Plug 'chr4/sslsecure.vim' " Highlight insecure SSL configuration " Fuzzy file finder - Plug 'nvim-lua/popup.nvim' + " Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' " native sorter for telescope @@ -459,6 +464,68 @@ " (might want to be able to toggle this) set fdo-=search " }}} +" + +" yaml treesitter {{{ +lua << EOF +require("treesitter-context").setup({ + enable = true, + throttle = true, + max_lines = 0, + patterns = { + default = { + "class", + "function", + "method", + "for", + "while", + "if", + "else", + "switch", + "case", + }, + rust = { + "impl_item", + "mod_item", + "enum_item", + "match", + "struct", + "loop", + "closure", + "async_block", + "block", + }, + python = { + "elif", + "with", + "try", + "except", + }, + json = { + "object", + "pair", + }, + javascript = { + "object", + "pair", + }, + yaml = { + "block_mapping_pair", + "block_sequence_item", + }, + toml = { + "table", + "pair", + }, + markdown = { + "section", + }, + }, +}) + +EOF +" }}} + " comments {{{ lua << EOF @@ -789,6 +856,9 @@ nmap g :TestVisit lua << EOF +-- https://github.com/ray-x/navigator.lua +-- require'navigator'.setup() + -- from https://jose-elias-alvarez.medium.com/configuring-neovims-lsp-client-for-typescript-development-5789d58ea9c -- updated 1/15/2022 @@ -845,6 +915,9 @@ end -- Setup lspconfig. local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Replace with each lsp server you've enabled. + +lspconfig.gopls.setup{} + lspconfig.tsserver.setup({ flags = { debounce_text_changes = 500, @@ -1308,6 +1381,8 @@ EOF \ 'midje.sweet/facts': '[[:inner 1]]', \ } + " let g:iced_enable_auto_document = 'normal' + " Replicate vim-fireplace mappings for vim-iced autocmd FileType clojure nmap cqp :IcedEval autocmd FileType clojure nmap cpr :IcedRequireAll From 3534a480633fc917fbdb0f6e416cf475a02665d4 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Wed, 4 Jan 2023 07:40:40 -0700 Subject: [PATCH 38/49] Use jj to escape term too --- config/nvim/init.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index f01b51d..fd54497 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -399,7 +399,7 @@ " NeoVim Terminal Mode tnoremap - tnoremap kj + tnoremap jj highlight TermCursor ctermfg=red guifg=red " tbone replacement using neoterm plugin From b476a75123f2a524a7f1040f06c4d89c69dfb6a5 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 24 Feb 2023 08:48:25 -0700 Subject: [PATCH 39/49] Adjust apps installs --- .apps.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.apps.sh b/.apps.sh index 2c740a9..cc58c9f 100755 --- a/.apps.sh +++ b/.apps.sh @@ -162,8 +162,8 @@ brew services start postgresql brew install rcm # required by vim tiagofumo/vim-nerdtree-syntax-highlight plugin - brew tap caskroom/fonts - brew cask install font-hack-nerd-font + brew tap homebrew/cask-fonts + brew install --cask font-hack-nerd-font # brew tap unisonweb/unison # brew install unison-language @@ -188,11 +188,13 @@ brew services start postgresql # brew install docker-machine brew install docker brew install iterm2 + # kitty gpu accelerated terminal + brew install kitty --cask brew install --cask rectangle brew install --cask spotify brew install --cask alfred - # brew cask install slack + brew install --cask slack brew install --cask istat-menus # get license from gmail @@ -246,10 +248,6 @@ brew services start postgresql brew install choosy --cask brew install --cask discord - - # kitty gpu accelerated terminal - brew install kitty --cask - # keep mac awake brew install caffeine --cask From 1ac8e39433ffec4a62642ff63bd7a3fb9c025ef0 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 21 Mar 2023 20:48:49 -0600 Subject: [PATCH 40/49] Use new airline style --- .nodejs.sh | 4 +-- config/kitty/kitty.conf | 3 ++- config/kitty/solarized.light.conf | 17 +++++++++++++ config/nvim/init.vim | 42 +++++++++++++++++++++---------- 4 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 config/kitty/solarized.light.conf diff --git a/.nodejs.sh b/.nodejs.sh index ed6b741..82ef5e1 100755 --- a/.nodejs.sh +++ b/.nodejs.sh @@ -1,4 +1,4 @@ npm install -g doctoc - -npm install --global alfred-fkill +npm install -g alfred-fkill +npm install -g @fsouza/prettierd diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 27b60dd..28e6ed1 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -24,8 +24,9 @@ include fira.code.conf -# solarized dark +# solarized themes include solarized.dark.conf +# include solarized.light.conf #: Font size (in pts) font_size 14.0 diff --git a/config/kitty/solarized.light.conf b/config/kitty/solarized.light.conf new file mode 100644 index 0000000..424e8cd --- /dev/null +++ b/config/kitty/solarized.light.conf @@ -0,0 +1,17 @@ +# Light + +background #fdf6e3 +foreground #657b83 +cursor #586e75 +selection_background #93a1a1 + +color8 #002b36 +color9 #cb4b16 +color10 #586e75 +color11 #657b83 +color12 #839496 +color13 #6c71c4 +color14 #93a1a1 +color15 #fdf6e3 + +selection_foreground #586e75 diff --git a/config/nvim/init.vim b/config/nvim/init.vim index fd54497..f1b35ce 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -43,6 +43,7 @@ Plug 'jose-elias-alvarez/null-ls.nvim', { 'branch': 'main' } Plug 'jose-elias-alvarez/nvim-lsp-ts-utils', { 'branch': 'main' } Plug 'folke/trouble.nvim', { 'branch': 'main' } + Plug 'ray-x/lsp_signature.nvim' " Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' } " Plug 'ray-x/navigator.lua' @@ -540,12 +541,23 @@ EOF " Lualine {{{ lua << EOF + + require('lualine').setup { options = { icons_enabled = true, - theme = 'solarized_light', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, + theme = 'auto', + -- angles (default) + -- component_separators = { left = '', right = ''}, + -- section_separators = { left = '', right = ''}, + + -- bubbles + -- section_separators = { left = '', right = '' }, + -- component_separators = { left = '', right = '' }, + + -- slants + component_separators = '', + section_separators = { left = '', right = '' }, disabled_filetypes = {}, always_divide_middle = true, }, @@ -664,7 +676,7 @@ EOF nnoremap bgd :set bg=dark " controls vertical split pipe, end of buffer - set fillchars=fold:\ ,vert:\│,eob:\.,msgsep:‾ + set fillchars=fold:\ ,vert:\│,eob:\ ,msgsep:‾ " Goyo {{{ let g:goyo_height = "100%" @@ -713,14 +725,14 @@ require'nvim-treesitter.configs'.setup { } local parser_config = require'nvim-treesitter.parsers'.get_parser_configs() -parser_config.gotmpl = { - install_info = { - url = "https://github.com/ngalaiko/tree-sitter-go-template", - files = {"src/parser.c"} - }, - filetype = "gotmpl", - used_by = {"gohtmltmpl", "gotexttmpl", "gotmpl", "yaml"} -} +-- parser_config.gotmpl = { +-- install_info = { +-- url = "https://github.com/ngalaiko/tree-sitter-go-template", +-- files = {"src/parser.c"} +-- }, +-- filetype = "gotmpl", +-- used_by = {"gohtmltmpl", "gotexttmpl", "gotmpl", "yaml"} +-- } EOF @@ -856,6 +868,9 @@ nmap g :TestVisit lua << EOF +local cfg = {} +require "lsp_signature".setup(cfg) + -- https://github.com/ray-x/navigator.lua -- require'navigator'.setup() @@ -916,7 +931,8 @@ end local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Replace with each lsp server you've enabled. -lspconfig.gopls.setup{} +-- TODO only load this when needed +-- lspconfig.gopls.setup{} lspconfig.tsserver.setup({ flags = { From 7bfe32622724c249bc3a7c442b917af0ebe150e6 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 18 Apr 2023 06:52:59 -0600 Subject: [PATCH 41/49] Configure more telescope plugins --- .apps.sh | 8 ++++++-- config/nvim/ftdetect/gotmpl.vim | 3 ++- config/nvim/init.vim | 23 ++++++++++++++++++----- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.apps.sh b/.apps.sh index cc58c9f..71abdb4 100755 --- a/.apps.sh +++ b/.apps.sh @@ -281,14 +281,18 @@ brew services start postgresql # Cloud tools {{{ brew install kubernetes-helm - brew install terraform + # brew install terraform + # brew install awscli brew install ngrep - brew install awscli # }}} # Low priority {{{ +# for image previews in vim + + brew install chafa + brew install imagemagick # }}} diff --git a/config/nvim/ftdetect/gotmpl.vim b/config/nvim/ftdetect/gotmpl.vim index 694ef03..bc7551a 100644 --- a/config/nvim/ftdetect/gotmpl.vim +++ b/config/nvim/ftdetect/gotmpl.vim @@ -1,3 +1,4 @@ +" Disable this for now, it's not working well " https://github.com/ngalaiko/tree-sitter-go-template -autocmd BufNewFile,BufRead * if search('{{.\+}}', 'nw') | setlocal filetype=gotmpl | endif +" autocmd BufNewFile,BufRead * if search('{{.\+}}', 'nw') | setlocal filetype=gotmpl | endif diff --git a/config/nvim/init.vim b/config/nvim/init.vim index f1b35ce..9f6b21d 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -99,7 +99,8 @@ " Plug 'jparise/vim-graphql', {'for': 'graphql'} Plug 'delphinus/vim-firestore' " firestore highlighting " Plug 'pangloss/vim-javascript', {'for': 'javascript'} - Plug 'hashivim/vim-terraform' + " Plug 'hashivim/vim-terraform' + Plug 'MichaHoffmann/tree-sitter-hcl' Plug 'unisonweb/unison', { 'branch': 'trunk', 'rtp': 'editor-support/vim' } Plug 'mattn/emmet-vim' " expanding abbreviations (HTML mostly) @@ -172,9 +173,13 @@ " Plug 'chr4/sslsecure.vim' " Highlight insecure SSL configuration " Fuzzy file finder - " Plug 'nvim-lua/popup.nvim' + Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' + Plug 'nvim-telescope/telescope-github.nvim' + Plug 'nvim-telescope/telescope-media-files.nvim' + Plug 'aaronhallaert/advanced-git-search.nvim' + " native sorter for telescope Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } " Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } @@ -843,6 +848,13 @@ require('nvim-dap-virtual-text').setup() -- https://github.com/nvim-telescope/telescope-fzf-native.nvim require('telescope').load_extension('fzf') +-- https://github.com/nvim-telescope/telescope-media-files.nvim +require('telescope').load_extension('media_files') + +-- https://github.com/aaronhallaert/advanced-git-search.nvim#%EF%B8%8F-installation +require("telescope").load_extension("advanced_git_search") + + -- David-Kunz/jester map('n', 'tt', ':lua require"jester".run({ path_to_jest = "/opt/homebrew/bin/jest" })') map('n', 't_', ':lua require"jester".run_last({ path_to_jest = "/opt/homebrew/bin/jest" })') @@ -955,10 +967,11 @@ lspconfig.tsserver.setup({ local null_ls = require("null-ls") null_ls.setup({ sources = { - null_ls.builtins.diagnostics.eslint, + -- null_ls.builtins.diagnostics.eslint, -- this is faster but it seems broken with latest eslint /shrug - -- null_ls.builtins.diagnostics.eslint_d, - null_ls.builtins.code_actions.eslint, + null_ls.builtins.diagnostics.eslint_d, + -- null_ls.builtins.code_actions.eslint, + null_ls.builtins.code_actions.eslint_d, null_ls.builtins.formatting.prettierd, -- try using eslint for formatting instead of prettier -- null_ls.builtins.formatting.eslint_d, From bb2154bd2877e7c66db8eff10beee3ec9c234179 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 20 Jun 2023 10:15:50 -0600 Subject: [PATCH 42/49] Update kitty and git configs --- config/kitty/kitty.conf | 5 +++-- config/nvim/init.vim | 19 +++++++++++++++++-- gitconfig | 4 ++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 28e6ed1..6385cd1 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -294,7 +294,7 @@ draw_minimal_borders yes #: that setting a non-zero window margin overrides this and causes all #: borders to be drawn. -window_margin_width 0.0 +window_margin_width 1.0 #: The window margin (in pts) (blank area outside the border) @@ -309,12 +309,13 @@ window_padding_width 0.0 #: The window padding (in pts) (blank area between the text and the #: window border) -active_border_color #073642 +active_border_color #55757e #: The color for the border of the active window # solarized dark blue to blend in / dissapear inactive_border_color #002B36 +# inactive_border_color #074c5a #: The color for the border of inactive windows diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 9f6b21d..66ef877 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -284,6 +284,7 @@ set expandtab set backspace=start,indent set textwidth=80 + set linebreak set wrapmargin=1 " prevent double spaces when joining with C-j set nojoinspaces @@ -727,9 +728,15 @@ require'nvim-treesitter.configs'.setup { highlight = { enable = true }, + ensure_installed = { "html", "markdown", "typescript", "clojure", "yaml", "help", "lua" }, + } +<<<<<<< Updated upstream local parser_config = require'nvim-treesitter.parsers'.get_parser_configs() +======= +-- local parser_config = require'nvim-treesitter.parsers'.get_parser_configs() +>>>>>>> Stashed changes -- parser_config.gotmpl = { -- install_info = { -- url = "https://github.com/ngalaiko/tree-sitter-go-template", @@ -943,8 +950,16 @@ end local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Replace with each lsp server you've enabled. +<<<<<<< Updated upstream -- TODO only load this when needed -- lspconfig.gopls.setup{} +======= +-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/pylsp.lua +-- lspconfig.pylsp.setup{} +lspconfig.pyright.setup{} + +lspconfig.gopls.setup{} +>>>>>>> Stashed changes lspconfig.tsserver.setup({ flags = { @@ -1430,9 +1445,9 @@ EOF autocmd FileType clojure nmap am :IcedAddMissing " vim-sexp - let g:sexp_enable_insert_mode_mappings = 1 + " let g:sexp_enable_insert_mode_mappings = 0 " Disable all sexp mappings - " let g:sexp_filetypes = '' + let g:sexp_filetypes = '' " acid.nvim " autocmd FileType clojure nmap cpr :AcidRequire diff --git a/gitconfig b/gitconfig index 2552049..eebecd8 100644 --- a/gitconfig +++ b/gitconfig @@ -111,3 +111,7 @@ [remote "origin"] # enable this if you want to be able to check out pull requests too # fetch = +refs/pull/*:refs/remotes/origin/pull/* +[pull] + rebase = true +[rebase] + autoStash = true From 129c8de07331dbc1ab9f7a5b154703dd9649611c Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 20 Jun 2023 10:16:38 -0600 Subject: [PATCH 43/49] Add more treesitter configs --- .apps.sh | 2 +- config/nvim/init.vim | 227 +++++++++++++++++++++++++++++++++---------- gitconfig | 2 + 3 files changed, 180 insertions(+), 51 deletions(-) diff --git a/.apps.sh b/.apps.sh index 71abdb4..8b9da56 100755 --- a/.apps.sh +++ b/.apps.sh @@ -258,7 +258,7 @@ brew services start postgresql brew install kubectx brew install kubens - # brew cask install google-cloud-sdk + brew install --cask google-cloud-sdk # brew cask uninstall google-cloud-sdk # curl https://sdk.cloud.google.com | bash diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 66ef877..a88975f 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -86,6 +86,8 @@ " Use TreeSitter for language highlighting instead Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/nvim-treesitter-context' + Plug 'nvim-treesitter/nvim-treesitter-textobjects' + Plug 'HiPhish/nvim-ts-rainbow2' " General Syntax - these shouldn't slow things down @@ -184,11 +186,13 @@ Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } " Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " Plug '/usr/local/opt/fzf' " installed via Homebrew - " Plug 'junegunn/fzf.vim' " if you want latest fzf use this instead " Plug 'junegunn/fzf', { 'do': './install --all' } " Plug 'junegunn/fzf', { 'do': './install --bin' } " Plug 'junegunn/fzf.vim' + Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } + Plug 'junegunn/fzf.vim' + " Use actual tmux instead " Plug 'Vigemus/nvimux' " Tmux-like key bindings for NeoVim @@ -475,6 +479,8 @@ " yaml treesitter {{{ lua << EOF + + require("treesitter-context").setup({ enable = true, throttle = true, @@ -534,16 +540,6 @@ EOF " }}} -" comments {{{ -lua << EOF -require'nvim-treesitter.configs'.setup { - context_commentstring = { - enable = true - } -} -EOF -" }}} - " Lualine {{{ lua << EOF @@ -725,18 +721,129 @@ EOF lua <') or a table + -- mapping query_strings to modes. + selection_modes = { + ['@parameter.outer'] = 'v', -- charwise + ['@function.outer'] = 'V', -- linewise + ['@class.outer'] = '', -- blockwise + }, + -- If you set this to `true` (default is `false`) then any textobject is + -- extended to include preceding or succeeding whitespace. Succeeding + -- whitespace has priority in order to act similarly to eg the built-in + -- `ap`. + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * selection_mode: eg 'v' + -- and should return true of false + include_surrounding_whitespace = true, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = { query = "@class.outer", desc = "Next class start" }, + -- + -- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queires. + ["]o"] = "@loop.*", + -- ["]o"] = { query = { "@loop.inner", "@loop.outer" } } + -- + -- You can pass a query group to use query from `queries//.scm file in your runtime path. + -- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. + ["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" }, + ["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + -- Below will go to either the start or the end, whichever is closer. + -- Use if you want more granular movements + -- Make it even more gradual by adding multiple queries and regex. + goto_next = { + ["]d"] = "@conditional.outer", + }, + goto_previous = { + ["[d"] = "@conditional.outer", + } + }, + lsp_interop = { + enable = true, + border = 'none', + floating_preview_opts = {}, + peek_definition_code = { + ["df"] = "@function.outer", + ["dF"] = "@class.outer", + }, + }, + }, + rainbow = { + enable = true, + -- list of languages you want to disable the plugin for + disable = {}, + -- Which query to use for finding delimiters + query = 'rainbow-parens', + -- Highlight the entire buffer all at once + strategy = require('ts-rainbow').strategy.global, + }, } -<<<<<<< Updated upstream +-- https://github.com/nvim-treesitter/nvim-treesitter-textobjects +local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move" +-- Repeat movement with ; and , +-- ensure ; goes forward and , goes backward regardless of the last direction +vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next) +vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous) +-- vim way: ; goes to the direction you were moving. +-- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move) +-- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite) +-- Optionally, make builtin f, F, t, T also repeatable with ; and , +vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f) +vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F) +vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t) +vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T) + local parser_config = require'nvim-treesitter.parsers'.get_parser_configs() -======= --- local parser_config = require'nvim-treesitter.parsers'.get_parser_configs() ->>>>>>> Stashed changes + -- parser_config.gotmpl = { -- install_info = { -- url = "https://github.com/ngalaiko/tree-sitter-go-template", @@ -750,6 +857,7 @@ EOF set foldmethod=expr set foldexpr=nvim_treesitter#foldexpr() +set foldlevel=20 " }}} @@ -927,39 +1035,32 @@ local on_attach = function(client, bufnr) buf_map(bufnr, "n", "fo", ":LspFormatting") buf_map(bufnr, "n", "a", ":LspDiagLine") buf_map(bufnr, "i", "", " LspSignatureHelp") - if client.server_capabilities.documentFormattingProvider then - -- this is super slow, so format manually instead - -- vim.cmd("autocmd BufWritePre lua vim.lsp.buf.format { timeout_ms = 5000 }") - end - - -- if client.server_capabilities.documentFormattingProvider then - - -- vim.cmd( - -- [[ - -- augroup LspFormatting - -- autocmd! * - -- autocmd BufWritePre lua vim.lsp.buf.format() - -- augroup END - -- ]] - -- ) - -- end + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead + -- on later neovim version, you should use vim.lsp.buf.format({ async = false }) instead + -- this can be super slow - consider formatting manually instead + -- vim.lsp.buf.formatting_sync() + vim.lsp.buf.format({ async = false }) + end, + }) + end end -- Setup lspconfig. local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Replace with each lsp server you've enabled. - -<<<<<<< Updated upstream --- TODO only load this when needed --- lspconfig.gopls.setup{} -======= -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/pylsp.lua -- lspconfig.pylsp.setup{} lspconfig.pyright.setup{} lspconfig.gopls.setup{} ->>>>>>> Stashed changes lspconfig.tsserver.setup({ flags = { @@ -981,18 +1082,33 @@ lspconfig.tsserver.setup({ local null_ls = require("null-ls") null_ls.setup({ - sources = { - -- null_ls.builtins.diagnostics.eslint, - -- this is faster but it seems broken with latest eslint /shrug - null_ls.builtins.diagnostics.eslint_d, - -- null_ls.builtins.code_actions.eslint, - null_ls.builtins.code_actions.eslint_d, - null_ls.builtins.formatting.prettierd, - -- try using eslint for formatting instead of prettier - -- null_ls.builtins.formatting.eslint_d, +sources = { + null_ls.builtins.diagnostics.eslint.with({ + prefer_local = "node_modules/.bin", + }), + -- this is faster but it seems broken with latest eslint /shrug + -- null_ls.builtins.diagnostics.eslint_d, + null_ls.builtins.code_actions.eslint.with({ + prefer_local = "node_modules/.bin", + }), + + -- null_ls.builtins.code_actions.eslint_d, + null_ls.builtins.formatting.prettier.with({ + prefer_local = "node_modules/.bin", + }), + + -- try using eslint for formatting instead of prettier + -- null_ls.builtins.formatting.eslint_d, }, on_attach = on_attach, }) + + +local sources = { + null_ls.builtins.formatting.prettier.with({ + prefer_local = "node_modules/.bin", + }), +} -- -- local filetypes = { @@ -1399,7 +1515,8 @@ EOF " autocmd FileType clojure nmap cpP :Eval " autocmd FileType clojure nmap l :Last autocmd FileType clojure nmap ctt :IcedTestUnderCursor - " autocmd FileType clojure nmap ctm :Eval (require 'midje.repl)(midje.repl/load-facts *ns*) + autocmd FileType clojure nmap ctm :IcedTestAll + autocmd FileType clojure nmap ctr :IcedTestRedo " autocmd FileType clojure nmap cpR :Require! let g:fireplace_print_length = 80 @@ -1416,8 +1533,18 @@ EOF " ClojureScript nmap pg :Piggieback (figwheel-sidecar.repl-api/repl-env) - " vim-iced + " vim-iced - https://liquidz.github.io/vim-iced + aug VimIcedAutoFormatOnWriting + au! + " Format whole buffer on writing files + " au BufWritePre *.clj,*.cljs,*.cljc,*.edn execute ':IcedFormatSyncAll' + + " Format only current form on writing files + " au BufWritePre *.clj,*.cljs,*.cljc,*.edn execute ':IcedFormatSync' + aug END + let g:iced_enable_default_key_mappings = v:true + " let g:iced_enable_clj_kondo_analysis = v:true " let g:iced_enable_auto_indent = v:false let g:iced#format#rule = { @@ -1438,7 +1565,7 @@ EOF autocmd FileType clojure nmap c! (iced_eval_and_tap) " this has potential to override "change till m" - might need a different " mapping, or get kaocha working - autocmd FileType clojure nmap ctm :IcedEval (require 'midje.repl)(midje.repl/load-facts *ns*) + " autocmd FileType clojure nmap ctm :IcedEval (require 'midje.repl)(midje.repl/load-facts *ns*) " add namespace autocmd FileType clojure nmap an :IcedAddNs diff --git a/gitconfig b/gitconfig index eebecd8..edbe49a 100644 --- a/gitconfig +++ b/gitconfig @@ -115,3 +115,5 @@ rebase = true [rebase] autoStash = true +[init] + defaultBranch = master From e05d47f86ef0e8ca99ea8a8398ce02361f18f109 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Mon, 26 Jun 2023 09:23:47 -0600 Subject: [PATCH 44/49] Add print hook for vim-iced --- config/nvim/init.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index a88975f..2f5c796 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -1567,6 +1567,14 @@ EOF " mapping, or get kaocha working " autocmd FileType clojure nmap ctm :IcedEval (require 'midje.repl)(midje.repl/load-facts *ns*) + " always print after evaluating in vim-iced + call iced#hook#add('evaluated', { + \ 'type': 'command', + \ 'exec': 'IcedPrintLast', + \ }) + + + " add namespace autocmd FileType clojure nmap an :IcedAddNs autocmd FileType clojure nmap am :IcedAddMissing From d174b473bd363533d683dd5ffadbab02d6a7a7c5 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 5 Jan 2024 06:54:30 -0700 Subject: [PATCH 45/49] Fixup comment string --- config/nvim/init.vim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 2f5c796..e412372 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -106,6 +106,8 @@ Plug 'unisonweb/unison', { 'branch': 'trunk', 'rtp': 'editor-support/vim' } Plug 'mattn/emmet-vim' " expanding abbreviations (HTML mostly) + Plug 'google/vim-maktaba' " required for vim-bazel + Plug 'bazelbuild/vim-bazel' " JavaScript " " Plug 'mxw/vim-jsx' @@ -721,9 +723,6 @@ EOF lua < Date: Fri, 5 Jan 2024 06:54:49 -0700 Subject: [PATCH 46/49] Add better quickfix nvim-bqf --- config/kitty/kitty.conf | 2 +- config/nvim/init.vim | 429 +++++++++++++++++++--------------------- 2 files changed, 201 insertions(+), 230 deletions(-) diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 6385cd1..d5cced2 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -25,7 +25,7 @@ include fira.code.conf # solarized themes -include solarized.dark.conf +include solarized.dark.highcontrast.conf # include solarized.light.conf #: Font size (in pts) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index e412372..04a25cf 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -24,6 +24,7 @@ " Global plugins for all filetypes Plug 'tpope/vim-abolish' + Plug 'tpope/vim-scriptease' " Plug 'tpope/vim-dispatch' " Plug 'radenling/vim-dispatch-neovim' " Plug 'tpope/vim-eunuch' @@ -63,8 +64,8 @@ Plug 'theHamsta/nvim-dap-virtual-text' " Jest tests - Plug 'David-Kunz/jester' - Plug 'vim-test/vim-test' + " Plug 'David-Kunz/jester' + " Plug 'vim-test/vim-test' " Generally usefull stuff Plug 'RRethy/vim-illuminate' " highlight words under cursor @@ -85,8 +86,8 @@ " Use TreeSitter for language highlighting instead Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} - Plug 'nvim-treesitter/nvim-treesitter-context' - Plug 'nvim-treesitter/nvim-treesitter-textobjects' + " Plug 'nvim-treesitter/nvim-treesitter-context' + " Plug 'nvim-treesitter/nvim-treesitter-textobjects' Plug 'HiPhish/nvim-ts-rainbow2' @@ -108,6 +109,7 @@ Plug 'mattn/emmet-vim' " expanding abbreviations (HTML mostly) Plug 'google/vim-maktaba' " required for vim-bazel Plug 'bazelbuild/vim-bazel' + Plug 'jxnblk/vim-mdx-js' " JavaScript " " Plug 'mxw/vim-jsx' @@ -149,6 +151,7 @@ " Plug 'christianrondeau/vim-base64' " Plug 'mhinz/vim-signify' Plug 'kassio/neoterm' " Terminal utils + Plug 'kevinhwang91/nvim-bqf' " Better quickfix " Plug 'vim-scripts/regreplop.vim' " replace! " Mermaid diagrams / live markdown preview @@ -483,60 +486,60 @@ lua << EOF -require("treesitter-context").setup({ - enable = true, - throttle = true, - max_lines = 0, - patterns = { - default = { - "class", - "function", - "method", - "for", - "while", - "if", - "else", - "switch", - "case", - }, - rust = { - "impl_item", - "mod_item", - "enum_item", - "match", - "struct", - "loop", - "closure", - "async_block", - "block", - }, - python = { - "elif", - "with", - "try", - "except", - }, - json = { - "object", - "pair", - }, - javascript = { - "object", - "pair", - }, - yaml = { - "block_mapping_pair", - "block_sequence_item", - }, - toml = { - "table", - "pair", - }, - markdown = { - "section", - }, - }, -}) +-- require("treesitter-context").setup({ +-- enable = true, +-- throttle = true, +-- max_lines = 0, +-- patterns = { +-- default = { +-- "class", +-- "function", +-- "method", +-- "for", +-- "while", +-- "if", +-- "else", +-- "switch", +-- "case", +-- }, +-- rust = { +-- "impl_item", +-- "mod_item", +-- "enum_item", +-- "match", +-- "struct", +-- "loop", +-- "closure", +-- "async_block", +-- "block", +-- }, +-- python = { +-- "elif", +-- "with", +-- "try", +-- "except", +-- }, +-- json = { +-- "object", +-- "pair", +-- }, +-- javascript = { +-- "object", +-- "pair", +-- }, +-- yaml = { +-- "block_mapping_pair", +-- "block_sequence_item", +-- }, +-- toml = { +-- "table", +-- "pair", +-- }, +-- markdown = { +-- "section", +-- }, +-- }, +-- }) EOF " }}} @@ -569,7 +572,7 @@ require('lualine').setup { lualine_a = {'filename'}, lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_c = {'mode', 'nvim_treesitter#statusline(90)'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_x = {'searchcount', 'fileformat', 'filesize', 'filetype'}, lualine_y = {'progress'}, lualine_z = {'location'} }, @@ -722,135 +725,138 @@ EOF " TreeSitter {{{ lua <') or a table - -- mapping query_strings to modes. - selection_modes = { - ['@parameter.outer'] = 'v', -- charwise - ['@function.outer'] = 'V', -- linewise - ['@class.outer'] = '', -- blockwise - }, - -- If you set this to `true` (default is `false`) then any textobject is - -- extended to include preceding or succeeding whitespace. Succeeding - -- whitespace has priority in order to act similarly to eg the built-in - -- `ap`. - -- - -- Can also be a function which gets passed a table with the keys - -- * query_string: eg '@function.inner' - -- * selection_mode: eg 'v' - -- and should return true of false - include_surrounding_whitespace = true, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = { query = "@class.outer", desc = "Next class start" }, - -- - -- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queires. - ["]o"] = "@loop.*", - -- ["]o"] = { query = { "@loop.inner", "@loop.outer" } } - -- - -- You can pass a query group to use query from `queries//.scm file in your runtime path. - -- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. - ["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" }, - ["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, - }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", - }, - -- Below will go to either the start or the end, whichever is closer. - -- Use if you want more granular movements - -- Make it even more gradual by adding multiple queries and regex. - goto_next = { - ["]d"] = "@conditional.outer", - }, - goto_previous = { - ["[d"] = "@conditional.outer", - } - }, - lsp_interop = { - enable = true, - border = 'none', - floating_preview_opts = {}, - peek_definition_code = { - ["df"] = "@function.outer", - ["dF"] = "@class.outer", - }, - }, - }, - rainbow = { - enable = true, - -- list of languages you want to disable the plugin for - disable = {}, - -- Which query to use for finding delimiters - query = 'rainbow-parens', - -- Highlight the entire buffer all at once - strategy = require('ts-rainbow').strategy.global, - }, + -- textobjects = { + --select = { + -- enable = true, + + -- -- Automatically jump forward to textobj, similar to targets.vim + -- lookahead = true, + + -- keymaps = { + -- -- You can use the capture groups defined in textobjects.scm + -- ["af"] = "@function.outer", + -- ["if"] = "@function.inner", + -- ["ac"] = "@class.outer", + -- -- You can optionally set descriptions to the mappings (used in the desc parameter of + -- -- nvim_buf_set_keymap) which plugins like which-key display + -- ["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" }, + -- -- You can also use captures from other query groups like `locals.scm` + -- ["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" }, + -- }, + -- -- You can choose the select mode (default is charwise 'v') + -- -- + -- -- Can also be a function which gets passed a table with the keys + -- -- * query_string: eg '@function.inner' + -- -- * method: eg 'v' or 'o' + -- -- and should return the mode ('v', 'V', or '') or a table + -- -- mapping query_strings to modes. + -- selection_modes = { + -- ['@parameter.outer'] = 'v', -- charwise + -- ['@function.outer'] = 'V', -- linewise + -- ['@class.outer'] = '', -- blockwise + -- }, + -- -- If you set this to `true` (default is `false`) then any textobject is + -- -- extended to include preceding or succeeding whitespace. Succeeding + -- -- whitespace has priority in order to act similarly to eg the built-in + -- -- `ap`. + -- -- + -- -- Can also be a function which gets passed a table with the keys + -- -- * query_string: eg '@function.inner' + -- -- * selection_mode: eg 'v' + -- -- and should return true of false + -- include_surrounding_whitespace = true, + --}, + --move = { + -- enable = true, + -- set_jumps = true, -- whether to set jumps in the jumplist + -- goto_next_start = { + -- ["]m"] = "@function.outer", + -- ["]]"] = { query = "@class.outer", desc = "Next class start" }, + -- -- + -- -- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queires. + -- ["]o"] = "@loop.*", + -- -- ["]o"] = { query = { "@loop.inner", "@loop.outer" } } + -- -- + -- -- You can pass a query group to use query from `queries//.scm file in your runtime path. + -- -- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. + -- ["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" }, + -- ["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, + -- }, + -- goto_next_end = { + -- ["]M"] = "@function.outer", + -- ["]["] = "@class.outer", + -- }, + -- goto_previous_start = { + -- ["[m"] = "@function.outer", + -- ["[["] = "@class.outer", + -- }, + -- goto_previous_end = { + -- ["[M"] = "@function.outer", + -- ["[]"] = "@class.outer", + -- }, + -- -- Below will go to either the start or the end, whichever is closer. + -- -- Use if you want more granular movements + -- -- Make it even more gradual by adding multiple queries and regex. + -- goto_next = { + -- ["]d"] = "@conditional.outer", + -- }, + -- goto_previous = { + -- ["[d"] = "@conditional.outer", + -- } + --}, + --lsp_interop = { + -- enable = true, + -- border = 'none', + -- floating_preview_opts = {}, + -- peek_definition_code = { + -- ["df"] = "@function.outer", + -- ["dF"] = "@class.outer", + -- }, + --}, + -- }, + -- rainbow = { + -- enable = true, + -- -- list of languages you want to disable the plugin for + -- disable = {}, + -- -- Which query to use for finding delimiters + -- query = 'rainbow-parens', + -- -- Highlight the entire buffer all at once + -- strategy = require('ts-rainbow').strategy.global, + -- }, } +vim.treesitter.language.register('mdx', 'markdown') + -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects -local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move" +-- local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move" -- Repeat movement with ; and , -- ensure ; goes forward and , goes backward regardless of the last direction -vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next) -vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous) +-- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next) +-- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous) -- vim way: ; goes to the direction you were moving. -- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move) -- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite) -- Optionally, make builtin f, F, t, T also repeatable with ; and , -vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f) -vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F) -vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t) -vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T) - -local parser_config = require'nvim-treesitter.parsers'.get_parser_configs() - --- parser_config.gotmpl = { --- install_info = { --- url = "https://github.com/ngalaiko/tree-sitter-go-template", --- files = {"src/parser.c"} --- }, --- filetype = "gotmpl", --- used_by = {"gohtmltmpl", "gotexttmpl", "gotmpl", "yaml"} --- } +-- vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f) +-- vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F) +-- vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t) +-- vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T) EOF @@ -1081,75 +1087,40 @@ lspconfig.tsserver.setup({ local null_ls = require("null-ls") null_ls.setup({ -sources = { + sources = { + -- diagnostics null_ls.builtins.diagnostics.eslint.with({ prefer_local = "node_modules/.bin", }), - -- this is faster but it seems broken with latest eslint /shrug -- null_ls.builtins.diagnostics.eslint_d, - null_ls.builtins.code_actions.eslint.with({ - prefer_local = "node_modules/.bin", - }), - -- null_ls.builtins.code_actions.eslint_d, + -- formatting - use eslint instead + -- null_ls.builtins.formatting.eslint_d, + -- null_ls.builtins.formatting.eslint.with({ + -- prefer_local = "node_modules/.bin", + -- }), null_ls.builtins.formatting.prettier.with({ prefer_local = "node_modules/.bin", }), + -- code actions + -- null_ls.builtins.code_actions.eslint.with({ + -- prefer_local = "node_modules/.bin", + -- }), + null_ls.builtins.code_actions.eslint_d, + -- try using eslint for formatting instead of prettier -- null_ls.builtins.formatting.eslint_d, }, on_attach = on_attach, -}) - - -local sources = { - null_ls.builtins.formatting.prettier.with({ - prefer_local = "node_modules/.bin", - }), -} --- + } +) --- local filetypes = { --- typescript = "eslint", --- typescriptreact = "eslint", --- } --- local linters = { --- eslint = { --- sourceName = "eslint", --- command = "eslint_d", --- rootPatterns = {".eslintrc.js", "package.json"}, --- debounce = 500, --- args = {"--stdin", "--stdin-filename", "%filepath", "--format", "json"}, --- parseJson = { --- errorsRoot = "[0].messages", --- line = "line", --- column = "column", --- endLine = "endLine", --- endColumn = "endColumn", --- message = "${message} [${ruleId}]", --- security = "severity" --- }, --- securities = {[2] = "error", [1] = "warning"} --- } --- } --- local formatters = { --- prettier = {command = "eslint_d", args = {"--fix-to-stdout", "--stdin", "--stdin-filename", "%filepath"}} --- } --- local formatFiletypes = { --- typescript = "prettier", --- typescriptreact = "prettier" +-- local sources = { +-- -- null_ls.builtins.formatting.prettier.with({ +-- -- prefer_local = "node_modules/.bin", +-- -- }), -- } --- nvim_lsp.diagnosticls.setup { --- on_attach = on_attach, --- filetypes = vim.tbl_keys(filetypes), --- init_options = { --- filetypes = filetypes, --- linters = linters, --- formatters = formatters, --- formatFiletypes = formatFiletypes --- } ---} EOF From 075ff8b68902571fd5994386bd4999846d3eaadc Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Tue, 9 Jan 2024 12:06:59 -0700 Subject: [PATCH 47/49] Configure live grep args for telecope --- config/nvim/init.vim | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 04a25cf..9863b95 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -185,6 +185,7 @@ Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope-github.nvim' Plug 'nvim-telescope/telescope-media-files.nvim' + Plug 'nvim-telescope/telescope-live-grep-args.nvim' Plug 'aaronhallaert/advanced-git-search.nvim' " native sorter for telescope @@ -974,6 +975,9 @@ require('telescope').load_extension('media_files') -- https://github.com/aaronhallaert/advanced-git-search.nvim#%EF%B8%8F-installation require("telescope").load_extension("advanced_git_search") +-- pass args to grep https://github.com/nvim-telescope/telescope-live-grep-args.nvim +require("telescope").load_extension("live_grep_args") + -- David-Kunz/jester map('n', 'tt', ':lua require"jester".run({ path_to_jest = "/opt/homebrew/bin/jest" })') @@ -1372,6 +1376,8 @@ EOF " }}} " Telescope fuzzy finder {{{ + + " Find files using Telescope command-line sugar. nnoremap ff Telescope find_files nnoremap p Telescope git_files @@ -1385,12 +1391,40 @@ EOF nnoremap tgb Telescope git_branches nnoremap tts Telescope treesitter - nnoremap \ Telescope live_grep + " nnoremap \ Telescope live_grep + nnoremap \ lua require('telescope').extensions.live_grep_args.live_grep_args() + " keymap.set("n", "fg", ":lua require('telescope').extensions.live_grep_args.live_grep_args()") + nnoremap * Telescope grep_string " :lua require'telescope.builtin'.planets{} " :nnoremap pp :lua require'telescope.builtin'.planets{} +lua <"] = lga_actions.quote_prompt(), + [""] = lga_actions.quote_prompt({ postfix = " --iglob " }), + }, + }, + -- ... also accepts theme settings, for example: + -- theme = "dropdown", -- use dropdown theme + -- theme = { }, -- use own theme spec + -- layout_config = { mirror=true }, -- mirror preview pane + } + } +} +EOF + + " }}} " fzf {{{ From 4cf451cb50e82881c7eac5bc29c96c5f5c1a1148 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Thu, 2 Jan 2025 10:17:21 -0700 Subject: [PATCH 48/49] Mirate to lazy.nvim!!!! --- config/kitty/kitty.conf | 2 +- config/nvim/init.vim | 852 ++++++++++------------------ config/nvim/lua/config/lazy.lua | 35 ++ config/nvim/lua/plugins/plugins.lua | 116 ++++ config/nvim/lua/telescopeimage.lua | 124 ++++ 5 files changed, 578 insertions(+), 551 deletions(-) create mode 100644 config/nvim/lua/config/lazy.lua create mode 100644 config/nvim/lua/plugins/plugins.lua create mode 100644 config/nvim/lua/telescopeimage.lua diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index d5cced2..68a51e7 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -754,7 +754,7 @@ map kitty_mod+enter new_window_with_cwd # map cmd+n new_os_window # map kitty_mod+n new_os_window -# map kitty_mod+w close_window +map kitty_mod+w close_window # map kitty_mod+] next_window # map kitty_mod+[ previous_window # map kitty_mod+f move_window_forward diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 9863b95..efd7c16 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -10,225 +10,7 @@ " A part of the pristine dotfile zen garden of @devth " Plugins {{{ - - " auto-install vim-plug if not already installed - if empty(glob('~/.config/nvim/autoload/plug.vim')) - echo 'not installed' - silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC - endif - - " begin vim-plug - call plug#begin('~/.config/nvim/plugged') - - " Global plugins for all filetypes - Plug 'tpope/vim-abolish' - Plug 'tpope/vim-scriptease' - " Plug 'tpope/vim-dispatch' - " Plug 'radenling/vim-dispatch-neovim' - " Plug 'tpope/vim-eunuch' - - " Git - Plug 'tpope/vim-fugitive' - Plug 'tpope/vim-rhubarb' " GBrowse and GH enterprise - " this is buggy and causes lots of errors - TODO find alternative: - " Plug 'APZelos/blamer.nvim' - Plug 'shumphrey/fugitive-gitlab.vim' " gitlab for fugitive - " Plug 'idanarye/vim-merginal' " branch mgmt for fugitive - " Plug 'lambdalisue/gina.vim' - Plug 'tpope/vim-git' - - " LSP - Plug 'neovim/nvim-lspconfig' - Plug 'jose-elias-alvarez/null-ls.nvim', { 'branch': 'main' } - Plug 'jose-elias-alvarez/nvim-lsp-ts-utils', { 'branch': 'main' } - Plug 'folke/trouble.nvim', { 'branch': 'main' } - Plug 'ray-x/lsp_signature.nvim' - " Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' } - " Plug 'ray-x/navigator.lua' - - " Completion - Plug 'github/copilot.vim', { 'branch': 'release' } - Plug 'hrsh7th/cmp-nvim-lsp' - Plug 'hrsh7th/cmp-buffer' - Plug 'hrsh7th/cmp-path' - Plug 'hrsh7th/cmp-cmdline' - Plug 'hrsh7th/nvim-cmp' - Plug 'hrsh7th/vim-vsnip' - Plug 'hrsh7th/cmp-vsnip' - - " Debug Adapter Protocol - Plug 'mfussenegger/nvim-dap' - Plug 'nvim-telescope/telescope-dap.nvim' - Plug 'theHamsta/nvim-dap-virtual-text' - - " Jest tests - " Plug 'David-Kunz/jester' - " Plug 'vim-test/vim-test' - - " Generally usefull stuff - Plug 'RRethy/vim-illuminate' " highlight words under cursor - Plug 'tpope/vim-repeat' - " Plug 'tpope/vim-rhubarb' " TODO find replacement or re-enable - Plug 'tpope/vim-speeddating' " increment stuff - Plug 'tpope/vim-surround' " obviously - " Plug 'tpope/vim-tbone' - Plug 'tpope/vim-unimpaired' " bracket mappings - " Plug 'tpope/vim-obsession' - Plug 'norcalli/nvim-colorizer.lua' - - " Colors - some plugins rely on this - " Plug 'devth/vim-colors-solarized' " Note: devth-fork - " Plug 'overcache/NeoSolarized' - Plug 'ishan9299/nvim-solarized-lua' - - - " Use TreeSitter for language highlighting instead - Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} - " Plug 'nvim-treesitter/nvim-treesitter-context' - " Plug 'nvim-treesitter/nvim-treesitter-textobjects' - Plug 'HiPhish/nvim-ts-rainbow2' - - - " General Syntax - these shouldn't slow things down - " Plug 'tpope/vim-markdown', {'for': 'markdown'} - " Plug 'ekalinin/Dockerfile.vim', {'for': 'Dockerfile'} - " Plug 'google/vim-jsonnet', {'for': 'jsonnet'} - " Plug 'fatih/vim-go', {'for': 'go'} - " Plug 'hashivim/vim-vagrant', {'for': 'vagrant'} - " Plug 'mustache/vim-mustache-handlebars' - " " Plug 'jparise/vim-graphql', {'for': 'graphql'} - " Plug 'jparise/vim-graphql', {'for': 'graphql'} - Plug 'delphinus/vim-firestore' " firestore highlighting - " Plug 'pangloss/vim-javascript', {'for': 'javascript'} - " Plug 'hashivim/vim-terraform' - Plug 'MichaHoffmann/tree-sitter-hcl' - Plug 'unisonweb/unison', { 'branch': 'trunk', 'rtp': 'editor-support/vim' } - - Plug 'mattn/emmet-vim' " expanding abbreviations (HTML mostly) - Plug 'google/vim-maktaba' " required for vim-bazel - Plug 'bazelbuild/vim-bazel' - Plug 'jxnblk/vim-mdx-js' - - " JavaScript - " " Plug 'mxw/vim-jsx' - " Plug 'neoclide/vim-jsx-improve' - - " Clojure - " Plug 'clojure-vim/async-clj-omni', {'for': 'clojure'} " clj completion - " " needed for edn and the latest clojure syntax - " Plug 'guns/vim-clojure-static', {'for': 'clojure'} - " Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'} - " " Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'dev'} - Plug 'liquidz/vim-iced', {'for': 'clojure', 'branch': 'main' } - Plug 'liquidz/vim-iced-project-namespaces', {'for': 'clojure'} - Plug 'guns/vim-sexp', {'for': 'clojure'} " NOTE: required for vim-iced - " Plug 'liquidz/vim-iced-kaocha' - " " Plug 'matthias-margush/vim-iced', {'for': 'clojure', 'branch': 'piggieback' } - " " Note: Doesn't work with .cljc files yet: - " " TODO get this working - " " Plug 'clojure-vim/acid.nvim', { 'do': ':UpdateRemotePlugins' } - - " " Elm - " Plug 'ElmCast/elm-vim', {'for': 'elm'} - - " File exploration / openning - Plug 'kyazdani42/nvim-web-devicons' " for file icons - Plug 'kyazdani42/nvim-tree.lua' - " Plug 'scrooloose/nerdtree' - " Plug 'Xuyuanp/nerdtree-git-plugin' - " Can't get these to work right - font is not configured? - " Plug 'tiagofumo/vim-nerdtree-syntax-highlight' - " Plug 'ryanoasis/vim-devicons' - - " tmux integration - " Plug 'tmux-plugins/vim-tmux' - " Plug 'christoomey/vim-tmux-navigator' - - " Utils - " Plug 'vimlab/split-term.vim' " Terminal utils - " Plug 'christianrondeau/vim-base64' - " Plug 'mhinz/vim-signify' - Plug 'kassio/neoterm' " Terminal utils - Plug 'kevinhwang91/nvim-bqf' " Better quickfix - " Plug 'vim-scripts/regreplop.vim' " replace! - - " Mermaid diagrams / live markdown preview - Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } - - Plug 'svermeulen/vim-subversive' " Replace stuff - Plug 'tpope/vim-commentary' " commenting - Plug 'JoosepAlviste/nvim-ts-context-commentstring' " embedded language comment support - - - " TODO possibly re-enable this but figure out how to make it not conflict with - " CoC.nvim - " Plug 'dense-analysis/ale' " Async Lint Engine - " Plug 'vim-scripts/YankRing.vim' " (SLOW) Keep track of past yanked values - Plug 'svermeulen/vim-yoink' - " Plug 'vim-scripts/tComment' " Comment stuff - Plug 'junegunn/goyo.vim' " Writing mode - " Plug 'preservim/tagbar' " ctags! - " Plug 'lvht/tagbar-markdown' " tagbar for md files - " Plug 'liuchengxu/vista.vim' - Plug 'michaeljsmith/vim-indent-object' " indent objects - " Plug 'junegunn/vim-easy-align' " alignment! - " Plug 'mileszs/ack.vim' " search file contents via ag or ack - " Plug 'simnalamburt/vim-mundo' " Vim undo tree viz - - " Plug 'chr4/sslsecure.vim' " Highlight insecure SSL configuration - - " Fuzzy file finder - Plug 'nvim-lua/popup.nvim' - Plug 'nvim-lua/plenary.nvim' - Plug 'nvim-telescope/telescope.nvim' - Plug 'nvim-telescope/telescope-github.nvim' - Plug 'nvim-telescope/telescope-media-files.nvim' - Plug 'nvim-telescope/telescope-live-grep-args.nvim' - Plug 'aaronhallaert/advanced-git-search.nvim' - - " native sorter for telescope - Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } - " Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } - " Plug '/usr/local/opt/fzf' " installed via Homebrew - " Plug 'junegunn/fzf.vim' " if you want latest fzf use this instead - " Plug 'junegunn/fzf', { 'do': './install --all' } - " Plug 'junegunn/fzf', { 'do': './install --bin' } - " Plug 'junegunn/fzf.vim' - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } - Plug 'junegunn/fzf.vim' - - - " Use actual tmux instead - " Plug 'Vigemus/nvimux' " Tmux-like key bindings for NeoVim - - " Status line - Plug 'nvim-lualine/lualine.nvim' - " - " Powerline alternatives - " Plug 'vim-airline/vim-airline' - " Plug 'vim-airline/vim-airline-themes' - - " Plug 'gcmt/taboo.vim' " Tabs - - " TypeScript - " Plug 'pangloss/vim-javascript' - " Plug 'leafgarland/typescript-vim' - " Plug 'peitalin/vim-jsx-typescript' - - " Language Service Client - " Originally configured for TypeScript following - " https://thoughtbot.com/blog/modern-typescript-and-react-development-in-vim - " Plug 'neoclide/coc.nvim', {'branch': 'release'} - " let g:coc_global_extensions = [ - " \ 'coc-tsserver' - " \ ] - - " Plug 'HerringtonDarkholme/yats.vim' " TS Syntax - " Plug 'mhartington/nvim-typescript', {'do': './install.sh'} " TSServer client - - call plug#end() + lua require("config.lazy") " }}} " Vim system settings {{{ @@ -238,14 +20,15 @@ " set foldmethod=marker set nowrap set ttyfast - set lazyredraw + " don't need this anymore and noice doesn't like it. + " set lazyredraw set nocompatible + " min number of lines above below cursor + set scrolloff=3 syntax on filetype plugin indent on set shell=/bin/zsh " set shellcmdflag=-l - let mapleader = "," - let maplocalleader = "," set history=1000 set undolevels=1000 set nocursorline nocursorcolumn " vim is slow with these on :/ @@ -322,6 +105,46 @@ " }}} +" nvim lua default package lookup {{{ + +lua <bgl :set bg=light nnoremap bgd :set bg=dark @@ -722,147 +458,98 @@ EOF xmap p (SubversiveSubstitute) xmap P (SubversiveSubstitute) " }}} +" -" TreeSitter {{{ +" Noice {{{ lua <') or a table - -- -- mapping query_strings to modes. - -- selection_modes = { - -- ['@parameter.outer'] = 'v', -- charwise - -- ['@function.outer'] = 'V', -- linewise - -- ['@class.outer'] = '', -- blockwise - -- }, - -- -- If you set this to `true` (default is `false`) then any textobject is - -- -- extended to include preceding or succeeding whitespace. Succeeding - -- -- whitespace has priority in order to act similarly to eg the built-in - -- -- `ap`. - -- -- - -- -- Can also be a function which gets passed a table with the keys - -- -- * query_string: eg '@function.inner' - -- -- * selection_mode: eg 'v' - -- -- and should return true of false - -- include_surrounding_whitespace = true, - --}, - --move = { - -- enable = true, - -- set_jumps = true, -- whether to set jumps in the jumplist - -- goto_next_start = { - -- ["]m"] = "@function.outer", - -- ["]]"] = { query = "@class.outer", desc = "Next class start" }, - -- -- - -- -- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queires. - -- ["]o"] = "@loop.*", - -- -- ["]o"] = { query = { "@loop.inner", "@loop.outer" } } - -- -- - -- -- You can pass a query group to use query from `queries//.scm file in your runtime path. - -- -- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. - -- ["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" }, - -- ["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" }, - -- }, - -- goto_next_end = { - -- ["]M"] = "@function.outer", - -- ["]["] = "@class.outer", - -- }, - -- goto_previous_start = { - -- ["[m"] = "@function.outer", - -- ["[["] = "@class.outer", - -- }, - -- goto_previous_end = { - -- ["[M"] = "@function.outer", - -- ["[]"] = "@class.outer", - -- }, - -- -- Below will go to either the start or the end, whichever is closer. - -- -- Use if you want more granular movements - -- -- Make it even more gradual by adding multiple queries and regex. - -- goto_next = { - -- ["]d"] = "@conditional.outer", - -- }, - -- goto_previous = { - -- ["[d"] = "@conditional.outer", - -- } - --}, - --lsp_interop = { - -- enable = true, - -- border = 'none', - -- floating_preview_opts = {}, - -- peek_definition_code = { - -- ["df"] = "@function.outer", - -- ["dF"] = "@class.outer", - -- }, - --}, - -- }, - -- rainbow = { - -- enable = true, - -- -- list of languages you want to disable the plugin for - -- disable = {}, - -- -- Which query to use for finding delimiters - -- query = 'rainbow-parens', - -- -- Highlight the entire buffer all at once - -- strategy = require('ts-rainbow').strategy.global, - -- }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "gnn", -- set to `false` to disable one of the mappings + node_incremental = "grn", + scope_incremental = "grc", + node_decremental = "grm", + }, + }, + indent = { + enable = true + }, + + -- see all config options at + -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects?tab=readme-ov-file#text-objects-select + textobjects = { + select = { + enable = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + }, + }, } -vim.treesitter.language.register('mdx', 'markdown') - --- https://github.com/nvim-treesitter/nvim-treesitter-textobjects --- local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move" --- Repeat movement with ; and , --- ensure ; goes forward and , goes backward regardless of the last direction --- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next) --- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous) --- vim way: ; goes to the direction you were moving. --- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move) --- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite) --- Optionally, make builtin f, F, t, T also repeatable with ; and , --- vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f) --- vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F) --- vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t) --- vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T) +-- https://github.com/windwp/nvim-ts-autotag?tab=readme-ov-file#setup +require('nvim-ts-autotag').setup({ + opts = { + -- Defaults + enable_close = true, -- Auto close tags + enable_rename = true, -- Auto rename pairs of tags + enable_close_on_slash = false -- Auto close on trailing xx TroubleToggle @@ -978,6 +665,9 @@ require("telescope").load_extension("advanced_git_search") -- pass args to grep https://github.com/nvim-telescope/telescope-live-grep-args.nvim require("telescope").load_extension("live_grep_args") +-- telescope for code actions +require("telescope").load_extension("ui-select") + -- David-Kunz/jester map('n', 'tt', ':lua require"jester".run({ path_to_jest = "/opt/homebrew/bin/jest" })') @@ -1004,22 +694,37 @@ nmap g :TestVisit lua << EOF -local cfg = {} -require "lsp_signature".setup(cfg) + +-- local cfg = {} +-- require "lsp_signature".setup(cfg) -- https://github.com/ray-x/navigator.lua -- require'navigator'.setup() - -- from https://jose-elias-alvarez.medium.com/configuring-neovims-lsp-client-for-typescript-development-5789d58ea9c -- updated 1/15/2022 + local lspconfig = require("lspconfig") local buf_map = function(bufnr, mode, lhs, rhs, opts) vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts or { silent = true, }) end + +-- vim.opt.signcolumn = "yes" +-- vim.diagnostic.config({ +-- virtual_text = false, +-- signs = false, +-- underline = false, +-- update_in_insert = false, +-- severity_sort = true, +-- float = { +-- border = 'rounded', +-- source = true, +-- }, +-- }) + local on_attach = function(client, bufnr) vim.cmd("command! LspDef lua vim.lsp.buf.definition()") vim.cmd("command! LspFormatting lua vim.lsp.buf.format { timeout_ms = 5000 }") @@ -1037,11 +742,11 @@ local on_attach = function(client, bufnr) buf_map(bufnr, "n", "gr", ":LspRename") buf_map(bufnr, "n", "gl", ":LspRefs") buf_map(bufnr, "n", "gy", ":LspTypeDef") - buf_map(bufnr, "n", "K", ":LspHover") + -- buf_map(bufnr, "n", "K", ":LspHover") buf_map(bufnr, "n", "[a", ":LspDiagPrev") buf_map(bufnr, "n", "]a", ":LspDiagNext") buf_map(bufnr, "n", "ga", ":LspCodeAction") - buf_map(bufnr, "n", "fo", ":LspFormatting") + -- buf_map(bufnr, "n", "fo", ":LspFormatting") buf_map(bufnr, "n", "a", ":LspDiagLine") buf_map(bufnr, "i", "", " LspSignatureHelp") @@ -1067,65 +772,95 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Replace with each lsp server you've enabled. -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/pylsp.lua -- lspconfig.pylsp.setup{} -lspconfig.pyright.setup{} +-- lspconfig.pyright.setup{} +-- lspconfig.gopls.setup{} -lspconfig.gopls.setup{} +lspconfig.ruby_lsp.setup({}) +lspconfig.rubocop.setup{} -lspconfig.tsserver.setup({ - flags = { - debounce_text_changes = 500, - }, - capabilities = capabilities, - on_attach = function(client, bufnr) - client.server_capabilities.document_formatting = false - client.server_capabilities.document_range_formatting = false - local ts_utils = require("nvim-lsp-ts-utils") - ts_utils.setup({}) - ts_utils.setup_client(client) - buf_map(bufnr, "n", "gs", ":TSLspOrganize") - buf_map(bufnr, "n", "gi", ":TSLspRenameFile") - buf_map(bufnr, "n", "go", ":TSLspImportAll") - on_attach(client, bufnr) - end, -}) - -local null_ls = require("null-ls") -null_ls.setup({ - sources = { - -- diagnostics - null_ls.builtins.diagnostics.eslint.with({ - prefer_local = "node_modules/.bin", - }), - -- null_ls.builtins.diagnostics.eslint_d, - - -- formatting - use eslint instead - -- null_ls.builtins.formatting.eslint_d, - -- null_ls.builtins.formatting.eslint.with({ - -- prefer_local = "node_modules/.bin", - -- }), - null_ls.builtins.formatting.prettier.with({ - prefer_local = "node_modules/.bin", - }), +lspconfig.biome.setup{} - -- code actions - -- null_ls.builtins.code_actions.eslint.with({ - -- prefer_local = "node_modules/.bin", - -- }), - null_ls.builtins.code_actions.eslint_d, +lspconfig.yamlls.setup {} - -- try using eslint for formatting instead of prettier - -- null_ls.builtins.formatting.eslint_d, +-- this replaces lspconfig ts_ls +require("typescript-tools").setup { + settings = { + expose_as_code_action = "all", + jsx_close_tag = { + enable = true, + filetypes = { "javascriptreact", "typescriptreact" }, }, - on_attach = on_attach, - } -) + tsserver_file_preferences = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = false, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, +} --- local sources = { --- -- null_ls.builtins.formatting.prettier.with({ --- -- prefer_local = "node_modules/.bin", --- -- }), +-- python lsp +require'lspconfig'.jedi_language_server.setup{} + +-- require'lspconfig'.ts_ls.setup{ +-- on_attach = function(client, bufnr) +-- -- disable formatting so it doesn't conflict with eslint / prettier +-- client.server_capabilities.documentFormattingProvider = false +-- client.server_capabilities.documentRangeFormatting = false +-- -- only config typescript-tools after attaching to a TS language server +-- -- local ts_utils = require("nvim-lsp-ts-utils") +-- -- ts_utils.setup({}) +-- -- ts_utils.setup_client(client) +-- -- this command is broken until https://github.com/pmizio/typescript-tools.nvim/issues/295 is fixed +-- buf_map(bufnr, "n", "gs", ":TSToolsOrganizeImports") +-- -- buf_map(bufnr, "n", "gi", ":TSLspRenameFile") +-- -- buf_map(bufnr, "n", "go", ":TSLspImportAll") +-- on_attach(client, bufnr) +-- end, -- } + +-- lspconfig.tsserver.setup({ +-- flags = { +-- debounce_text_changes = 500, +-- }, +-- capabilities = capabilities, +-- on_attach = function(client, bufnr) +-- -- disable formatting so it doesn't conflict with eslint / prettier +-- client.server_capabilities.documentFormattingProvider = false +-- client.server_capabilities.documentRangeFormatting = false +-- local ts_utils = require("nvim-lsp-ts-utils") +-- ts_utils.setup({}) +-- ts_utils.setup_client(client) +-- buf_map(bufnr, "n", "gs", ":TSToolsOrganizeImports") +-- buf_map(bufnr, "n", "gi", ":TSLspRenameFile") +-- buf_map(bufnr, "n", "go", ":TSLspImportAll") +-- on_attach(client, bufnr) +-- end, +-- }) + + +-- replaced null_ls with none-ls following biome's instructions +local null_ls = require("null-ls") +-- use biome (via lsp) instead! +-- null_ls.setup({ +-- sources = { +-- require("none-ls.diagnostics.eslint"), +-- require("none-ls.code_actions.eslint"), +-- -- use prettier instead of lsp formatting +-- null_ls.builtins.formatting.prettier, +-- -- null_ls.builtins.diagnostics.eslint_d, +-- -- try using eslint for formatting instead of prettier +-- -- null_ls.builtins.formatting.eslint_d, +-- }, +-- on_attach = on_attach, +-- } +-- ) + EOF " au BufEnter * typescript require'completion'.on_attach() @@ -1148,6 +883,12 @@ EOF set completeopt=menu,menuone,noselect lua <'] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + -- Accept currently selected item. Set `select` to `false` to only + -- confirm explicitly selected items. + [''] = cmp.mapping.confirm({ select = false }), }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, + -- https://www.reddit.com/r/neovim/comments/so4g5e/comment/hw7i5n0/ + { name = "nvim_lsp_signature_help" }, + { name = "codeium" }, { name = 'vsnip' }, -- For vsnip users. + { + name = 'buffer', + option = { + get_bufnrs = function() + return vim.api.nvim_list_bufs() + end + } + } -- { name = 'luasnip' }, -- For luasnip users. -- { name = 'ultisnips' }, -- For ultisnips users. -- { name = 'snippy' }, -- For snippy users. - }, { - { name = 'buffer' }, }) }) @@ -1219,8 +971,17 @@ EOF lua <", { buffer = bufnr }) +end +require'nvim-tree'.setup { + on_attach = nvim_tree_on_attach, +} + EOF " Can be `0` or `1`. When `1`, will close the tree when a file is opened. @@ -1354,18 +1115,6 @@ EOF " let g:ale_fix_on_save = 1 - - " Flow typed - " https://github.com/flowtype/vim-flow - " let g:flow#enable = 0 - " let g:flow#showquickfix = 0 - " let g:flow#autoclose = 1 - " let g:flow#timeout = 4 - " autocmd FileType javascript nnoremap ft :FlowType - " autocmd FileType javascript nnoremap fj :FlowJumpToDef - " " TODO what about gf for non-flow projects? - " autocmd FileType javascript nnoremap gf :FlowJumpToDef - " }}} " Clipboard {{{ @@ -1386,6 +1135,7 @@ EOF nnoremap fd Telescope lsp_definitions nnoremap fa Telescope lsp_code_actions nnoremap fs Telescope lsp_document_symbols + nnoremap fw Telescope lsp_dynamic_workspace_symbols nnoremap fh Telescope help_tags nnoremap fl Telescope git_files nnoremap tgb Telescope git_branches @@ -1404,7 +1154,15 @@ lua < autocmd FileType clojure nmap cpr :IcedRequireAll @@ -1572,12 +1321,11 @@ EOF " autocmd FileType clojure nmap ctm :IcedEval (require 'midje.repl)(midje.repl/load-facts *ns*) " always print after evaluating in vim-iced - call iced#hook#add('evaluated', { - \ 'type': 'command', - \ 'exec': 'IcedPrintLast', - \ }) + " call iced#hook#add('evaluated', { + " \ 'type': 'command', + " \ 'exec': 'IcedPrintLast', + " \ }) - " add namespace autocmd FileType clojure nmap an :IcedAddNs @@ -1595,29 +1343,29 @@ EOF " TypeScript {{{ " From https://github.com/peitalin/vim-jsx-typescript - autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx - hi tsxTag guifg=#F99575 ctermfg=lightgray - hi tsxTagName guifg=#E06C75 ctermfg=darkblue - hi tsxCloseString guifg=#F99575 ctermfg=darkblue - hi tsxCloseTag guifg=#F99575 ctermfg=lightgray - hi tsxCloseTagName guifg=#F99575 ctermfg=darkblue - hi tsxAttributeBraces guifg=#F99575 ctermfg=white - hi tsxJsBlock guifg=#F99575 ctermfg=darkcyan - hi tsxEqual guifg=#F99575 ctermfg=brown - hi tsxAttrib guifg=#F8BD7F cterm=italic ctermfg=darkmagenta - - " light-grey - hi tsxTypeBraces guifg=#999999 ctermfg=lightgray - hi tsxTypes guifg=#666666 ctermfg=lightgray - - hi ReactState guifg=#C176A7 - hi ReactProps guifg=#D19A66 - hi ApolloGraphQL guifg=#CB886B - hi Events ctermfg=204 guifg=#56B6C2 - hi ReduxKeywords ctermfg=204 guifg=#C678DD - hi ReduxHooksKeywords ctermfg=204 guifg=#C176A7 - hi WebBrowser ctermfg=204 guifg=#56B6C2 - hi ReactLifeCycleMethods ctermfg=204 guifg=#D19A66 + " autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx + " hi tsxTag guifg=#F99575 ctermfg=lightgray + " hi tsxTagName guifg=#E06C75 ctermfg=darkblue + " hi tsxCloseString guifg=#F99575 ctermfg=darkblue + " hi tsxCloseTag guifg=#F99575 ctermfg=lightgray + " hi tsxCloseTagName guifg=#F99575 ctermfg=darkblue + " hi tsxAttributeBraces guifg=#F99575 ctermfg=white + " hi tsxJsBlock guifg=#F99575 ctermfg=darkcyan + " hi tsxEqual guifg=#F99575 ctermfg=brown + " hi tsxAttrib guifg=#F8BD7F cterm=italic ctermfg=darkmagenta + + " " light-grey + " hi tsxTypeBraces guifg=#999999 ctermfg=lightgray + " hi tsxTypes guifg=#666666 ctermfg=lightgray + + " hi ReactState guifg=#C176A7 + " hi ReactProps guifg=#D19A66 + " hi ApolloGraphQL guifg=#CB886B + " hi Events ctermfg=204 guifg=#56B6C2 + " hi ReduxKeywords ctermfg=204 guifg=#C678DD + " hi ReduxHooksKeywords ctermfg=204 guifg=#C176A7 + " hi WebBrowser ctermfg=204 guifg=#56B6C2 + " hi ReactLifeCycleMethods ctermfg=204 guifg=#D19A66 " Give more space for displaying messages. " set cmdheight=2 @@ -1701,6 +1449,10 @@ nnoremap yr :YRShow autocmd FileType typescript.jsx setlocal commentstring=//\ %s " }}} +" Firestore {{{ + autocmd FileType firestore setlocal commentstring=//\ %s +" }}} + " JavaScript {{{ let g:jsx_ext_required = 0 " }}} diff --git a/config/nvim/lua/config/lazy.lua b/config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..b55e5fe --- /dev/null +++ b/config/nvim/lua/config/lazy.lua @@ -0,0 +1,35 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = "," +vim.g.maplocalleader = "," + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/config/nvim/lua/plugins/plugins.lua b/config/nvim/lua/plugins/plugins.lua new file mode 100644 index 0000000..98bab15 --- /dev/null +++ b/config/nvim/lua/plugins/plugins.lua @@ -0,0 +1,116 @@ +return { + -- Global plugins + { "tpope/vim-abolish" }, + { "tpope/vim-scriptease" }, + + -- Git plugins + { "tpope/vim-fugitive" }, + { "tpope/vim-rhubarb" }, + { "shumphrey/fugitive-gitlab.vim" }, + { "tpope/vim-git" }, + + -- LSP + { "williamboman/mason.nvim" }, + { "williamboman/mason-lspconfig.nvim" }, + { "neovim/nvim-lspconfig" }, + { "nvimtools/none-ls.nvim" }, + { "3rd/image.nvim" }, + { "nvimtools/none-ls-extras.nvim" }, + { "pmizio/typescript-tools.nvim" }, + { "folke/trouble.nvim", branch = "main" }, + + { + -- lsp outline on the right + "hedyhli/outline.nvim", + lazy = true, + cmd = { "Outline", "OutlineOpen", "OutlineFocus" }, + keys = { + { "oo", "Outline", desc = "Toggle outline" }, + { "of", "OutlineFocus", desc = "Focus outline window" }, + }, + opts = { + -- Your setup opts here + outline_window = { + width = 15, + focus_on_open = false, + } + }, + }, + + -- Fuuuuu no!!! + -- { "https://git.sr.ht/~whynothugo/lsp_lines.nvim" }, + + -- Completion + { "Exafunction/codeium.nvim", commit = "937667b2cadc7905e6b9ba18ecf84694cf227567" }, + { "hrsh7th/cmp-nvim-lsp" }, + { "hrsh7th/cmp-buffer" }, + { "hrsh7th/cmp-path" }, + { "hrsh7th/cmp-cmdline" }, + { "hrsh7th/nvim-cmp" }, + { "hrsh7th/vim-vsnip" }, + { "hrsh7th/cmp-vsnip" }, + + -- Debug Adapter Protocol + { "mfussenegger/nvim-dap" }, + { "nvim-telescope/telescope-dap.nvim" }, + { "theHamsta/nvim-dap-virtual-text" }, + + -- Useful plugins + { "RRethy/vim-illuminate" }, + { "tpope/vim-repeat" }, + { "tpope/vim-speeddating" }, + { "tpope/vim-surround" }, + { "tpope/vim-unimpaired" }, + { "norcalli/nvim-colorizer.lua" }, + + -- Colors + { "ishan9299/nvim-solarized-lua" }, + + -- TreeSitter + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + { "nvim-treesitter/nvim-treesitter-context" }, + { "nvim-treesitter/nvim-treesitter-textobjects" }, + { "windwp/nvim-ts-autotag" }, + + -- General Syntax + { "delphinus/vim-firestore" }, + { "MichaHoffmann/tree-sitter-hcl" }, + { "mattn/emmet-vim" }, + { "google/vim-maktaba" }, + -- { "bazelbuild/vim-bazel" }, + { "jxnblk/vim-mdx-js" }, + + -- File exploration + { "kyazdani42/nvim-web-devicons" }, + { "kyazdani42/nvim-tree.lua" }, + + -- Utils + { "MunifTanjim/nui.nvim" }, + { "rcarriga/nvim-notify" }, + { "folke/noice.nvim" }, + { "kassio/neoterm" }, + { "akinsho/toggleterm.nvim" }, + { "kevinhwang91/nvim-bqf" }, + + -- Markdown preview + { "iamcco/markdown-preview.nvim", build = "cd app && yarn install" }, + + -- Comments + { "svermeulen/vim-subversive" }, + { "tpope/vim-commentary" }, + { "JoosepAlviste/nvim-ts-context-commentstring" }, + + -- Fuzzy Finder + { "nvim-lua/popup.nvim" }, + { "nvim-lua/plenary.nvim" }, + { "nvim-telescope/telescope.nvim" }, + { "nvim-telescope/telescope-github.nvim" }, + { "nvim-telescope/telescope-media-files.nvim" }, + { "nvim-telescope/telescope-live-grep-args.nvim" }, + { "nvim-telescope/telescope-ui-select.nvim" }, + { "aaronhallaert/advanced-git-search.nvim" }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + + -- Statusline + { "nvim-lualine/lualine.nvim" }, +} diff --git a/config/nvim/lua/telescopeimage.lua b/config/nvim/lua/telescopeimage.lua new file mode 100644 index 0000000..0ad73aa --- /dev/null +++ b/config/nvim/lua/telescopeimage.lua @@ -0,0 +1,124 @@ +local function telescope_image_preview() + local supported_images = { "svg", "png", "jpg", "jpeg", "gif", "webp", "avif" } + local from_entry = require("telescope.from_entry") + local Path = require("plenary.path") + local conf = require("telescope.config").values + local Previewers = require("telescope.previewers") + + local previewers = require("telescope.previewers") + local image_api = require("image") + + local is_image_preview = false + local image = nil + local last_file_path = "" + + local is_supported_image = function(filepath) + local split_path = vim.split(filepath:lower(), ".", { plain = true }) + local extension = split_path[#split_path] + return vim.tbl_contains(supported_images, extension) + end + + local delete_image = function() + if not image then + return + end + + image:clear() + + is_image_preview = false + end + + local create_image = function(filepath, winid, bufnr) + image = image_api.hijack_buffer(filepath, winid, bufnr) + + if not image then + return + end + + vim.schedule(function() + image:render() + end) + + is_image_preview = true + end + + local function defaulter(f, default_opts) + default_opts = default_opts or {} + return { + new = function(opts) + if conf.preview == false and not opts.preview then + return false + end + opts.preview = type(opts.preview) ~= "table" and {} or opts.preview + if type(conf.preview) == "table" then + for k, v in pairs(conf.preview) do + opts.preview[k] = vim.F.if_nil(opts.preview[k], v) + end + end + return f(opts) + end, + __call = function() + local ok, err = pcall(f(default_opts)) + if not ok then + error(debug.traceback(err)) + end + end, + } + end + + -- NOTE: Add teardown to cat previewer to clear image when close Telescope + local file_previewer = defaulter(function(opts) + opts = opts or {} + local cwd = opts.cwd or vim.loop.cwd() + return Previewers.new_buffer_previewer({ + title = "File Preview", + dyn_title = function(_, entry) + return Path:new(from_entry.path(entry, true)):normalize(cwd) + end, + + get_buffer_by_name = function(_, entry) + return from_entry.path(entry, true) + end, + + define_preview = function(self, entry, _) + local p = from_entry.path(entry, true) + if p == nil or p == "" then + return + end + + conf.buffer_previewer_maker(p, self.state.bufnr, { + bufname = self.state.bufname, + winid = self.state.winid, + preview = opts.preview, + }) + end, + + teardown = function(_) + if is_image_preview then + delete_image() + end + end, + }) + end, {}) + + local buffer_previewer_maker = function(filepath, bufnr, opts) + -- NOTE: Clear image when preview other file + if is_image_preview and last_file_path ~= filepath then + delete_image() + end + + last_file_path = filepath + + if is_supported_image(filepath) then + create_image(filepath, opts.winid, bufnr) + else + previewers.buffer_previewer_maker(filepath, bufnr, opts) + end + end + + return { buffer_previewer_maker = buffer_previewer_maker, file_previewer = file_previewer.new } +end + +return { + telescope_image_preview = telescope_image_preview +} From 677295f71c23123c44ca35b0ab989bd587896fa4 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Mon, 24 Feb 2025 12:24:29 -0700 Subject: [PATCH 49/49] Add argo rollouts plugin for k9s --- config/k9s/plugins.yaml | 51 ++++++ config/kitty/kitty.conf | 3 +- config/nvim/init.vim | 237 ++++++++++------------------ config/nvim/lua/config/theme.lua | 21 +++ config/nvim/lua/plugins/plugins.lua | 206 ++++++++++++++++++++++-- gitconfig | 2 +- 6 files changed, 352 insertions(+), 168 deletions(-) create mode 100644 config/k9s/plugins.yaml create mode 100644 config/nvim/lua/config/theme.lua diff --git a/config/k9s/plugins.yaml b/config/k9s/plugins.yaml new file mode 100644 index 0000000..34c4fb8 --- /dev/null +++ b/config/k9s/plugins.yaml @@ -0,0 +1,51 @@ +# Manage argo-rollouts +# See https://argoproj.github.io/argo-rollouts/ +# Get rollout details +# Watch rollout progress +#

(with confirmation) Promote rollout +# (with confirmation) Restart rollout +plugins: + argo-rollouts-get: + shortCut: g + confirm: false + description: Get details + scopes: + - rollouts + command: bash + background: false + args: + - -c + - kubectl argo rollouts get rollout $NAME --context $CONTEXT -n $NAMESPACE |& less + argo-rollouts-watch: + shortCut: w + confirm: false + description: Watch progress + scopes: + - rollouts + command: bash + background: false + args: + - -c + - kubectl argo rollouts get rollout $NAME --context $CONTEXT -n $NAMESPACE -w + argo-rollouts-promote: + shortCut: p + confirm: true + description: Promote + scopes: + - rollouts + command: bash + background: false + args: + - -c + - kubectl argo rollouts promote $NAME --context $CONTEXT -n $NAMESPACE |& less + argo-rollouts-restart: + shortCut: r + confirm: true + description: Restart + scopes: + - rollouts + command: bash + background: false + args: + - -c + - kubectl argo rollouts restart $NAME --context $CONTEXT -n $NAMESPACE |& less diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index 68a51e7..4442bc2 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -364,7 +364,8 @@ tab_fade 0 1 tab_separator " " -tab_title_template {title} +# tab_title_template {title} +tab_title_template "{basename:cwd}" #: The separator between tabs in the tab bar when using separator as #: the tab_bar_style. diff --git a/config/nvim/init.vim b/config/nvim/init.vim index efd7c16..9f24bdd 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -11,6 +11,10 @@ " Plugins {{{ lua require("config.lazy") + " }}} + +" Lua config {{{ + lua require("config.theme") " }}} " Vim system settings {{{ @@ -105,6 +109,14 @@ " }}} + +" lua vim settings {{{ +lua <bgl :set bg=light @@ -460,31 +473,6 @@ EOF " }}} " -" Noice {{{ - -lua <'] = cmp.mapping.confirm({ select = false }), }), sources = cmp.config.sources({ - { name = 'nvim_lsp' }, + { name = 'nvim_lsp', priority = 1000 }, + { name = "codeium", priority = 900 }, -- https://www.reddit.com/r/neovim/comments/so4g5e/comment/hw7i5n0/ { name = "nvim_lsp_signature_help" }, - { name = "codeium" }, { name = 'vsnip' }, -- For vsnip users. + { name = 'calc' }, { name = 'buffer', option = { @@ -1055,68 +1049,6 @@ EOF " }}} -" Linting {{{ - " Enable Neomake on save on expected file types - " autocmd! BufWritePost sh,markdown Neomake - " Or just enable it everywhere all the time because it's async! - " autocmd! BufEnter,BufRead,BufWritePost * Neomake - " let g:neomake_warning_sign = {'text': '⚠', 'texthl': 'NeomakeWarningSign'} - " let g:neomake_error_sign = {'text': '•', 'texthl': 'NeomakeErrorSign'} - - " let g:ale_sign_error = '⚠' - " let g:ale_sign_warning = '•' - " " Disabling trailing whitespace warnings doesn't affect Markdown because - " " markdownlint checks that too - " let g:ale_warn_about_trailing_whitespace = 0 - " let g:ale_lint_delay = 1000 - - " let g:ale_fixers = { - " \ 'javascript': ['prettier', 'eslint'], - " \ 'typescript': ['prettier'], - " \ 'css': ['prettier'], - " \} - - " let g:ale_fix_on_save = 1 - - " let b:ale_fixers = {} - " let b:ale_fixers['javascript'] = ['prettier'] - " let b:ale_fixers['typescript'] = ['prettier'] - " let b:ale_fixers['css'] = ['prettier'] - " let g:ale_fixers['*'] = ['remove_trailing_lines', 'trim_whitespace'] - - " Prettier - " let g:prettier#config#parser = 'babylon' - " let g:ale_javascript_prettier_use_local_config = 1 - - nnoremap af :ALEFix - - " NUKE FLOW TO OBLIVION. NEVER RUN FLOW. FLOW WILL CONSUME ALL YOUR RESOURCES - " AND BRING YOUR modern cutting edge hardware to a crawl. You will hard reboot - " daily. You will pull your hair out. You will hate life. - " - " UNLESS YOU DISABLE FLOW. DO THE RIGHT THING. - - " let g:ale_linters = { - " \ 'javascript': ['eslint', 'jscs', 'jshint', 'prettier', 'prettier-eslint', 'prettier-standard', 'standard', 'xo'], - " \} - - let g:ale_linters = {'clojure': ['clj-kondo']} - - " let g:ale_linters_ignore = {'typescript': ['tslint']} - - " autocmd FileType javascript - " let g:ale_javascript_prettier_options = '--single-quote --no-bracket-spacing --print-width 120' - - " let g:ale_linters = { - " \ 'javascript': ['eslint', 'jscs', 'jshint', 'prettier', 'prettier-eslint', 'prettier-standard', 'standard', 'xo'], - " \} - - nmap p (Prettier) - - " let g:ale_fix_on_save = 1 - -" }}} - " Clipboard {{{ " Put default register into system clipboard nnoremap yc :let @+=@" @@ -1126,7 +1058,6 @@ EOF " Telescope fuzzy finder {{{ - " Find files using Telescope command-line sugar. nnoremap ff Telescope find_files nnoremap p Telescope git_files @@ -1381,45 +1312,39 @@ EOF " }}} " -" yoink {{{ -nmap (YoinkPostPasteSwapBack) -nmap (YoinkPostPasteSwapForward) - -nmap p (YoinkPaste_p) -nmap P (YoinkPaste_P) +" " yoink {{{ +" nmap (YoinkPostPasteSwapBack) +" nmap (YoinkPostPasteSwapForward) -" Also replace the default gp with yoink paste so we can toggle paste in this -" case too -nmap gp (YoinkPaste_gp) -nmap gP (YoinkPaste_gP) +" nmap p (YoinkPaste_p) +" nmap P (YoinkPaste_P) -" Now when you hit [y/]y the current yank will change and you will see a preview -" of it in the status bar -nmap [y (YoinkRotateBack) -nmap ]y (YoinkRotateForward) +" " Also replace the default gp with yoink paste so we can toggle paste in this +" " case too +" nmap gp (YoinkPaste_gp) +" nmap gP (YoinkPaste_gP) -" You might also want to add a map for toggling whether the current paste is -" formatted or not: -nmap (YoinkPostPasteToggleFormat) -" Now, hitting after a paste will toggle between formatted and unformatted -" (equivalent to using the = key). +" " Now when you hit [y/]y the current yank will change and you will see a preview +" " of it in the status bar +" " nmap [y (YoinkRotateBack) +" " nmap ]y (YoinkRotateForward) -" Finally, you can also optionally add the following map: -nmap y (YoinkYankPreserveCursorPosition) -xmap y (YoinkYankPreserveCursorPosition) +" " You might also want to add a map for toggling whether the current paste is +" " formatted or not: +" nmap (YoinkPostPasteToggleFormat) +" " Now, hitting after a paste will toggle between formatted and unformatted +" " (equivalent to using the = key). -" After adding this map, yank will function exactly the same as previously with -" the one difference being that the cursor position will not change after -" performing a yank. This can be more useful especially when yanking a large -" text object such as a paragraph. +" " Finally, you can also optionally add the following map: +" nmap y (YoinkYankPreserveCursorPosition) +" xmap y (YoinkYankPreserveCursorPosition) -" }}} +" " After adding this map, yank will function exactly the same as previously with +" " the one difference being that the cursor position will not change after +" " performing a yank. This can be more useful especially when yanking a large +" " text object such as a paragraph. -" YankRing {{{ -let yankring_persist = 1 -let yankring_share_between_instances = 1 -nnoremap yr :YRShow -" }}} +" " }}} " ack {{{ if executable('ag') diff --git a/config/nvim/lua/config/theme.lua b/config/nvim/lua/config/theme.lua new file mode 100644 index 0000000..660ad3d --- /dev/null +++ b/config/nvim/lua/config/theme.lua @@ -0,0 +1,21 @@ +local function get_system_theme() + local handle = io.popen("defaults read -g AppleInterfaceStyle 2>/dev/null") + local result = handle and handle:read("*a") or "" + if handle then handle:close() end + return result:match("Dark") and "dark" or "light" +end + +local function set_theme() + local theme = get_system_theme() + if theme == "dark" then + vim.cmd("set bg=dark") -- Change to your dark theme + else + vim.cmd("set bg=light") -- Change to your light theme + end +end + +-- Run on startup +set_theme() + +-- Background watcher to check for theme changes every 5 seconds +vim.loop.new_timer():start(0, 5000, vim.schedule_wrap(set_theme)) diff --git a/config/nvim/lua/plugins/plugins.lua b/config/nvim/lua/plugins/plugins.lua index 98bab15..9c420f3 100644 --- a/config/nvim/lua/plugins/plugins.lua +++ b/config/nvim/lua/plugins/plugins.lua @@ -6,19 +6,53 @@ return { -- Git plugins { "tpope/vim-fugitive" }, { "tpope/vim-rhubarb" }, - { "shumphrey/fugitive-gitlab.vim" }, + -- { "shumphrey/fugitive-gitlab.vim" }, { "tpope/vim-git" }, -- LSP { "williamboman/mason.nvim" }, { "williamboman/mason-lspconfig.nvim" }, { "neovim/nvim-lspconfig" }, - { "nvimtools/none-ls.nvim" }, { "3rd/image.nvim" }, + { "nvimtools/none-ls.nvim", }, { "nvimtools/none-ls-extras.nvim" }, { "pmizio/typescript-tools.nvim" }, + { + "dmmulroy/ts-error-translator.nvim", + opts = {} + }, { "folke/trouble.nvim", branch = "main" }, - + { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + -- These notifications are too noisy and persistent. disable for now. + -- "rcarriga/nvim-notify", + } + }, { -- lsp outline on the right "hedyhli/outline.nvim", @@ -41,11 +75,22 @@ return { -- { "https://git.sr.ht/~whynothugo/lsp_lines.nvim" }, -- Completion - { "Exafunction/codeium.nvim", commit = "937667b2cadc7905e6b9ba18ecf84694cf227567" }, + { + "Exafunction/codeium.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "hrsh7th/nvim-cmp", + }, + config = function() + require("codeium").setup({ + }) + end + }, { "hrsh7th/cmp-nvim-lsp" }, { "hrsh7th/cmp-buffer" }, { "hrsh7th/cmp-path" }, { "hrsh7th/cmp-cmdline" }, + { "hrsh7th/cmp-calc" }, -- run calculators { "hrsh7th/nvim-cmp" }, { "hrsh7th/vim-vsnip" }, { "hrsh7th/cmp-vsnip" }, @@ -56,7 +101,9 @@ return { { "theHamsta/nvim-dap-virtual-text" }, -- Useful plugins - { "RRethy/vim-illuminate" }, + -- disabled 2025/02/21 to see if it helps perf and because it's throwing trash + -- runtime errors + -- { "RRethy/vim-illuminate" }, { "tpope/vim-repeat" }, { "tpope/vim-speeddating" }, { "tpope/vim-surround" }, @@ -75,7 +122,9 @@ return { -- General Syntax { "delphinus/vim-firestore" }, { "MichaHoffmann/tree-sitter-hcl" }, - { "mattn/emmet-vim" }, + + -- disabled 2025/02/21 - do i use this? + -- { "mattn/emmet-vim" }, { "google/vim-maktaba" }, -- { "bazelbuild/vim-bazel" }, { "jxnblk/vim-mdx-js" }, @@ -85,12 +134,57 @@ return { { "kyazdani42/nvim-tree.lua" }, -- Utils - { "MunifTanjim/nui.nvim" }, - { "rcarriga/nvim-notify" }, - { "folke/noice.nvim" }, { "kassio/neoterm" }, { "akinsho/toggleterm.nvim" }, { "kevinhwang91/nvim-bqf" }, + { + "gbprod/yanky.nvim", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + keys = { + { "y", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" }, + { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank text" }, + { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" }, + { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" }, + { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" }, + { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" }, + { "", "(YankyPreviousEntry)", desc = "Select previous entry through yank history" }, + { "", "(YankyNextEntry)", desc = "Select next entry through yank history" }, + { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" }, + { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" }, + { "]P", "(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" }, + { "[P", "(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" }, + { ">p", "(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" }, + { "(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" }, + { ">P", "(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" }, + { "(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" }, + { "=p", "(YankyPutAfterFilter)", desc = "Put after applying a filter" }, + { "=P", "(YankyPutBeforeFilter)", desc = "Put before applying a filter" }, + }, + }, + { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + bigfile = { enabled = true }, + dashboard = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + }, + }, -- Markdown preview { "iamcco/markdown-preview.nvim", build = "cd app && yarn install" }, @@ -111,6 +205,98 @@ return { { "aaronhallaert/advanced-git-search.nvim" }, { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + -- Indent objects text motions + { "michaeljsmith/vim-indent-object" }, + -- Statusline - { "nvim-lualine/lualine.nvim" }, + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' } + }, + + -- GitHub CI + { + 'topaxi/pipeline.nvim', + keys = { + { 'ci', 'Pipeline', desc = 'Open pipeline.nvim' }, + }, + -- optional, you can also install and use `yq` instead. + build = 'make', + ---@type pipeline.Config + opts = {}, + }, + + -- AI utils + { + "CopilotC-Nvim/CopilotChat.nvim", + dependencies = { + { "github/copilot.vim" }, -- or zbirenbaum/copilot.lua + { "nvim-lua/plenary.nvim", branch = "master" }, -- for curl, log and async functions + }, + build = "make tiktoken", -- Only on MacOS or Linux + opts = { + -- See Configuration section for options + }, + -- See Commands section for default commands if you want to lazy load on them + }, + { + "yetone/avante.nvim", + event = "VeryLazy", + lazy = false, + version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes. + opts = { + -- add any opts here + -- for example + provider = "openai", + openai = { + endpoint = "https://api.openai.com/v1", + model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) + timeout = 30000, -- timeout in milliseconds + temperature = 0, -- adjust if needed + max_tokens = 4096, + reasoning_effort = "high" -- only supported for "o" models + }, + }, + -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` + build = "make", + -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows + dependencies = { + "stevearc/dressing.nvim", + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + --- The below dependencies are optional, + "echasnovski/mini.pick", -- for file_selector provider mini.pick + "nvim-telescope/telescope.nvim", -- for file_selector provider telescope + "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions + "ibhagwan/fzf-lua", -- for file_selector provider fzf + "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + "zbirenbaum/copilot.lua", -- for providers='copilot' + { + -- support for image pasting + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + -- required for Windows users + use_absolute_path = true, + }, + }, + }, + { + -- Make sure to set this up properly if you have lazy=true + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + }, + } + } diff --git a/gitconfig b/gitconfig index edbe49a..82da9a8 100644 --- a/gitconfig +++ b/gitconfig @@ -96,7 +96,7 @@ ui = auto [user] name = Trevor Hartman - email = trevorhartman@gmail.com + email = th@devth.com [difftool] prompt = false [push]